Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[quick_actions_android] Close system dialogs for integration test #5853

Merged
merged 9 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .ci/targets/android_platform_tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ tasks:
args: ["native-test", "--android", "--no-integration", "--exclude=script/configs/exclude_native_unit_android.yaml,script/configs/still_requires_api_33_avd.yaml"]
- name: native integration tests
script: script/tool_runner.sh
args: ["native-test", "--android", "--no-unit", "--exclude=script/configs/exclude_native_integration_android_emulator.yaml,script/configs/still_requires_api_33_avd.yaml"]
args: ["native-test", "--android", "--no-unit", "--exclude=script/configs/still_requires_api_33_avd.yaml"]
- name: drive examples
script: script/tool_runner.sh
args: ["drive-examples", "--android", "--exclude=script/configs/exclude_integration_android.yaml,script/configs/exclude_integration_android_emulator.yaml,script/configs/still_requires_api_33_avd.yaml"]
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void appShortcutLaunchActivityAfterStarting() {
Intent dynamicShortcutIntent = dynamicShortcut.getIntent();
AtomicReference<QuickActionsTestActivity> initialActivity = new AtomicReference<>();
scenario.onActivity(initialActivity::set);
clearAnySystemDialog(context);
String appReadySentinel = " has launched";

// Act
Expand Down Expand Up @@ -151,4 +152,10 @@ private ActivityScenario<QuickActionsTestActivity> ensureAppRunToView() {
scenario.moveToState(Lifecycle.State.STARTED);
return scenario;
}

// Broadcast a request to clear any system dialog that blocks the application from obtaining
// focus. See https://github.com/flutter/flutter/issues/140987
private void clearAnySystemDialog(Context context) {
context.sendBroadcast(new Intent(Intent.ACTION_CLOSE_SYSTEM_DIALOGS));
}
}

This file was deleted.