Loading services/core/java/com/android/server/input/InputManagerService.java +6 −3 Original line number Diff line number Diff line Loading @@ -2222,6 +2222,12 @@ public class InputManagerService extends IInputManager.Stub mNative.monitor(); } // Native callback. @SuppressWarnings("unused") private void notifyConfigurationChanged(long whenNanos) { mWindowManagerCallbacks.notifyConfigurationChanged(); } // Native callback. @SuppressWarnings("unused") private void notifyInputDevicesChanged(InputDevice[] inputDevices) { Loading @@ -2234,9 +2240,6 @@ public class InputManagerService extends IInputManager.Stub mInputDevices = inputDevices; } // Input device change can possibly change configuration, so notify window manager to update // its configuration. mWindowManagerCallbacks.notifyConfigurationChanged(); } // Native callback. Loading services/core/jni/com_android_server_input_InputManagerService.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ static const char* VELOCITYTRACKER_STRATEGY = "velocitytracker_strategy"; static struct { jclass clazz; jmethodID notifyConfigurationChanged; jmethodID notifyInputDevicesChanged; jmethodID notifySwitch; jmethodID notifyInputChannelBroken; Loading Loading @@ -313,6 +314,7 @@ public: void getReaderConfiguration(InputReaderConfiguration* outConfig) override; void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) override; void notifyConfigurationChanged(nsecs_t when) override; std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay( const InputDeviceIdentifier& identifier, const std::optional<KeyboardLayoutInfo> keyboardLayoutInfo) override; Loading Loading @@ -938,6 +940,18 @@ void NativeInputManager::notifySwitch(nsecs_t when, checkAndClearExceptionFromCallback(env, "notifySwitch"); } void NativeInputManager::notifyConfigurationChanged(nsecs_t when) { #if DEBUG_INPUT_DISPATCHER_POLICY ALOGD("notifyConfigurationChanged - when=%lld", when); #endif ATRACE_CALL(); JNIEnv* env = jniEnv(); env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifyConfigurationChanged, when); checkAndClearExceptionFromCallback(env, "notifyConfigurationChanged"); } static jobject getInputApplicationHandleObjLocalRef( JNIEnv* env, const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle) { if (inputApplicationHandle == nullptr) { Loading Loading @@ -2859,6 +2873,9 @@ int register_android_server_InputManager(JNIEnv* env) { FIND_CLASS(clazz, "com/android/server/input/InputManagerService"); gServiceClassInfo.clazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz)); GET_METHOD_ID(gServiceClassInfo.notifyConfigurationChanged, clazz, "notifyConfigurationChanged", "(J)V"); GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz, "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V"); Loading Loading
services/core/java/com/android/server/input/InputManagerService.java +6 −3 Original line number Diff line number Diff line Loading @@ -2222,6 +2222,12 @@ public class InputManagerService extends IInputManager.Stub mNative.monitor(); } // Native callback. @SuppressWarnings("unused") private void notifyConfigurationChanged(long whenNanos) { mWindowManagerCallbacks.notifyConfigurationChanged(); } // Native callback. @SuppressWarnings("unused") private void notifyInputDevicesChanged(InputDevice[] inputDevices) { Loading @@ -2234,9 +2240,6 @@ public class InputManagerService extends IInputManager.Stub mInputDevices = inputDevices; } // Input device change can possibly change configuration, so notify window manager to update // its configuration. mWindowManagerCallbacks.notifyConfigurationChanged(); } // Native callback. Loading
services/core/jni/com_android_server_input_InputManagerService.cpp +17 −0 Original line number Diff line number Diff line Loading @@ -104,6 +104,7 @@ static const char* VELOCITYTRACKER_STRATEGY = "velocitytracker_strategy"; static struct { jclass clazz; jmethodID notifyConfigurationChanged; jmethodID notifyInputDevicesChanged; jmethodID notifySwitch; jmethodID notifyInputChannelBroken; Loading Loading @@ -313,6 +314,7 @@ public: void getReaderConfiguration(InputReaderConfiguration* outConfig) override; void notifyInputDevicesChanged(const std::vector<InputDeviceInfo>& inputDevices) override; void notifyConfigurationChanged(nsecs_t when) override; std::shared_ptr<KeyCharacterMap> getKeyboardLayoutOverlay( const InputDeviceIdentifier& identifier, const std::optional<KeyboardLayoutInfo> keyboardLayoutInfo) override; Loading Loading @@ -938,6 +940,18 @@ void NativeInputManager::notifySwitch(nsecs_t when, checkAndClearExceptionFromCallback(env, "notifySwitch"); } void NativeInputManager::notifyConfigurationChanged(nsecs_t when) { #if DEBUG_INPUT_DISPATCHER_POLICY ALOGD("notifyConfigurationChanged - when=%lld", when); #endif ATRACE_CALL(); JNIEnv* env = jniEnv(); env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifyConfigurationChanged, when); checkAndClearExceptionFromCallback(env, "notifyConfigurationChanged"); } static jobject getInputApplicationHandleObjLocalRef( JNIEnv* env, const std::shared_ptr<InputApplicationHandle>& inputApplicationHandle) { if (inputApplicationHandle == nullptr) { Loading Loading @@ -2859,6 +2873,9 @@ int register_android_server_InputManager(JNIEnv* env) { FIND_CLASS(clazz, "com/android/server/input/InputManagerService"); gServiceClassInfo.clazz = reinterpret_cast<jclass>(env->NewGlobalRef(clazz)); GET_METHOD_ID(gServiceClassInfo.notifyConfigurationChanged, clazz, "notifyConfigurationChanged", "(J)V"); GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz, "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V"); Loading