Accessibility: filter touches to Enable button
To prevent tap-jacking, filter touches to the enable button if there is another window obscuring the screen. Bug: 11242907 Change-Id: I0228cd480faf8e7ebf70394d9bb60fa2e4138fb4
This commit is contained in:
@@ -159,7 +159,7 @@ public class ToggleAccessibilityServicePreferenceFragment
|
|||||||
if (info == null) {
|
if (info == null) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new AlertDialog.Builder(getActivity())
|
AlertDialog ad = new AlertDialog.Builder(getActivity())
|
||||||
.setTitle(getString(R.string.enable_service_title,
|
.setTitle(getString(R.string.enable_service_title,
|
||||||
info.getResolveInfo().loadLabel(getPackageManager())))
|
info.getResolveInfo().loadLabel(getPackageManager())))
|
||||||
.setIconAttribute(android.R.attr.alertDialogIcon)
|
.setIconAttribute(android.R.attr.alertDialogIcon)
|
||||||
@@ -168,6 +168,9 @@ public class ToggleAccessibilityServicePreferenceFragment
|
|||||||
.setPositiveButton(android.R.string.ok, this)
|
.setPositiveButton(android.R.string.ok, this)
|
||||||
.setNegativeButton(android.R.string.cancel, this)
|
.setNegativeButton(android.R.string.cancel, this)
|
||||||
.create();
|
.create();
|
||||||
|
ad.getButton(AlertDialog.BUTTON_POSITIVE)
|
||||||
|
.setFilterTouchesWhenObscured(true);
|
||||||
|
return ad;
|
||||||
}
|
}
|
||||||
case DIALOG_ID_DISABLE_WARNING: {
|
case DIALOG_ID_DISABLE_WARNING: {
|
||||||
mShownDialogId = DIALOG_ID_DISABLE_WARNING;
|
mShownDialogId = DIALOG_ID_DISABLE_WARNING;
|
||||||
|
Reference in New Issue
Block a user