Loading packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +13 −6 Original line number Diff line number Diff line Loading @@ -4780,17 +4780,23 @@ public class SettingsProvider extends ContentProvider { } if (currentVersion == 192) { // Version 192: set the default value for magnification capabilities. If // magnification is enabled by the user, set it to full-screen, and set a value // to show a prompt when using the magnification first time after upgrading. // Version 192: set the default value for magnification capabilities. // If the device supports magnification area and magnification is enabled // by the user, set it to full-screen, and set a value to show a prompt // when using the magnification first time after upgrading. final SettingsState secureSettings = getSecureSettingsLocked(userId); final Setting magnificationCapabilities = secureSettings.getSettingLocked( Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY); final boolean supportMagnificationArea = getContext().getResources().getBoolean( com.android.internal.R.bool.config_magnification_area); final int capability = supportMagnificationArea ? R.integer.def_accessibility_magnification_capabilities : Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN; final String supportShowPrompt = supportMagnificationArea ? "1" : "0"; if (magnificationCapabilities.isNull()) { secureSettings.insertSettingLocked( Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY, String.valueOf(getContext().getResources().getInteger( R.integer.def_accessibility_magnification_capabilities)), String.valueOf(getContext().getResources().getInteger(capability)), null, true, SettingsState.SYSTEM_PACKAGE_NAME); if (isMagnificationSettingsOn(secureSettings)) { Loading @@ -4800,7 +4806,8 @@ public class SettingsProvider extends ContentProvider { null, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); secureSettings.insertSettingLocked( Secure.ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT, "1", Secure.ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT, supportShowPrompt, null, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); } Loading services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java +9 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,9 @@ class AccessibilityUserState { private int mNonInteractiveUiTimeout = 0; private int mInteractiveUiTimeout = 0; private int mLastSentClientState = -1; /** {@code true} if the device config supports magnification area. */ private final boolean mSupportMagnificationArea; // The magnification mode of default display. private int mMagnificationMode = ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN; // The magnification capabilities used to know magnification mode could be switched. Loading @@ -138,6 +141,10 @@ class AccessibilityUserState { private int mSoftKeyboardShowMode = SHOW_MODE_AUTO; boolean isValidMagnificationModeLocked() { if (!mSupportMagnificationArea && mMagnificationMode == Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW) { return false; } return (mMagnificationCapabilities & mMagnificationMode) != 0; } Loading @@ -156,6 +163,8 @@ class AccessibilityUserState { R.color.accessibility_focus_highlight_color); mFocusStrokeWidth = mFocusStrokeWidthDefaultValue; mFocusColor = mFocusColorDefaultValue; mSupportMagnificationArea = mContext.getResources().getBoolean( R.bool.config_magnification_area); } boolean isHandlingAccessibilityEventsLocked() { Loading Loading
packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java +13 −6 Original line number Diff line number Diff line Loading @@ -4780,17 +4780,23 @@ public class SettingsProvider extends ContentProvider { } if (currentVersion == 192) { // Version 192: set the default value for magnification capabilities. If // magnification is enabled by the user, set it to full-screen, and set a value // to show a prompt when using the magnification first time after upgrading. // Version 192: set the default value for magnification capabilities. // If the device supports magnification area and magnification is enabled // by the user, set it to full-screen, and set a value to show a prompt // when using the magnification first time after upgrading. final SettingsState secureSettings = getSecureSettingsLocked(userId); final Setting magnificationCapabilities = secureSettings.getSettingLocked( Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY); final boolean supportMagnificationArea = getContext().getResources().getBoolean( com.android.internal.R.bool.config_magnification_area); final int capability = supportMagnificationArea ? R.integer.def_accessibility_magnification_capabilities : Secure.ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN; final String supportShowPrompt = supportMagnificationArea ? "1" : "0"; if (magnificationCapabilities.isNull()) { secureSettings.insertSettingLocked( Secure.ACCESSIBILITY_MAGNIFICATION_CAPABILITY, String.valueOf(getContext().getResources().getInteger( R.integer.def_accessibility_magnification_capabilities)), String.valueOf(getContext().getResources().getInteger(capability)), null, true, SettingsState.SYSTEM_PACKAGE_NAME); if (isMagnificationSettingsOn(secureSettings)) { Loading @@ -4800,7 +4806,8 @@ public class SettingsProvider extends ContentProvider { null, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); secureSettings.insertSettingLocked( Secure.ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT, "1", Secure.ACCESSIBILITY_SHOW_WINDOW_MAGNIFICATION_PROMPT, supportShowPrompt, null, false /* makeDefault */, SettingsState.SYSTEM_PACKAGE_NAME); } Loading
services/accessibility/java/com/android/server/accessibility/AccessibilityUserState.java +9 −0 Original line number Diff line number Diff line Loading @@ -118,6 +118,9 @@ class AccessibilityUserState { private int mNonInteractiveUiTimeout = 0; private int mInteractiveUiTimeout = 0; private int mLastSentClientState = -1; /** {@code true} if the device config supports magnification area. */ private final boolean mSupportMagnificationArea; // The magnification mode of default display. private int mMagnificationMode = ACCESSIBILITY_MAGNIFICATION_MODE_FULLSCREEN; // The magnification capabilities used to know magnification mode could be switched. Loading @@ -138,6 +141,10 @@ class AccessibilityUserState { private int mSoftKeyboardShowMode = SHOW_MODE_AUTO; boolean isValidMagnificationModeLocked() { if (!mSupportMagnificationArea && mMagnificationMode == Settings.Secure.ACCESSIBILITY_MAGNIFICATION_MODE_WINDOW) { return false; } return (mMagnificationCapabilities & mMagnificationMode) != 0; } Loading @@ -156,6 +163,8 @@ class AccessibilityUserState { R.color.accessibility_focus_highlight_color); mFocusStrokeWidth = mFocusStrokeWidthDefaultValue; mFocusColor = mFocusColorDefaultValue; mSupportMagnificationArea = mContext.getResources().getBoolean( R.bool.config_magnification_area); } boolean isHandlingAccessibilityEventsLocked() { Loading