Skip to content

coat: Make CommandLineOverrideHelper flavor-agnostic - #12475

Open
kjyoun wants to merge 1 commit into
youtube:mainfrom
kjyoun:flavor-agnostic-command-line-helper
Open

coat: Make CommandLineOverrideHelper flavor-agnostic#12475
kjyoun wants to merge 1 commit into
youtube:mainfrom
kjyoun:flavor-agnostic-command-line-helper

Conversation

@kjyoun

@kjyoun kjyoun commented Sep 5, 2026

Copy link
Copy Markdown
Member

Refactor CommandLineOverrideHelper to be build-flavor agnostic by
removing the CommandLineOverrideHelperParams class and accepting a
list of strings directly. This simplifies the interface and moves
environment-specific logic, such as the official build check for
remote-allow-origins, into CobaltActivity.

The change also consolidates command-line switch applications into a
single batch call and flattens nested loops for better readability.
CobaltActivity now linearly accumulates arguments from intents and
metadata. Updated unit tests to reflect the API changes.

Bug: 414009070

Refactor CommandLineOverrideHelper to be completely build-flavor
agnostic:
- Remove CommandLineOverrideHelperParams and accept @nonnull List<String>
  commandLineArgs directly in getFlagOverrides().
- Move the non-official build check for --remote-allow-origins into
  CobaltActivity.
- Consolidate switches into a single batch call to
  CommandLine.getInstance().appendSwitchesAndArguments().
- Flatten loop nesting using guard clauses.
- Refactor CobaltActivity to linearly accumulate command-line arguments
  into a List<String> via appendIntentArgs and appendMetaDataArgs.
- Update CobaltActivityTest and CommandLineOverrideHelperTest to pass
  List<String> directly.

Bug: 414009070
TAG=agy
CONV=252c4f37-0a20-4d70-84f1-eadd17dbff6a
@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor

🤖 Gemini Suggested Commit Message


android: Make CommandLineOverrideHelper flavor-agnostic

Refactor CommandLineOverrideHelper to be build-flavor agnostic by
removing the CommandLineOverrideHelperParams class and accepting a
list of strings directly. This simplifies the interface and moves
environment-specific logic, such as the official build check for
remote-allow-origins, into CobaltActivity.

The change also consolidates command-line switch applications into a
single batch call and flattens nested loops for better readability.
CobaltActivity now linearly accumulates arguments from intents and
metadata. Updated unit tests to reflect the API changes.

Bug: 414009070

💡 Pro Tips for a Better Commit Message:

  1. Influence the Result: Want to change the output? You can write custom prompts or instructions directly in the Pull Request description. The model uses that text to generate the message.
  2. Re-run the Generator: Post a comment with: /generate-commit-message

@github-actions

github-actions Bot commented Sep 5, 2026

Copy link
Copy Markdown
Contributor
Context State Description
CI / android ✅ PASS Passed
CI / aosp ✅ PASS Passed
CI / evergreen ✅ PASS Passed
CI / linux ✅ PASS Passed
CI / tvos ✅ PASS Passed
import/copybara ✅ PASS Change imported to Gerrit
kokoro ✅ PASS Kokoro build finished

@kjyoun
kjyoun marked this pull request as ready for review September 5, 2026 05:41
@kjyoun
kjyoun requested a review from a team as a code owner September 5, 2026 05:41

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors command-line argument handling in CobaltActivity and CommandLineOverrideHelper by transitioning from arrays and custom parameter objects to a simpler List structure. It cleans up the initialization flow and updates the corresponding unit tests. The feedback suggests handling potential empty strings when splitting arguments by semicolons in CommandLineOverrideHelper to avoid generating malformed command-line switches.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant