Add config to enable/disable single panning depending on device

updateController will load the default value from the respective
config/xml file and set the value to the default value. This feature
will be disabled by default, but can be enabled by devices via config
overlay

Bug: 282065026, 279498927
Test: manual test
Change-Id: I23ee76d41f8de7b75e8ff224f027a45c1257d67e
This commit is contained in:
ktanojo
2023-05-12 21:19:10 +00:00
committed by Kiara Patricia
parent 90a49af20a
commit dcee5c41ee
3 changed files with 10 additions and 1 deletions

View File

@@ -6559,6 +6559,10 @@
serialization, a default vibration will be used.
Note that, indefinitely repeating vibrations are not allowed as shutdown vibrations. -->
<string name="config_defaultShutdownVibrationFile" />
<!-- Whether single finger panning is enabled when magnification is on -->
<bool name="config_enable_a11y_magnification_single_panning">false</bool>
<!-- The file path in which custom vibrations are provided for haptic feedbacks.
If the device does not specify any such file path here, if the file path specified here
does not exist, or if the contents of the file does not make up a valid customization

View File

@@ -5179,5 +5179,8 @@
<java-symbol type="drawable" name="focus_event_pressed_key_background" />
<java-symbol type="string" name="config_defaultShutdownVibrationFile" />
<java-symbol type="string" name="lockscreen_too_many_failed_attempts_countdown" />
<java-symbol type="bool" name="config_enable_a11y_magnification_single_panning" />
<java-symbol type="string" name="config_hapticFeedbackCustomizationFile" />
</resources>

View File

@@ -204,7 +204,9 @@ public class FullScreenMagnificationGestureHandler extends MagnificationGestureH
mViewportDraggingState = new ViewportDraggingState();
mPanningScalingState = new PanningScalingState(context);
mSinglePanningState = new SinglePanningState(context);
setSinglePanningEnabled(false);
setSinglePanningEnabled(
context.getResources()
.getBoolean(R.bool.config_enable_a11y_magnification_single_panning));
if (mDetectShortcutTrigger) {
mScreenStateReceiver = new ScreenStateReceiver(context, this);