Loading services/java/com/android/server/input/InputManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -1218,8 +1218,12 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog. } // Native callback. private void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) { mCallbacks.notifyLidSwitchChanged(whenNanos, lidOpen); private void notifySwitch(long whenNanos, int switchCode, int switchValue) { switch (switchCode) { case SW_LID: mCallbacks.notifyLidSwitchChanged(whenNanos, switchValue == 0); break; } } // Native callback. Loading services/jni/com_android_server_input_InputManagerService.cpp +6 −11 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ static const float POINTER_SPEED_EXPONENT = 1.0f / 4; static struct { jmethodID notifyConfigurationChanged; jmethodID notifyInputDevicesChanged; jmethodID notifyLidSwitchChanged; jmethodID notifySwitch; jmethodID notifyInputChannelBroken; jmethodID notifyANR; jmethodID filterInputEvent; Loading Loading @@ -578,14 +578,9 @@ void NativeInputManager::notifySwitch(nsecs_t when, int32_t switchCode, JNIEnv* env = jniEnv(); switch (switchCode) { case SW_LID: // When switch value is set indicates lid is closed. env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifyLidSwitchChanged, when, switchValue == 0 /*lidOpen*/); checkAndClearExceptionFromCallback(env, "notifyLidSwitchChanged"); break; } env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifySwitch, when, switchCode, switchValue); checkAndClearExceptionFromCallback(env, "notifySwitch"); } void NativeInputManager::notifyConfigurationChanged(nsecs_t when) { Loading Loading @@ -1410,8 +1405,8 @@ int register_android_server_InputManager(JNIEnv* env) { GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz, "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V"); GET_METHOD_ID(gServiceClassInfo.notifyLidSwitchChanged, clazz, "notifyLidSwitchChanged", "(JZ)V"); GET_METHOD_ID(gServiceClassInfo.notifySwitch, clazz, "notifySwitch", "(JII)V"); GET_METHOD_ID(gServiceClassInfo.notifyInputChannelBroken, clazz, "notifyInputChannelBroken", "(Lcom/android/server/input/InputWindowHandle;)V"); Loading Loading
services/java/com/android/server/input/InputManagerService.java +6 −2 Original line number Diff line number Diff line Loading @@ -1218,8 +1218,12 @@ public class InputManagerService extends IInputManager.Stub implements Watchdog. } // Native callback. private void notifyLidSwitchChanged(long whenNanos, boolean lidOpen) { mCallbacks.notifyLidSwitchChanged(whenNanos, lidOpen); private void notifySwitch(long whenNanos, int switchCode, int switchValue) { switch (switchCode) { case SW_LID: mCallbacks.notifyLidSwitchChanged(whenNanos, switchValue == 0); break; } } // Native callback. Loading
services/jni/com_android_server_input_InputManagerService.cpp +6 −11 Original line number Diff line number Diff line Loading @@ -63,7 +63,7 @@ static const float POINTER_SPEED_EXPONENT = 1.0f / 4; static struct { jmethodID notifyConfigurationChanged; jmethodID notifyInputDevicesChanged; jmethodID notifyLidSwitchChanged; jmethodID notifySwitch; jmethodID notifyInputChannelBroken; jmethodID notifyANR; jmethodID filterInputEvent; Loading Loading @@ -578,14 +578,9 @@ void NativeInputManager::notifySwitch(nsecs_t when, int32_t switchCode, JNIEnv* env = jniEnv(); switch (switchCode) { case SW_LID: // When switch value is set indicates lid is closed. env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifyLidSwitchChanged, when, switchValue == 0 /*lidOpen*/); checkAndClearExceptionFromCallback(env, "notifyLidSwitchChanged"); break; } env->CallVoidMethod(mServiceObj, gServiceClassInfo.notifySwitch, when, switchCode, switchValue); checkAndClearExceptionFromCallback(env, "notifySwitch"); } void NativeInputManager::notifyConfigurationChanged(nsecs_t when) { Loading Loading @@ -1410,8 +1405,8 @@ int register_android_server_InputManager(JNIEnv* env) { GET_METHOD_ID(gServiceClassInfo.notifyInputDevicesChanged, clazz, "notifyInputDevicesChanged", "([Landroid/view/InputDevice;)V"); GET_METHOD_ID(gServiceClassInfo.notifyLidSwitchChanged, clazz, "notifyLidSwitchChanged", "(JZ)V"); GET_METHOD_ID(gServiceClassInfo.notifySwitch, clazz, "notifySwitch", "(JII)V"); GET_METHOD_ID(gServiceClassInfo.notifyInputChannelBroken, clazz, "notifyInputChannelBroken", "(Lcom/android/server/input/InputWindowHandle;)V"); Loading