Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4aa2f758 authored by Vaibhav Devmurari's avatar Vaibhav Devmurari Committed by Android (Google) Code Review
Browse files

Merge "Add TestApi to reset locked modifier state" into main

parents f52320a1 5f837195
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1805,6 +1805,7 @@ package android.hardware.input {
    method @RequiresPermission(android.Manifest.permission.REMAP_MODIFIER_KEYS) public void remapModifierKey(int, int);
    method @FlaggedApi("com.android.input.flags.device_associations") @RequiresPermission("android.permission.ASSOCIATE_INPUT_DEVICE_TO_DISPLAY") public void removeUniqueIdAssociationByDescriptor(@NonNull String);
    method @RequiresPermission("android.permission.ASSOCIATE_INPUT_DEVICE_TO_DISPLAY") public void removeUniqueIdAssociationByPort(@NonNull String);
    method public void resetLockedModifierState();
    field public static final long BLOCK_UNTRUSTED_TOUCHES = 158002302L; // 0x96aec7eL
  }

+2 −0
Original line number Diff line number Diff line
@@ -281,4 +281,6 @@ interface IInputManager {
    AidlInputGestureData[] getCustomInputGestures(int userId, int tag);

    AidlInputGestureData[] getAppLaunchBookmarks();

    void resetLockedModifierState();
}
+15 −0
Original line number Diff line number Diff line
@@ -1589,6 +1589,21 @@ public final class InputManager {
        }
    }

    /**
     * Resets locked modifier state (i.e.. Caps Lock, Num Lock, Scroll Lock state)
     *
     * @hide
     */
    @TestApi
    @SuppressLint("UnflaggedApi") // @TestApi without associated feature.
    public void resetLockedModifierState() {
        try {
            mIm.resetLockedModifierState();
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * A callback used to be notified about battery state changes for an input device. The
     * {@link #onBatteryStateChanged(int, long, BatteryState)} method will be called once after the
+5 −0
Original line number Diff line number Diff line
@@ -3031,6 +3031,11 @@ public class InputManagerService extends IInputManager.Stub
        return mKeyGestureController.getAppLaunchBookmarks();
    }

    @Override
    public void resetLockedModifierState() {
        mNative.resetLockedModifierState();
    }

    private void handleCurrentUserChanged(@UserIdInt int userId) {
        mCurrentUserId = userId;
        mKeyGestureController.setCurrentUserId(userId);
+5 −0
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ interface NativeInputManagerService {

    void toggleCapsLock(int deviceId);

    void resetLockedModifierState();

    void displayRemoved(int displayId);

    void setInputDispatchMode(boolean enabled, boolean frozen);
@@ -369,6 +371,9 @@ interface NativeInputManagerService {
        @Override
        public native void toggleCapsLock(int deviceId);

        @Override
        public native void resetLockedModifierState();

        @Override
        public native void displayRemoved(int displayId);

Loading