Merge "Set the shortcut size to large when user enabled Magnification" into main
This commit is contained in:
@@ -52,11 +52,12 @@ public class FloatingMenuSizePreferenceController extends BasePreferenceControll
|
||||
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
@IntDef({
|
||||
Size.UNKNOWN,
|
||||
Size.SMALL,
|
||||
Size.LARGE,
|
||||
})
|
||||
@VisibleForTesting
|
||||
@interface Size {
|
||||
public @interface Size {
|
||||
int UNKNOWN = -1;
|
||||
int SMALL = 0;
|
||||
int LARGE = 1;
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user