Skip to content

Fix intent extras merging and usage in VideoRecordingDeviceTest#516

Merged
temcguir merged 43 commits into
mainfrom
temcguir/intent_extras_fix
Jun 5, 2026
Merged

Fix intent extras merging and usage in VideoRecordingDeviceTest#516
temcguir merged 43 commits into
mainfrom
temcguir/intent_extras_fix

Conversation

@temcguir
Copy link
Copy Markdown
Collaborator

@temcguir temcguir commented May 15, 2026

Problem

The special logic to force "SingleLensMode" on emulators via compatMainActivityExtras was being lost when tests passed custom extras, or not used at all in tests returning results.

Solution

  • Fixed runMainActivityScenarioTest in UiTestUtil.kt to properly merge compatMainActivityExtras with provided extras.
  • Updated tests in VideoRecordingDeviceTest.kt to use runMainActivityScenarioTestForResult which handles this merging.

Impact

Ensures emulators always run in single lens mode where intended, avoiding initialization timeouts.

temcguir added 6 commits May 14, 2026 21:35
Fixed runMainActivityScenarioTest to merge compatMainActivityExtras with provided extras instead of ignoring them when extras are present.

Updated VideoRecordingDeviceTest to use runMainActivityScenarioTestForResult instead of runScenarioTestForResult<MainActivity> to ensure compatMainActivityExtras are applied.

TAG=agy

CONV=ede7015c-6915-452c-91bf-1734f3aecca3
Fixed runMainActivityScenarioTest to merge compatMainActivityExtras with provided extras instead of ignoring them when extras are present.

Updated VideoRecordingDeviceTest to use runMainActivityScenarioTestForResult instead of runScenarioTestForResult<MainActivity> to ensure compatMainActivityExtras are applied.

TAG=agy

CONV=ede7015c-6915-452c-91bf-1734f3aecca3
Copy link
Copy Markdown
Contributor

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

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 updates test utilities to support disabling animations through TestStorage and refactors MainActivity scenario tests to merge provided extras with compatibility settings. Feedback suggests adding KDoc documentation, using more restrictive visibility modifiers, removing debug logs, and extracting the extras-merging logic into a reusable helper function to improve maintainability and adhere to the DRY principle.

Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/UiTestUtil.kt Outdated
@temcguir temcguir marked this pull request as ready for review May 15, 2026 22:11
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/UiTestUtil.kt Outdated
Comment thread app/src/androidTest/java/com/google/jetpackcamera/utils/UiTestUtil.kt Outdated
@temcguir temcguir changed the base branch from main to temcguir/elapsed_time_opt May 22, 2026 15:53
@temcguir temcguir force-pushed the temcguir/elapsed_time_opt branch 6 times, most recently from 2133254 to d40c9ed Compare June 3, 2026 23:27
Base automatically changed from temcguir/elapsed_time_opt to main June 4, 2026 00:21
temcguir added 4 commits June 4, 2026 00:30
…nto temcguir/intent_extras_fix

# Conflicts:
#	.gemini/styleguide.md
#	ui/components/capture/src/main/java/com/google/jetpackcamera/ui/components/capture/CaptureScreenComponents.kt
#	ui/uistateadapter/capture/src/main/java/com/google/jetpackcamera/ui/uistateadapter/capture/compound/CaptureUiStateAdapter.kt
#	ui/uistateadapter/capture/src/test/java/com/google/jetpackcamera/ui/uistateadapter/capture/CaptureUiStateAdapterTest.kt
@temcguir temcguir force-pushed the temcguir/intent_extras_fix branch from 1df4762 to cd4e0a6 Compare June 4, 2026 00:40
@temcguir temcguir requested a review from Kimblebee June 4, 2026 01:08
@temcguir temcguir merged commit d7bbb91 into main Jun 5, 2026
11 checks passed
@temcguir temcguir deleted the temcguir/intent_extras_fix branch June 5, 2026 21:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants