Loading core/java/android/hardware/input/IInputManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ interface IInputManager { int[] getInputDeviceIds(); // Enable/disable input device. boolean isInputDeviceEnabled(int deviceId); void enableInputDevice(int deviceId); void disableInputDevice(int deviceId); Loading core/java/android/hardware/input/InputManager.java +0 −13 Original line number Diff line number Diff line Loading @@ -332,19 +332,6 @@ public final class InputManager { return mGlobal.getInputDeviceIds(); } /** * Returns true if an input device is enabled. Should return true for most * situations. Some system apps may disable an input device, for * example to prevent unwanted touch events. * * @param id The input device Id. * * @hide */ public boolean isInputDeviceEnabled(int id) { return mGlobal.isInputDeviceEnabled(id); } /** * Enables an InputDevice. * <p> Loading core/java/android/hardware/input/InputManagerGlobal.java +0 −12 Original line number Diff line number Diff line Loading @@ -410,18 +410,6 @@ public final class InputManagerGlobal { } } /** * @see InputManager#isInputDeviceEnabled(int) */ public boolean isInputDeviceEnabled(int id) { try { return mIm.isInputDeviceEnabled(id); } catch (RemoteException ex) { Log.w(TAG, "Could not check enabled status of input device with id = " + id); throw ex.rethrowFromSystemServer(); } } /** * @see InputManager#enableInputDevice(int) */ Loading core/java/android/view/InputDevice.java +17 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public final class InputDevice implements Parcelable { private final boolean mHasBattery; private final HostUsiVersion mHostUsiVersion; private final int mAssociatedDisplayId; private final boolean mEnabled; private final ArrayList<MotionRange> mMotionRanges = new ArrayList<MotionRange>(); private final ViewBehavior mViewBehavior = new ViewBehavior(this); Loading Loading @@ -502,7 +503,7 @@ public final class InputDevice implements Parcelable { int keyboardType, KeyCharacterMap keyCharacterMap, @Nullable String keyboardLanguageTag, @Nullable String keyboardLayoutType, boolean hasVibrator, boolean hasMicrophone, boolean hasButtonUnderPad, boolean hasSensor, boolean hasBattery, int usiVersionMajor, int usiVersionMinor, int associatedDisplayId) { int usiVersionMinor, int associatedDisplayId, boolean enabled) { mId = id; mGeneration = generation; mControllerNumber = controllerNumber; Loading Loading @@ -533,6 +534,7 @@ public final class InputDevice implements Parcelable { mIdentifier = new InputDeviceIdentifier(descriptor, vendorId, productId); mHostUsiVersion = new HostUsiVersion(usiVersionMajor, usiVersionMinor); mAssociatedDisplayId = associatedDisplayId; mEnabled = enabled; } private InputDevice(Parcel in) { Loading @@ -557,6 +559,7 @@ public final class InputDevice implements Parcelable { mHasBattery = in.readInt() != 0; mHostUsiVersion = HostUsiVersion.CREATOR.createFromParcel(in); mAssociatedDisplayId = in.readInt(); mEnabled = in.readInt() != 0; mIdentifier = new InputDeviceIdentifier(mDescriptor, mVendorId, mProductId); int numRanges = in.readInt(); Loading Loading @@ -601,6 +604,8 @@ public final class InputDevice implements Parcelable { private int mUsiVersionMajor = -1; private int mUsiVersionMinor = -1; private int mAssociatedDisplayId = Display.INVALID_DISPLAY; // The default is true, the same as the native default state. private boolean mEnabled = true; private List<MotionRange> mMotionRanges = new ArrayList<>(); private boolean mShouldSmoothScroll; Loading Loading @@ -731,6 +736,12 @@ public final class InputDevice implements Parcelable { return this; } /** @see InputDevice#isEnabled() */ public Builder setEnabled(boolean enabled) { mEnabled = enabled; return this; } /** @see InputDevice#getMotionRanges() */ public Builder addMotionRange(int axis, int source, float min, float max, float flat, float fuzz, float resolution) { Loading Loading @@ -772,7 +783,8 @@ public final class InputDevice implements Parcelable { mHasBattery, mUsiVersionMajor, mUsiVersionMinor, mAssociatedDisplayId); mAssociatedDisplayId, mEnabled); final int numRanges = mMotionRanges.size(); for (int i = 0; i < numRanges; i++) { Loading Loading @@ -1321,7 +1333,7 @@ public final class InputDevice implements Parcelable { * @return Whether the input device is enabled. */ public boolean isEnabled() { return InputManagerGlobal.getInstance().isInputDeviceEnabled(mId); return mEnabled; } /** Loading Loading @@ -1611,6 +1623,7 @@ public final class InputDevice implements Parcelable { out.writeInt(mHasBattery ? 1 : 0); mHostUsiVersion.writeToParcel(out, flags); out.writeInt(mAssociatedDisplayId); out.writeInt(mEnabled ? 1 : 0); int numRanges = mMotionRanges.size(); numRanges = numRanges > MAX_RANGES ? MAX_RANGES : numRanges; Loading Loading @@ -1642,6 +1655,7 @@ public final class InputDevice implements Parcelable { description.append(" Generation: ").append(mGeneration).append("\n"); description.append(" Location: ").append(mIsExternal ? "external" : "built-in").append( "\n"); description.append(" Enabled: ").append(isEnabled()).append("\n"); description.append(" Keyboard Type: "); switch (mKeyboardType) { Loading core/jni/android_view_InputDevice.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -90,7 +90,8 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi deviceInfo.hasButtonUnderPad(), deviceInfo.hasSensor(), deviceInfo.hasBattery(), usiVersion.majorVersion, usiVersion.minorVersion, deviceInfo.getAssociatedDisplayId())); deviceInfo.getAssociatedDisplayId(), deviceInfo.isEnabled())); // Note: We do not populate the Bluetooth address into the InputDevice object to avoid leaking // it to apps that do not have the Bluetooth permission. Loading Loading @@ -126,7 +127,7 @@ int register_android_view_InputDevice(JNIEnv* env) gInputDeviceClassInfo.ctor = GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "<init>", "(IIILjava/lang/String;IIILjava/lang/" "String;ZIILandroid/view/KeyCharacterMap;Ljava/" "lang/String;Ljava/lang/String;ZZZZZIII)V"); "lang/String;Ljava/lang/String;ZZZZZIIIZ)V"); gInputDeviceClassInfo.addMotionRange = GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "addMotionRange", "(IIFFFFF)V"); Loading Loading
core/java/android/hardware/input/IInputManager.aidl +0 −1 Original line number Diff line number Diff line Loading @@ -55,7 +55,6 @@ interface IInputManager { int[] getInputDeviceIds(); // Enable/disable input device. boolean isInputDeviceEnabled(int deviceId); void enableInputDevice(int deviceId); void disableInputDevice(int deviceId); Loading
core/java/android/hardware/input/InputManager.java +0 −13 Original line number Diff line number Diff line Loading @@ -332,19 +332,6 @@ public final class InputManager { return mGlobal.getInputDeviceIds(); } /** * Returns true if an input device is enabled. Should return true for most * situations. Some system apps may disable an input device, for * example to prevent unwanted touch events. * * @param id The input device Id. * * @hide */ public boolean isInputDeviceEnabled(int id) { return mGlobal.isInputDeviceEnabled(id); } /** * Enables an InputDevice. * <p> Loading
core/java/android/hardware/input/InputManagerGlobal.java +0 −12 Original line number Diff line number Diff line Loading @@ -410,18 +410,6 @@ public final class InputManagerGlobal { } } /** * @see InputManager#isInputDeviceEnabled(int) */ public boolean isInputDeviceEnabled(int id) { try { return mIm.isInputDeviceEnabled(id); } catch (RemoteException ex) { Log.w(TAG, "Could not check enabled status of input device with id = " + id); throw ex.rethrowFromSystemServer(); } } /** * @see InputManager#enableInputDevice(int) */ Loading
core/java/android/view/InputDevice.java +17 −3 Original line number Diff line number Diff line Loading @@ -93,6 +93,7 @@ public final class InputDevice implements Parcelable { private final boolean mHasBattery; private final HostUsiVersion mHostUsiVersion; private final int mAssociatedDisplayId; private final boolean mEnabled; private final ArrayList<MotionRange> mMotionRanges = new ArrayList<MotionRange>(); private final ViewBehavior mViewBehavior = new ViewBehavior(this); Loading Loading @@ -502,7 +503,7 @@ public final class InputDevice implements Parcelable { int keyboardType, KeyCharacterMap keyCharacterMap, @Nullable String keyboardLanguageTag, @Nullable String keyboardLayoutType, boolean hasVibrator, boolean hasMicrophone, boolean hasButtonUnderPad, boolean hasSensor, boolean hasBattery, int usiVersionMajor, int usiVersionMinor, int associatedDisplayId) { int usiVersionMinor, int associatedDisplayId, boolean enabled) { mId = id; mGeneration = generation; mControllerNumber = controllerNumber; Loading Loading @@ -533,6 +534,7 @@ public final class InputDevice implements Parcelable { mIdentifier = new InputDeviceIdentifier(descriptor, vendorId, productId); mHostUsiVersion = new HostUsiVersion(usiVersionMajor, usiVersionMinor); mAssociatedDisplayId = associatedDisplayId; mEnabled = enabled; } private InputDevice(Parcel in) { Loading @@ -557,6 +559,7 @@ public final class InputDevice implements Parcelable { mHasBattery = in.readInt() != 0; mHostUsiVersion = HostUsiVersion.CREATOR.createFromParcel(in); mAssociatedDisplayId = in.readInt(); mEnabled = in.readInt() != 0; mIdentifier = new InputDeviceIdentifier(mDescriptor, mVendorId, mProductId); int numRanges = in.readInt(); Loading Loading @@ -601,6 +604,8 @@ public final class InputDevice implements Parcelable { private int mUsiVersionMajor = -1; private int mUsiVersionMinor = -1; private int mAssociatedDisplayId = Display.INVALID_DISPLAY; // The default is true, the same as the native default state. private boolean mEnabled = true; private List<MotionRange> mMotionRanges = new ArrayList<>(); private boolean mShouldSmoothScroll; Loading Loading @@ -731,6 +736,12 @@ public final class InputDevice implements Parcelable { return this; } /** @see InputDevice#isEnabled() */ public Builder setEnabled(boolean enabled) { mEnabled = enabled; return this; } /** @see InputDevice#getMotionRanges() */ public Builder addMotionRange(int axis, int source, float min, float max, float flat, float fuzz, float resolution) { Loading Loading @@ -772,7 +783,8 @@ public final class InputDevice implements Parcelable { mHasBattery, mUsiVersionMajor, mUsiVersionMinor, mAssociatedDisplayId); mAssociatedDisplayId, mEnabled); final int numRanges = mMotionRanges.size(); for (int i = 0; i < numRanges; i++) { Loading Loading @@ -1321,7 +1333,7 @@ public final class InputDevice implements Parcelable { * @return Whether the input device is enabled. */ public boolean isEnabled() { return InputManagerGlobal.getInstance().isInputDeviceEnabled(mId); return mEnabled; } /** Loading Loading @@ -1611,6 +1623,7 @@ public final class InputDevice implements Parcelable { out.writeInt(mHasBattery ? 1 : 0); mHostUsiVersion.writeToParcel(out, flags); out.writeInt(mAssociatedDisplayId); out.writeInt(mEnabled ? 1 : 0); int numRanges = mMotionRanges.size(); numRanges = numRanges > MAX_RANGES ? MAX_RANGES : numRanges; Loading Loading @@ -1642,6 +1655,7 @@ public final class InputDevice implements Parcelable { description.append(" Generation: ").append(mGeneration).append("\n"); description.append(" Location: ").append(mIsExternal ? "external" : "built-in").append( "\n"); description.append(" Enabled: ").append(isEnabled()).append("\n"); description.append(" Keyboard Type: "); switch (mKeyboardType) { Loading
core/jni/android_view_InputDevice.cpp +3 −2 Original line number Diff line number Diff line Loading @@ -90,7 +90,8 @@ jobject android_view_InputDevice_create(JNIEnv* env, const InputDeviceInfo& devi deviceInfo.hasButtonUnderPad(), deviceInfo.hasSensor(), deviceInfo.hasBattery(), usiVersion.majorVersion, usiVersion.minorVersion, deviceInfo.getAssociatedDisplayId())); deviceInfo.getAssociatedDisplayId(), deviceInfo.isEnabled())); // Note: We do not populate the Bluetooth address into the InputDevice object to avoid leaking // it to apps that do not have the Bluetooth permission. Loading Loading @@ -126,7 +127,7 @@ int register_android_view_InputDevice(JNIEnv* env) gInputDeviceClassInfo.ctor = GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "<init>", "(IIILjava/lang/String;IIILjava/lang/" "String;ZIILandroid/view/KeyCharacterMap;Ljava/" "lang/String;Ljava/lang/String;ZZZZZIII)V"); "lang/String;Ljava/lang/String;ZZZZZIIIZ)V"); gInputDeviceClassInfo.addMotionRange = GetMethodIDOrDie(env, gInputDeviceClassInfo.clazz, "addMotionRange", "(IIFFFFF)V"); Loading