summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authorAlan Viverette <alanv@google.com>2013-12-10 21:58:44 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-12-10 21:58:45 +0000
commit22b70376edd07a011eddb7d74c60c83fa575a1a2 (patch)
tree75b03d756c07a131cd7d9c848d98e518c6494ad6 /src/com/android
parent3829a7b2e57ca7683dbb77ce0d9df305d7fdd902 (diff)
parent96118a4d53699dd0ac440d0019b87a5043ee01ef (diff)
downloadpackages_apps_Settings-22b70376edd07a011eddb7d74c60c83fa575a1a2.tar.gz
packages_apps_Settings-22b70376edd07a011eddb7d74c60c83fa575a1a2.tar.bz2
packages_apps_Settings-22b70376edd07a011eddb7d74c60c83fa575a1a2.zip
Merge "Accessibility: filter touches to Enable button"
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java65
1 files changed, 34 insertions, 31 deletions
diff --git a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
index 0c568f063..f097fd681 100644
--- a/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
+++ b/src/com/android/settings/accessibility/ToggleAccessibilityServicePreferenceFragment.java
@@ -154,41 +154,44 @@ public class ToggleAccessibilityServicePreferenceFragment
public Dialog onCreateDialog(int dialogId) {
switch (dialogId) {
case DIALOG_ID_ENABLE_WARNING: {
- mShownDialogId = DIALOG_ID_ENABLE_WARNING;
- AccessibilityServiceInfo info = getAccessibilityServiceInfo();
- if (info == null) {
- return null;
+ mShownDialogId = DIALOG_ID_ENABLE_WARNING;
+ AccessibilityServiceInfo info = getAccessibilityServiceInfo();
+ if (info == null) {
+ return null;
+ }
+ AlertDialog ad = new AlertDialog.Builder(getActivity())
+ .setTitle(getString(R.string.enable_service_title,
+ info.getResolveInfo().loadLabel(getPackageManager())))
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setView(createEnableDialogContentView(info))
+ .setCancelable(true)
+ .setPositiveButton(android.R.string.ok, this)
+ .setNegativeButton(android.R.string.cancel, this)
+ .create();
+ ad.getButton(AlertDialog.BUTTON_POSITIVE)
+ .setFilterTouchesWhenObscured(true);
+ return ad;
}
- return new AlertDialog.Builder(getActivity())
- .setTitle(getString(R.string.enable_service_title,
- info.getResolveInfo().loadLabel(getPackageManager())))
- .setIconAttribute(android.R.attr.alertDialogIcon)
- .setView(createEnableDialogContentView(info))
- .setCancelable(true)
- .setPositiveButton(android.R.string.ok, this)
- .setNegativeButton(android.R.string.cancel, this)
- .create();
- }
case DIALOG_ID_DISABLE_WARNING: {
- mShownDialogId = DIALOG_ID_DISABLE_WARNING;
- AccessibilityServiceInfo info = getAccessibilityServiceInfo();
- if (info == null) {
- return null;
+ mShownDialogId = DIALOG_ID_DISABLE_WARNING;
+ AccessibilityServiceInfo info = getAccessibilityServiceInfo();
+ if (info == null) {
+ return null;
+ }
+ return new AlertDialog.Builder(getActivity())
+ .setTitle(getString(R.string.disable_service_title,
+ info.getResolveInfo().loadLabel(getPackageManager())))
+ .setIconAttribute(android.R.attr.alertDialogIcon)
+ .setMessage(getString(R.string.disable_service_message,
+ info.getResolveInfo().loadLabel(getPackageManager())))
+ .setCancelable(true)
+ .setPositiveButton(android.R.string.ok, this)
+ .setNegativeButton(android.R.string.cancel, this)
+ .create();
}
- return new AlertDialog.Builder(getActivity())
- .setTitle(getString(R.string.disable_service_title,
- info.getResolveInfo().loadLabel(getPackageManager())))
- .setIconAttribute(android.R.attr.alertDialogIcon)
- .setMessage(getString(R.string.disable_service_message,
- info.getResolveInfo().loadLabel(getPackageManager())))
- .setCancelable(true)
- .setPositiveButton(android.R.string.ok, this)
- .setNegativeButton(android.R.string.cancel, this)
- .create();
- }
default: {
- throw new IllegalArgumentException();
- }
+ throw new IllegalArgumentException();
+ }
}
}