Class ShadowInputManager

java.lang.Object
org.robolectric.shadows.ShadowInputManager

@Implements(android.hardware.input.InputManager.class) public class ShadowInputManager extends Object
Shadow for InputManager
  • Constructor Details

    • ShadowInputManager

      public ShadowInputManager()
  • Method Details

    • deviceHasKeysImpl

      protected static boolean[] deviceHasKeysImpl(int deviceId, int[] keyCodes)
    • injectInputEvent

      @Implementation(maxSdk=33) protected boolean injectInputEvent(InputEvent event, int mode)
      On U and above, this method delegates to InputManagerGlobal.
    • deviceHasKeys

      @Implementation(maxSdk=33) protected boolean[] deviceHasKeys(int id, int[] keyCodes)
      On U and above, this method delegates to InputManagerGlobal.
    • populateInputDevicesLocked

      @Implementation(maxSdk=33) protected void populateInputDevicesLocked() throws ClassNotFoundException
      Throws:
      ClassNotFoundException
    • addInputDevice

      public void addInputDevice(InputDevice inputDevice)
    • addInputDeviceKeys

      public void addInputDeviceKeys(int deviceId, int[] keyCodes)
    • verifyInputEvent

      @Implementation(minSdk=30) protected Object verifyInputEvent(InputEvent inputEvent)
      Provides a local java implementation, since the real implementation is in system server + native code.
    • reset

      @Resetter public static void reset()