Set the shortcut size to large when user enabled Magnification

Set the settings shortcut size to large when the Magnification shortcut it enabled. Provide users with the large size as the default, which is easy to see.

Bug: 283844702
Test: manually - attach videos in the bug
Test: atest ToggleScreenMagnificationPreferenceFragmentTest
Test: make RunSettingsRoboTests ROBOTEST_FILTER=ToggleScreenMagnificationPreferenceFragmentTest
Change-Id: I8fac5780b8388b1b4f124cffbdd305235f035e72
This commit is contained in:
Jean
2023-06-28 05:58:01 +00:00
committed by Jean Chen
parent 4dd2e56ddf
commit 137cc9af68
3 changed files with 84 additions and 3 deletions

View File

@@ -643,6 +643,17 @@ public class ToggleScreenMagnificationPreferenceFragment extends
joiner.add(MAGNIFICATION_CONTROLLER_NAME);
Settings.Secure.putString(context.getContentResolver(), targetKey, joiner.toString());
// The size setting defaults to unknown. If the user has ever manually changed the size
// before, we do not automatically change it.
if (shortcutType == UserShortcutType.SOFTWARE
&& Settings.Secure.getInt(context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_SIZE,
FloatingMenuSizePreferenceController.Size.UNKNOWN)
== FloatingMenuSizePreferenceController.Size.UNKNOWN) {
Settings.Secure.putInt(context.getContentResolver(),
Settings.Secure.ACCESSIBILITY_FLOATING_MENU_SIZE,
FloatingMenuSizePreferenceController.Size.LARGE);
}
}
@VisibleForTesting