summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Fabián Kozynski <kozynski@google.com> 2023-04-24 16:35:17 -0400
committer Fabián Kozynski <kozynski@google.com> 2023-04-25 11:53:29 -0400
commit9db0ca4e84fafb978120661f211a627aa7941e66 (patch)
treeb5cb7c2b377450153587465d1dfdbb3338f6a9d8
parentdd623d85a9e9655a809ee1f6972e9d61c12b6021 (diff)
Don't dismiss DetailDialog if activity is finishing
If the task is released when the containing activity is finishing, do not dismiss the dialog. It will be dismissed by itself. See b/248562161. Test: dialog is dismissed Fixes: 210990128 Change-Id: I7c3a44cff6e0dab7f23205a8d454a293800af3b3
-rw-r--r--packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt7
1 files changed, 7 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
index 3bc5d44671e5..7cbd1f53612b 100644
--- a/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
+++ b/packages/SystemUI/src/com/android/systemui/controls/ui/DetailDialog.kt
@@ -16,6 +16,7 @@
package com.android.systemui.controls.ui
+import android.app.Activity
import android.app.ActivityOptions
import android.app.ActivityTaskManager
import android.app.ActivityTaskManager.INVALID_TASK_ID
@@ -217,6 +218,12 @@ class DetailDialog(
if (!isShowing()) return
taskView.release()
+ val isActivityFinishing =
+ (activityContext as? Activity)?.let { it.isFinishing || it.isDestroyed }
+ if (isActivityFinishing == true) {
+ // Don't dismiss the dialog if the activity is finishing, it will get removed
+ return
+ }
super.dismiss()
}
}