diff options
author | 2024-01-11 00:39:06 +0000 | |
---|---|---|
committer | 2024-01-11 00:39:06 +0000 | |
commit | 1ed3129c904d7d595b5394f106af6a0296bae2df (patch) | |
tree | 20b206674e71cb730ff900580e39bb6836bda844 | |
parent | 82a839c11042c5e152c2ad2bf2a46645b830acc6 (diff) | |
parent | 0341a69cc961cc09a24601996c087e1bb017377a (diff) |
Merge "Dismiss dialogs in onStop()" into udc-mainline-prod am: 0341a69cc9
Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/modules/Wifi/+/25846274
Change-Id: If6023615f281f3d7ea1f12ab2fc181f2f748fd3d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java | 18 |
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 7bbfed3b8a..4dab628bbc 100644 --- a/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java +++ b/WifiDialog/src/com/android/wifi/dialog/WifiDialogActivity.java @@ -246,19 +246,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 |