@@ -63,7 +63,7 @@ static const float POINTER_SPEED_EXPONENT = 1.0f / 4;
6363static struct {
6464 jmethodID notifyConfigurationChanged;
6565 jmethodID notifyInputDevicesChanged;
66- jmethodID notifyLidSwitchChanged ;
66+ jmethodID notifySwitch ;
6767 jmethodID notifyInputChannelBroken;
6868 jmethodID notifyANR;
6969 jmethodID filterInputEvent;
@@ -578,14 +578,9 @@ void NativeInputManager::notifySwitch(nsecs_t when, int32_t switchCode,
578578
579579 JNIEnv* env = jniEnv ();
580580
581- switch (switchCode) {
582- case SW_LID:
583- // When switch value is set indicates lid is closed.
584- env->CallVoidMethod (mServiceObj , gServiceClassInfo .notifyLidSwitchChanged ,
585- when, switchValue == 0 /* lidOpen*/ );
586- checkAndClearExceptionFromCallback (env, " notifyLidSwitchChanged" );
587- break ;
588- }
581+ env->CallVoidMethod (mServiceObj , gServiceClassInfo .notifySwitch ,
582+ when, switchCode, switchValue);
583+ checkAndClearExceptionFromCallback (env, " notifySwitch" );
589584}
590585
591586void NativeInputManager::notifyConfigurationChanged (nsecs_t when) {
@@ -1410,8 +1405,8 @@ int register_android_server_InputManager(JNIEnv* env) {
14101405 GET_METHOD_ID (gServiceClassInfo .notifyInputDevicesChanged , clazz,
14111406 " notifyInputDevicesChanged" , " ([Landroid/view/InputDevice;)V" );
14121407
1413- GET_METHOD_ID (gServiceClassInfo .notifyLidSwitchChanged , clazz,
1414- " notifyLidSwitchChanged " , " (JZ )V" );
1408+ GET_METHOD_ID (gServiceClassInfo .notifySwitch , clazz,
1409+ " notifySwitch " , " (JII )V" );
14151410
14161411 GET_METHOD_ID (gServiceClassInfo .notifyInputChannelBroken , clazz,
14171412 " notifyInputChannelBroken" , " (Lcom/android/server/input/InputWindowHandle;)V" );
0 commit comments