summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Chris Göllner <chrisgollner@google.com> 2023-10-06 14:32:34 +0100
committer Chris Göllner <chrisgollner@google.com> 2023-10-06 14:20:58 +0000
commit26070c15351bf68c8e9968754e6e6406f596de19 (patch)
treef91f504893a023b419b990174a6f418dd50ab77c
parentf74687c7b45201ee4ab265670f6dea8504d77b88 (diff)
PSS fix permission dialog not re-showing after config change
When the permission dialog is showing, and a configuration change happens (e.g. display size change), there is an issue that the dialog is not shown again. The problem seems to be that the permission activity and dialog are created, but the callback `onDialogDismissed` is immediately triggered, in the permission activity, which calls finish() on the activity. Somehow, removing cancel and dismiss listeners in onDestroy, solves this problem. I was surprised, because I don't understand how removing a listener on the previous activity can affect the listeners on the new activity, which uses a new instance of a dialog. Change-Id: I3e87933f9439ab046eda92bc5863b29fad57f0db Test: Manual - Share screen using the zoom app. Then change display size multiple times using adb. Not sure how to write an automated test for this yet. Fixes: 286563020
-rw-r--r--packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java2
1 files changed, 2 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
index 2b56d0cf9f83..d08d0400f354 100644
--- a/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
+++ b/packages/SystemUI/src/com/android/systemui/mediaprojection/permission/MediaProjectionPermissionActivity.java
@@ -239,6 +239,8 @@ public class MediaProjectionPermissionActivity extends Activity
protected void onDestroy() {
super.onDestroy();
if (mDialog != null) {
+ mDialog.setOnDismissListener(null);
+ mDialog.setOnCancelListener(null);
mDialog.dismiss();
}
}