Settings for the screen magnification feature.

1. Screen magnification on the device has to he explicitly enabled
   by the user before allowing a global gesture related interactions.
   The feature toggle setting is in Settings->Accessibility and it
   is a separate screen with instructions how to use the feature
   and a toggle switch.

2. Added a setting in developer options for toggling the magnification
   auto update feature. If this features is on the screen is zoomed
   out or rotation or activity start. Also if the feature is enabled
   the magnified viewport will scroll to show popped up windows.

bug:5587727

Change-Id: Ic45a21d3a3928e2f5aac034751801f090b261488
This commit is contained in:
Svetoslav Ganov
2012-08-06 10:55:11 -07:00
parent 96c2f8c508
commit decf36e6a5
5 changed files with 341 additions and 200 deletions

View File

@@ -98,6 +98,8 @@ public class DevelopmentSettings extends PreferenceFragment
private static final String TRANSITION_ANIMATION_SCALE_KEY = "transition_animation_scale";
private static final String ANIMATOR_DURATION_SCALE_KEY = "animator_duration_scale";
private static final String OVERLAY_DISPLAY_DEVICES_KEY = "overlay_display_devices";
private static final String ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE_KEY =
"accessibility_display_magnification_auto_update";
private static final String ENABLE_TRACES_KEY = "enable_traces";
@@ -142,6 +144,7 @@ public class DevelopmentSettings extends PreferenceFragment
private CheckBoxPreference mShowHwScreenUpdates;
private CheckBoxPreference mShowHwLayersUpdates;
private CheckBoxPreference mDebugLayout;
private CheckBoxPreference mDisplayMangificationAutoUpdate;
private ListPreference mWindowAnimationScale;
private ListPreference mTransitionAnimationScale;
private ListPreference mAnimatorDurationScale;
@@ -237,6 +240,9 @@ public class DevelopmentSettings extends PreferenceFragment
mAllPrefs.add(hdcpChecking);
}
removeHdcpOptionsForProduction();
mDisplayMangificationAutoUpdate = findAndInitCheckboxPref(
ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE_KEY);
}
private CheckBoxPreference findAndInitCheckboxPref(String key) {
@@ -370,6 +376,7 @@ public class DevelopmentSettings extends PreferenceFragment
updateImmediatelyDestroyActivitiesOptions();
updateAppProcessLimitOptions();
updateShowAllANRsOptions();
updateDisplayMagnificationAutoUpdate();
}
private void resetDangerousOptions() {
@@ -623,6 +630,12 @@ public class DevelopmentSettings extends PreferenceFragment
pokeSystemProperties();
}
private void writeDisplayMagnificationAutoUpdate() {
Settings.Secure.putInt(getActivity().getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE,
mDisplayMangificationAutoUpdate.isChecked() ? 1 : 0);
}
private void updateCpuUsageOptions() {
updateCheckBox(mShowCpuUsage, Settings.System.getInt(getActivity().getContentResolver(),
Settings.System.SHOW_PROCESSES, 0) != 0);
@@ -756,6 +769,12 @@ public class DevelopmentSettings extends PreferenceFragment
getActivity().getContentResolver(), Settings.Secure.ANR_SHOW_BACKGROUND, 0) != 0);
}
private void updateDisplayMagnificationAutoUpdate() {
updateCheckBox(mDisplayMangificationAutoUpdate,
Settings.Secure.getInt(getActivity().getContentResolver(),
Settings.Secure.ACCESSIBILITY_DISPLAY_MAGNIFICATION_AUTO_UPDATE, 0) != 0);
}
private void updateEnableTracesOptions() {
long flags = SystemProperties.getLong(Trace.PROPERTY_TRACE_TAG_ENABLEFLAGS, 0);
String[] values = mEnableTracesPref.getEntryValues();
@@ -909,6 +928,8 @@ public class DevelopmentSettings extends PreferenceFragment
writeShowHwLayersUpdatesOptions();
} else if (preference == mDebugLayout) {
writeDebugLayoutOptions();
} else if (preference == mDisplayMangificationAutoUpdate) {
writeDisplayMagnificationAutoUpdate();
}
return false;