Loading services/core/java/com/android/server/input/InputManagerInternal.java +9 −0 Original line number Diff line number Diff line Loading @@ -218,4 +218,13 @@ public abstract class InputManagerInternal { * display, external peripherals, fingerprint sensor, etc. */ public abstract void notifyUserActivity(); /** * Get the device ID of the {@link InputDevice} that used most recently. * * @return the last used input device ID, or * {@link android.os.IInputConstants#INVALID_INPUT_DEVICE_ID} if no device has been used * since boot. */ public abstract int getLastUsedInputDeviceId(); } services/core/java/com/android/server/input/InputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3204,6 +3204,11 @@ public class InputManagerService extends IInputManager.Stub public void setStylusButtonMotionEventsEnabled(boolean enabled) { mNative.setStylusButtonMotionEventsEnabled(enabled); } @Override public int getLastUsedInputDeviceId() { return mNative.getLastUsedInputDeviceId(); } } @Override Loading services/core/java/com/android/server/input/NativeInputManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,15 @@ interface NativeInputManagerService { void setInputMethodConnectionIsActive(boolean isActive); /** * Get the device ID of the InputDevice that used most recently. * * @return the last used input device ID, or * {@link android.os.IInputConstants#INVALID_INPUT_DEVICE_ID} if no device has been used * since boot. */ int getLastUsedInputDeviceId(); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -544,5 +553,8 @@ interface NativeInputManagerService { @Override public native void setInputMethodConnectionIsActive(boolean isActive); @Override public native int getLastUsedInputDeviceId(); } } services/core/jni/com_android_server_input_InputManagerService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2727,6 +2727,11 @@ static void nativeSetInputMethodConnectionIsActive(JNIEnv* env, jobject nativeIm im->setInputMethodConnectionIsActive(isActive); } static jint nativeGetLastUsedInputDeviceId(JNIEnv* env, jobject nativeImplObj) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return static_cast<jint>(im->getInputManager()->getReader().getLastUsedInputDeviceId()); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -2835,6 +2840,7 @@ static const JNINativeMethod gInputManagerMethods[] = { {"setAccessibilityStickyKeysEnabled", "(Z)V", (void*)nativeSetAccessibilityStickyKeysEnabled}, {"setInputMethodConnectionIsActive", "(Z)V", (void*)nativeSetInputMethodConnectionIsActive}, {"getLastUsedInputDeviceId", "()I", (void*)nativeGetLastUsedInputDeviceId}, }; #define FIND_CLASS(var, className) \ Loading Loading
services/core/java/com/android/server/input/InputManagerInternal.java +9 −0 Original line number Diff line number Diff line Loading @@ -218,4 +218,13 @@ public abstract class InputManagerInternal { * display, external peripherals, fingerprint sensor, etc. */ public abstract void notifyUserActivity(); /** * Get the device ID of the {@link InputDevice} that used most recently. * * @return the last used input device ID, or * {@link android.os.IInputConstants#INVALID_INPUT_DEVICE_ID} if no device has been used * since boot. */ public abstract int getLastUsedInputDeviceId(); }
services/core/java/com/android/server/input/InputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3204,6 +3204,11 @@ public class InputManagerService extends IInputManager.Stub public void setStylusButtonMotionEventsEnabled(boolean enabled) { mNative.setStylusButtonMotionEventsEnabled(enabled); } @Override public int getLastUsedInputDeviceId() { return mNative.getLastUsedInputDeviceId(); } } @Override Loading
services/core/java/com/android/server/input/NativeInputManagerService.java +12 −0 Original line number Diff line number Diff line Loading @@ -271,6 +271,15 @@ interface NativeInputManagerService { void setInputMethodConnectionIsActive(boolean isActive); /** * Get the device ID of the InputDevice that used most recently. * * @return the last used input device ID, or * {@link android.os.IInputConstants#INVALID_INPUT_DEVICE_ID} if no device has been used * since boot. */ int getLastUsedInputDeviceId(); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -544,5 +553,8 @@ interface NativeInputManagerService { @Override public native void setInputMethodConnectionIsActive(boolean isActive); @Override public native int getLastUsedInputDeviceId(); } }
services/core/jni/com_android_server_input_InputManagerService.cpp +6 −0 Original line number Diff line number Diff line Loading @@ -2727,6 +2727,11 @@ static void nativeSetInputMethodConnectionIsActive(JNIEnv* env, jobject nativeIm im->setInputMethodConnectionIsActive(isActive); } static jint nativeGetLastUsedInputDeviceId(JNIEnv* env, jobject nativeImplObj) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return static_cast<jint>(im->getInputManager()->getReader().getLastUsedInputDeviceId()); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -2835,6 +2840,7 @@ static const JNINativeMethod gInputManagerMethods[] = { {"setAccessibilityStickyKeysEnabled", "(Z)V", (void*)nativeSetAccessibilityStickyKeysEnabled}, {"setInputMethodConnectionIsActive", "(Z)V", (void*)nativeSetInputMethodConnectionIsActive}, {"getLastUsedInputDeviceId", "()I", (void*)nativeGetLastUsedInputDeviceId}, }; #define FIND_CLASS(var, className) \ Loading