Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4c8331b3 authored by Roy Chou's avatar Roy Chou
Browse files

chore(#AlwaysOnMagnifier): Replace string constant with Settings Pref Key

In AccessibilityManagerService, previously we use string constant as the
name in Settings getter method. After the Settings key is defined, we replace
the string constants with the defined key.

Bug: 146504200
Test: atest AccessibilityManagerServiceTest
Change-Id: Ia31a068f9e882b2f5e5a1a3112b682006ee54fe1
parent c2ffacf2
Loading
Loading
Loading
Loading
+2 −4
Original line number Diff line number Diff line
@@ -4379,9 +4379,8 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
        private final Uri mMagnificationFollowTypingUri = Settings.Secure.getUriFor(
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_FOLLOW_TYPING_ENABLED);

        // TODO: replace name with Settings Secure Key
        private final Uri mAlwaysOnMagnificationUri = Settings.Secure.getUriFor(
                "accessibility_magnification_always_on_enabled");
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED);

        private final Uri mUiContrastUri = Settings.Secure.getUriFor(
                CONTRAST_LEVEL);
@@ -4615,10 +4614,9 @@ public class AccessibilityManagerService extends IAccessibilityManager.Stub
    }

    boolean readAlwaysOnMagnificationLocked(AccessibilityUserState userState) {
        // TODO: replace name const with Settings Secure Key
        final boolean isSettingsAlwaysOnEnabled = Settings.Secure.getIntForUser(
                mContext.getContentResolver(),
                "accessibility_magnification_always_on_enabled",
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED,
                0, userState.mUserId) == 1;
        final boolean isAlwaysOnFeatureFlagEnabled = mMagnificationController
                .isAlwaysOnMagnificationFeatureFlagEnabled();
+2 −4
Original line number Diff line number Diff line
@@ -448,8 +448,7 @@ public class AccessibilityManagerServiceTest {
                mA11yms.getCurrentUserIdLocked());
        Settings.Secure.putIntForUser(
                mTestableContext.getContentResolver(),
                // TODO: replace name with Settings Secure Key
                "accessibility_magnification_always_on_enabled",
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED,
                1, mA11yms.getCurrentUserIdLocked());

        mA11yms.readAlwaysOnMagnificationLocked(userState);
@@ -466,8 +465,7 @@ public class AccessibilityManagerServiceTest {
                mA11yms.getCurrentUserIdLocked());
        Settings.Secure.putIntForUser(
                mTestableContext.getContentResolver(),
                // TODO: replace name with Settings Secure Key
                "accessibility_magnification_always_on_enabled",
                Settings.Secure.ACCESSIBILITY_MAGNIFICATION_ALWAYS_ON_ENABLED,
                1, mA11yms.getCurrentUserIdLocked());

        mA11yms.readAlwaysOnMagnificationLocked(userState);