summaryrefslogtreecommitdiff
path: root/PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java
diff options
context:
space:
mode:
authorJay Thomas Sullivan <jaysullivan@google.com>2022-10-11 13:00:12 -0700
committerJay Sullivan <jaysullivan@google.com>2022-10-11 20:10:36 +0000
commit3092c0c41dadfd391a126bdbca1a545d7d046ed9 (patch)
treea4f764ae9bbf89d808fb7418fa9ae9d86d09ff76 /PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java
parent4dc41d75122e30f9c0d02e1874b090374dc18e70 (diff)
downloadPermission-3092c0c41dadfd391a126bdbca1a545d7d046ed9.tar.gz
Handle clicking outside of AlertDialog
This AlertDialog has two buttons, "Back" and "Confirm". But, there's actually another action that can occur: the user can click outside the dialog. Currently, we don't handle this action, and the default behavior is undesirable (it behaves like "Confirm"). Change the behavior of clicking outside the dialog to match the behavior of clicking "Back". Test: atest MediaPermissionTest Bug: 244144105 Change-Id: I20ba44edd4144471b636ff26831a43e3bcb7a2ec
Diffstat (limited to 'PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java')
-rw-r--r--PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java3
1 files changed, 3 insertions, 0 deletions
diff --git a/PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java b/PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java
index 8500fadad..ad6b993fa 100644
--- a/PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java
+++ b/PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java
@@ -461,6 +461,9 @@ public class AutoAppPermissionFragment extends AutoSettingsFrameFragment
AlertDialog.Builder b = new AlertDialog.Builder(getContext())
.setIcon(args.getIconId())
.setMessage(args.getMessageId())
+ .setOnCancelListener((DialogInterface dialog) -> {
+ setRadioButtonsState(mViewModel.getButtonStateLiveData().getValue());
+ })
.setNegativeButton(args.getNegativeButtonTextId(),
(DialogInterface dialog, int which) -> {
setRadioButtonsState(mViewModel.getButtonStateLiveData().getValue());