[Companion] Make notification dialog non-cancelable
Bug: 63405718 Test: Ensute that the notification access dialog is not dismissable with either back button or touch outside Change-Id: I613da247a2adc0571478f649a2191cd5840359f0
This commit is contained in:
@@ -82,6 +82,9 @@ public class NotificationAccessConfirmationActivity extends Activity
|
|||||||
AlertController
|
AlertController
|
||||||
.create(this, this, getWindow())
|
.create(this, this, getWindow())
|
||||||
.installContent(p);
|
.installContent(p);
|
||||||
|
// Consistent with the permission dialog
|
||||||
|
// Used instead of p.mCancelable as that is only honored for AlertDialog
|
||||||
|
getWindow().setCloseOnTouchOutside(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onAllow() {
|
private void onAllow() {
|
||||||
@@ -108,6 +111,12 @@ public class NotificationAccessConfirmationActivity extends Activity
|
|||||||
return AlertActivity.dispatchPopulateAccessibilityEvent(this, event);
|
return AlertActivity.dispatchPopulateAccessibilityEvent(this, event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBackPressed() {
|
||||||
|
// Suppress finishing the activity on back button press,
|
||||||
|
// consistently with the permission dialog behavior
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void cancel() {
|
public void cancel() {
|
||||||
finish();
|
finish();
|
||||||
|
Reference in New Issue
Block a user