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

This commit is contained in:
Roy Chou
2023-02-09 01:20:32 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 8 deletions

View File

@@ -4384,9 +4384,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);
@@ -4620,10 +4619,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();

View File

@@ -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);