diff options
author | Jay Thomas Sullivan <jaysullivan@google.com> | 2022-10-11 13:00:12 -0700 |
---|---|---|
committer | Jay Sullivan <jaysullivan@google.com> | 2022-10-11 20:10:36 +0000 |
commit | 3092c0c41dadfd391a126bdbca1a545d7d046ed9 (patch) | |
tree | a4f764ae9bbf89d808fb7418fa9ae9d86d09ff76 /PermissionController/src/com/android/permissioncontroller/permission/ui/auto/AutoAppPermissionFragment.java | |
parent | 4dc41d75122e30f9c0d02e1874b090374dc18e70 (diff) | |
download | Permission-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.java | 3 |
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()); |