summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Quang Luong <qal@google.com> 2024-01-10 23:34:28 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2024-01-10 23:34:28 +0000
commit0341a69cc961cc09a24601996c087e1bb017377a (patch)
tree7d8785af406666e402a4df3d98e8c5d51d6216bb
parent31daaccf0a92a5f80448f166c958b34c33799957 (diff)
parentfd66c04cbb9a6cd80b487ab45873a226073f2428 (diff)
Merge "Dismiss dialogs in onStop()" into udc-mainline-prod
-rw-r--r--WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java b/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
index 198e07d532..479227009a 100644
--- a/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
+++ b/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java
@@ -249,19 +249,17 @@ public class WifiDialogActivity extends Activity {
@Override
protected void onStop() {
super.onStop();
- if (!isChangingConfigurations()) {
- if (!BuildCompat.isAtLeastU()) {
- // Before U, we don't have INTERNAL_SYSTEM_WINDOW permission to always show at the
- // top, so close all dialogs when we're not visible anymore.
- for (int i = 0; i < mActiveDialogsPerId.size(); i++) {
- mActiveDialogsPerId.valueAt(i).cancel();
- }
+ if (!isChangingConfigurations() && !BuildCompat.isAtLeastU()) {
+ // Before U, we don't have INTERNAL_SYSTEM_WINDOW permission to always show at the
+ // top, so close all dialogs when we're not visible anymore (i.e. another app launches
+ // on top of us).
+ for (int i = 0; i < mActiveDialogsPerId.size(); i++) {
+ mActiveDialogsPerId.valueAt(i).cancel();
}
return;
}
- // If we're stopping due to a configuration change, dismiss all the dialogs without
- // removing it from mLaunchIntentsPerId to prevent window leaking. The dialogs will be
- // recreated from mLaunchIntentsPerId in onStart().
+ // Dismiss all the dialogs without removing it from mLaunchIntentsPerId to prevent window
+ // leaking. The dialogs will be recreated from mLaunchIntentsPerId in onStart().
for (int i = 0; i < mActiveDialogsPerId.size(); i++) {
Dialog dialog = mActiveDialogsPerId.valueAt(i);
// Set the dismiss listener to null to prevent removing the Intent from