Loading services/core/java/com/android/server/input/InputManagerInternal.java +14 −0 Original line number Diff line number Diff line Loading @@ -270,4 +270,18 @@ public abstract class InputManagerInternal { * @param scaleFactor the new scale factor to be applied for pointer icons. */ public abstract void setAccessibilityPointerIconScaleFactor(int displayId, float scaleFactor); /** * Set whether the given input device can wake up the kernel from sleep * when it generates input events. By default, usually only internal (built-in) * input devices can wake the kernel from sleep. For an external input device * that supports remote wakeup to be able to wake the kernel, this must be called * after each time the device is connected/added. * * @param deviceId the device ID of the input device. * @param enabled When true, device will be configured to wake up kernel. * * @return true if setting power wakeup was successful. */ public abstract boolean setKernelWakeEnabled(int deviceId, boolean enabled); } services/core/java/com/android/server/input/InputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3511,6 +3511,11 @@ public class InputManagerService extends IInputManager.Stub public void setAccessibilityPointerIconScaleFactor(int displayId, float scaleFactor) { InputManagerService.this.setAccessibilityPointerIconScaleFactor(displayId, scaleFactor); } @Override public boolean setKernelWakeEnabled(int deviceId, boolean enabled) { return mNative.setKernelWakeEnabled(deviceId, enabled); } } @Override Loading services/core/java/com/android/server/input/NativeInputManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,17 @@ interface NativeInputManagerService { */ int getLastUsedInputDeviceId(); /** * Set whether the given input device can wake up the kernel from sleep * when it generates input events. By default, usually only internal (built-in) * input devices can wake the kernel from sleep. For an external input device * that supports remote wakeup to be able to wake the kernel, this must be called * after each time the device is connected/added. * * Returns true if setting power wakeup was successful. */ boolean setKernelWakeEnabled(int deviceId, boolean enabled); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -573,5 +584,8 @@ interface NativeInputManagerService { @Override public native int getLastUsedInputDeviceId(); @Override public native boolean setKernelWakeEnabled(int deviceId, boolean enabled); } } services/core/jni/com_android_server_input_InputManagerService.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -3056,6 +3056,12 @@ static void nativeSetMouseSwapPrimaryButtonEnabled(JNIEnv* env, jobject nativeIm im->setMouseSwapPrimaryButtonEnabled(enabled); } static jboolean nativeSetKernelWakeEnabled(JNIEnv* env, jobject nativeImplObj, jint deviceId, jboolean enabled) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return im->getInputManager()->getReader().setKernelWakeEnabled(deviceId, enabled); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -3172,6 +3178,7 @@ static const JNINativeMethod gInputManagerMethods[] = { (void*)nativeSetAccessibilityStickyKeysEnabled}, {"setInputMethodConnectionIsActive", "(Z)V", (void*)nativeSetInputMethodConnectionIsActive}, {"getLastUsedInputDeviceId", "()I", (void*)nativeGetLastUsedInputDeviceId}, {"setKernelWakeEnabled", "(IZ)Z", (void*)nativeSetKernelWakeEnabled}, }; #define FIND_CLASS(var, className) \ Loading Loading
services/core/java/com/android/server/input/InputManagerInternal.java +14 −0 Original line number Diff line number Diff line Loading @@ -270,4 +270,18 @@ public abstract class InputManagerInternal { * @param scaleFactor the new scale factor to be applied for pointer icons. */ public abstract void setAccessibilityPointerIconScaleFactor(int displayId, float scaleFactor); /** * Set whether the given input device can wake up the kernel from sleep * when it generates input events. By default, usually only internal (built-in) * input devices can wake the kernel from sleep. For an external input device * that supports remote wakeup to be able to wake the kernel, this must be called * after each time the device is connected/added. * * @param deviceId the device ID of the input device. * @param enabled When true, device will be configured to wake up kernel. * * @return true if setting power wakeup was successful. */ public abstract boolean setKernelWakeEnabled(int deviceId, boolean enabled); }
services/core/java/com/android/server/input/InputManagerService.java +5 −0 Original line number Diff line number Diff line Loading @@ -3511,6 +3511,11 @@ public class InputManagerService extends IInputManager.Stub public void setAccessibilityPointerIconScaleFactor(int displayId, float scaleFactor) { InputManagerService.this.setAccessibilityPointerIconScaleFactor(displayId, scaleFactor); } @Override public boolean setKernelWakeEnabled(int deviceId, boolean enabled) { return mNative.setKernelWakeEnabled(deviceId, enabled); } } @Override Loading
services/core/java/com/android/server/input/NativeInputManagerService.java +14 −0 Original line number Diff line number Diff line Loading @@ -287,6 +287,17 @@ interface NativeInputManagerService { */ int getLastUsedInputDeviceId(); /** * Set whether the given input device can wake up the kernel from sleep * when it generates input events. By default, usually only internal (built-in) * input devices can wake the kernel from sleep. For an external input device * that supports remote wakeup to be able to wake the kernel, this must be called * after each time the device is connected/added. * * Returns true if setting power wakeup was successful. */ boolean setKernelWakeEnabled(int deviceId, boolean enabled); /** The native implementation of InputManagerService methods. */ class NativeImpl implements NativeInputManagerService { /** Pointer to native input manager service object, used by native code. */ Loading Loading @@ -573,5 +584,8 @@ interface NativeInputManagerService { @Override public native int getLastUsedInputDeviceId(); @Override public native boolean setKernelWakeEnabled(int deviceId, boolean enabled); } }
services/core/jni/com_android_server_input_InputManagerService.cpp +7 −0 Original line number Diff line number Diff line Loading @@ -3056,6 +3056,12 @@ static void nativeSetMouseSwapPrimaryButtonEnabled(JNIEnv* env, jobject nativeIm im->setMouseSwapPrimaryButtonEnabled(enabled); } static jboolean nativeSetKernelWakeEnabled(JNIEnv* env, jobject nativeImplObj, jint deviceId, jboolean enabled) { NativeInputManager* im = getNativeInputManager(env, nativeImplObj); return im->getInputManager()->getReader().setKernelWakeEnabled(deviceId, enabled); } // ---------------------------------------------------------------------------- static const JNINativeMethod gInputManagerMethods[] = { Loading Loading @@ -3172,6 +3178,7 @@ static const JNINativeMethod gInputManagerMethods[] = { (void*)nativeSetAccessibilityStickyKeysEnabled}, {"setInputMethodConnectionIsActive", "(Z)V", (void*)nativeSetInputMethodConnectionIsActive}, {"getLastUsedInputDeviceId", "()I", (void*)nativeGetLastUsedInputDeviceId}, {"setKernelWakeEnabled", "(IZ)Z", (void*)nativeSetKernelWakeEnabled}, }; #define FIND_CLASS(var, className) \ Loading