Merge "InputSettings: fix touchpad tap-to-click default" into udc-qpr-dev am: bb3516fead
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23411858 Change-Id: Ic05b7e78960dbed2bf74085a1c5dead2d966a259 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -266,7 +266,7 @@ public class InputSettings {
|
||||
*/
|
||||
public static boolean useTouchpadTapToClick(@NonNull Context context) {
|
||||
return Settings.System.getIntForUser(context.getContentResolver(),
|
||||
Settings.System.TOUCHPAD_TAP_TO_CLICK, 0, UserHandle.USER_CURRENT) == 1;
|
||||
Settings.System.TOUCHPAD_TAP_TO_CLICK, 1, UserHandle.USER_CURRENT) == 1;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -115,35 +115,34 @@ class InputSettingsObserver extends ContentObserver {
|
||||
return setting != 0;
|
||||
}
|
||||
|
||||
private int getPointerSpeedValue(String settingName) {
|
||||
int speed = Settings.System.getIntForUser(mContext.getContentResolver(),
|
||||
settingName, InputSettings.DEFAULT_POINTER_SPEED, UserHandle.USER_CURRENT);
|
||||
private int constrainPointerSpeedValue(int speed) {
|
||||
return Math.min(Math.max(speed, InputSettings.MIN_POINTER_SPEED),
|
||||
InputSettings.MAX_POINTER_SPEED);
|
||||
}
|
||||
|
||||
private void updateMousePointerSpeed() {
|
||||
mNative.setPointerSpeed(getPointerSpeedValue(Settings.System.POINTER_SPEED));
|
||||
int speed = Settings.System.getIntForUser(mContext.getContentResolver(),
|
||||
Settings.System.POINTER_SPEED, InputSettings.DEFAULT_POINTER_SPEED,
|
||||
UserHandle.USER_CURRENT);
|
||||
mNative.setPointerSpeed(constrainPointerSpeedValue(speed));
|
||||
}
|
||||
|
||||
private void updateTouchpadPointerSpeed() {
|
||||
mNative.setTouchpadPointerSpeed(
|
||||
getPointerSpeedValue(Settings.System.TOUCHPAD_POINTER_SPEED));
|
||||
constrainPointerSpeedValue(InputSettings.getTouchpadPointerSpeed(mContext)));
|
||||
}
|
||||
|
||||
private void updateTouchpadNaturalScrollingEnabled() {
|
||||
mNative.setTouchpadNaturalScrollingEnabled(
|
||||
getBoolean(Settings.System.TOUCHPAD_NATURAL_SCROLLING, true));
|
||||
InputSettings.useTouchpadNaturalScrolling(mContext));
|
||||
}
|
||||
|
||||
private void updateTouchpadTapToClickEnabled() {
|
||||
mNative.setTouchpadTapToClickEnabled(
|
||||
getBoolean(Settings.System.TOUCHPAD_TAP_TO_CLICK, true));
|
||||
mNative.setTouchpadTapToClickEnabled(InputSettings.useTouchpadTapToClick(mContext));
|
||||
}
|
||||
|
||||
private void updateTouchpadRightClickZoneEnabled() {
|
||||
mNative.setTouchpadRightClickZoneEnabled(
|
||||
getBoolean(Settings.System.TOUCHPAD_RIGHT_CLICK_ZONE, false));
|
||||
mNative.setTouchpadRightClickZoneEnabled(InputSettings.useTouchpadRightClickZone(mContext));
|
||||
}
|
||||
|
||||
private void updateShowTouches() {
|
||||
|
||||
Reference in New Issue
Block a user