Loading services/core/java/com/android/server/input/InputSettingsObserver.java +28 −21 Original line number Diff line number Diff line Loading @@ -64,12 +64,14 @@ class InputSettingsObserver extends ContentObserver { (reason) -> updateTouchpadRightClickZoneEnabled()), Map.entry(Settings.System.getUriFor(Settings.System.SHOW_TOUCHES), (reason) -> updateShowTouches()), Map.entry(Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON), Map.entry( Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON), (reason) -> updateAccessibilityLargePointer()), Map.entry(Settings.Secure.getUriFor(Settings.Secure.LONG_PRESS_TIMEOUT), (reason) -> updateDeepPressStatus(reason)), (reason) -> updateLongPressTimeout(reason)), Map.entry( Settings.Global.getUriFor(Settings.Global.MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH), Settings.Global.getUriFor( Settings.Global.MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH), (reason) -> updateMaximumObscuringOpacityForTouch())); } Loading Loading @@ -151,8 +153,13 @@ class InputSettingsObserver extends ContentObserver { mNative.reloadPointerIcons(); } private void updateDeepPressStatus(String reason) { // Not using ViewConfiguration.getLongPressTimeout here because it may return a stale value private void updateLongPressTimeout(String reason) { // Some key gesture timeouts are based on the long press timeout, so update key gesture // timeouts when the value changes. See ViewConfiguration#getKeyRepeatTimeout(). mNative.notifyKeyGestureTimeoutsChanged(); // Update the deep press status. // Not using ViewConfiguration.getLongPressTimeout here because it may return a stale value. final int timeout = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LONG_PRESS_TIMEOUT, ViewConfiguration.DEFAULT_LONG_PRESS_TIMEOUT, UserHandle.USER_CURRENT); Loading services/core/java/com/android/server/input/NativeInputManagerService.java +13 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.InputChannel; import android.view.InputEvent; import android.view.PointerIcon; import android.view.VerifiedInputEvent; import android.view.ViewConfiguration; import java.util.List; Loading Loading @@ -198,8 +199,6 @@ interface NativeInputManagerService { void changeKeyboardLayoutAssociation(); void notifyPointerDisplayIdChanged(); void setDisplayEligibilityForPointerCapture(int displayId, boolean enabled); void setMotionClassifierEnabled(boolean enabled); Loading Loading @@ -243,6 +242,15 @@ interface NativeInputManagerService { */ void sysfsNodeChanged(String sysfsNodePath); /** * Notify there is a change in any of the key gesture timeouts, such as the key * repeat timeout or key repeat delay. * * @see ViewConfiguration#getKeyRepeatTimeout() * @see ViewConfiguration#getKeyRepeatDelay() */ void notifyKeyGestureTimeoutsChanged(); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -451,9 +459,6 @@ interface NativeInputManagerService { @Override public native void changeKeyboardLayoutAssociation(); @Override public native void notifyPointerDisplayIdChanged(); @Override public native void setDisplayEligibilityForPointerCapture(int displayId, boolean enabled); Loading Loading @@ -493,5 +498,8 @@ interface NativeInputManagerService { @Override public native void sysfsNodeChanged(String sysfsNodePath); @Override public native void notifyKeyGestureTimeoutsChanged(); } } services/core/jni/com_android_server_input_InputManagerService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2567,6 +2567,11 @@ static void nativeSetStylusPointerIconEnabled(JNIEnv* env, jobject nativeImplObj im->setStylusPointerIconEnabled(enabled); } static void nativeNotifyKeyGestureTimeoutsChanged(JNIEnv* env, jobject nativeImplObj) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); im->getInputManager()->getDispatcher().requestRefreshConfiguration(); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -2663,6 +2668,7 @@ static const JNINativeMethod gInputManagerMethods[] = { (void*)nativeSetStylusButtonMotionEventsEnabled}, {"getMouseCursorPosition", "()[F", (void*)nativeGetMouseCursorPosition}, {"setStylusPointerIconEnabled", "(Z)V", (void*)nativeSetStylusPointerIconEnabled}, {"notifyKeyGestureTimeoutsChanged", "()V", (void*)nativeNotifyKeyGestureTimeoutsChanged}, }; #define FIND_CLASS(var, className) \ Loading Loading
services/core/java/com/android/server/input/InputSettingsObserver.java +28 −21 Original line number Diff line number Diff line Loading @@ -64,12 +64,14 @@ class InputSettingsObserver extends ContentObserver { (reason) -> updateTouchpadRightClickZoneEnabled()), Map.entry(Settings.System.getUriFor(Settings.System.SHOW_TOUCHES), (reason) -> updateShowTouches()), Map.entry(Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON), Map.entry( Settings.Secure.getUriFor(Settings.Secure.ACCESSIBILITY_LARGE_POINTER_ICON), (reason) -> updateAccessibilityLargePointer()), Map.entry(Settings.Secure.getUriFor(Settings.Secure.LONG_PRESS_TIMEOUT), (reason) -> updateDeepPressStatus(reason)), (reason) -> updateLongPressTimeout(reason)), Map.entry( Settings.Global.getUriFor(Settings.Global.MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH), Settings.Global.getUriFor( Settings.Global.MAXIMUM_OBSCURING_OPACITY_FOR_TOUCH), (reason) -> updateMaximumObscuringOpacityForTouch())); } Loading Loading @@ -151,8 +153,13 @@ class InputSettingsObserver extends ContentObserver { mNative.reloadPointerIcons(); } private void updateDeepPressStatus(String reason) { // Not using ViewConfiguration.getLongPressTimeout here because it may return a stale value private void updateLongPressTimeout(String reason) { // Some key gesture timeouts are based on the long press timeout, so update key gesture // timeouts when the value changes. See ViewConfiguration#getKeyRepeatTimeout(). mNative.notifyKeyGestureTimeoutsChanged(); // Update the deep press status. // Not using ViewConfiguration.getLongPressTimeout here because it may return a stale value. final int timeout = Settings.Secure.getIntForUser(mContext.getContentResolver(), Settings.Secure.LONG_PRESS_TIMEOUT, ViewConfiguration.DEFAULT_LONG_PRESS_TIMEOUT, UserHandle.USER_CURRENT); Loading
services/core/java/com/android/server/input/NativeInputManagerService.java +13 −5 Original line number Diff line number Diff line Loading @@ -28,6 +28,7 @@ import android.view.InputChannel; import android.view.InputEvent; import android.view.PointerIcon; import android.view.VerifiedInputEvent; import android.view.ViewConfiguration; import java.util.List; Loading Loading @@ -198,8 +199,6 @@ interface NativeInputManagerService { void changeKeyboardLayoutAssociation(); void notifyPointerDisplayIdChanged(); void setDisplayEligibilityForPointerCapture(int displayId, boolean enabled); void setMotionClassifierEnabled(boolean enabled); Loading Loading @@ -243,6 +242,15 @@ interface NativeInputManagerService { */ void sysfsNodeChanged(String sysfsNodePath); /** * Notify there is a change in any of the key gesture timeouts, such as the key * repeat timeout or key repeat delay. * * @see ViewConfiguration#getKeyRepeatTimeout() * @see ViewConfiguration#getKeyRepeatDelay() */ void notifyKeyGestureTimeoutsChanged(); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -451,9 +459,6 @@ interface NativeInputManagerService { @Override public native void changeKeyboardLayoutAssociation(); @Override public native void notifyPointerDisplayIdChanged(); @Override public native void setDisplayEligibilityForPointerCapture(int displayId, boolean enabled); Loading Loading @@ -493,5 +498,8 @@ interface NativeInputManagerService { @Override public native void sysfsNodeChanged(String sysfsNodePath); @Override public native void notifyKeyGestureTimeoutsChanged(); } }
services/core/jni/com_android_server_input_InputManagerService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2567,6 +2567,11 @@ static void nativeSetStylusPointerIconEnabled(JNIEnv* env, jobject nativeImplObj im->setStylusPointerIconEnabled(enabled); } static void nativeNotifyKeyGestureTimeoutsChanged(JNIEnv* env, jobject nativeImplObj) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); im->getInputManager()->getDispatcher().requestRefreshConfiguration(); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -2663,6 +2668,7 @@ static const JNINativeMethod gInputManagerMethods[] = { (void*)nativeSetStylusButtonMotionEventsEnabled}, {"getMouseCursorPosition", "()[F", (void*)nativeGetMouseCursorPosition}, {"setStylusPointerIconEnabled", "(Z)V", (void*)nativeSetStylusPointerIconEnabled}, {"notifyKeyGestureTimeoutsChanged", "()V", (void*)nativeNotifyKeyGestureTimeoutsChanged}, }; #define FIND_CLASS(var, className) \ Loading