Loading services/companion/java/com/android/server/companion/virtual/InputController.java +8 −4 Original line number Diff line number Diff line Loading @@ -691,11 +691,13 @@ class InputController { /** A helper class used to wait for an input device to be registered. */ private class WaitForDevice implements AutoCloseable { private final CountDownLatch mDeviceAddedLatch = new CountDownLatch(1); private final String mDeviceName; private final InputManager.InputDeviceListener mListener; private int mInputDeviceId = IInputConstants.INVALID_INPUT_DEVICE_ID; WaitForDevice(String deviceName, int vendorId, int productId, int associatedDisplayId) { mDeviceName = deviceName; mListener = new InputManager.InputDeviceListener() { @Override public void onInputDeviceAdded(int deviceId) { Loading Loading @@ -741,15 +743,17 @@ class InputController { try { if (!mDeviceAddedLatch.await(1, TimeUnit.MINUTES)) { throw new DeviceCreationException( "Timed out waiting for virtual device to be created."); "Timed out waiting for virtual input device " + mDeviceName + " to be created."); } } catch (InterruptedException e) { throw new DeviceCreationException( "Interrupted while waiting for virtual device to be created.", e); "Interrupted while waiting for virtual input device " + mDeviceName + " to be created.", e); } if (mInputDeviceId == IInputConstants.INVALID_INPUT_DEVICE_ID) { throw new IllegalStateException( "Virtual input device was created with an invalid " "Virtual input device " + mDeviceName + " was created with an invalid " + "id=" + mInputDeviceId); } return mInputDeviceId; Loading Loading
services/companion/java/com/android/server/companion/virtual/InputController.java +8 −4 Original line number Diff line number Diff line Loading @@ -691,11 +691,13 @@ class InputController { /** A helper class used to wait for an input device to be registered. */ private class WaitForDevice implements AutoCloseable { private final CountDownLatch mDeviceAddedLatch = new CountDownLatch(1); private final String mDeviceName; private final InputManager.InputDeviceListener mListener; private int mInputDeviceId = IInputConstants.INVALID_INPUT_DEVICE_ID; WaitForDevice(String deviceName, int vendorId, int productId, int associatedDisplayId) { mDeviceName = deviceName; mListener = new InputManager.InputDeviceListener() { @Override public void onInputDeviceAdded(int deviceId) { Loading Loading @@ -741,15 +743,17 @@ class InputController { try { if (!mDeviceAddedLatch.await(1, TimeUnit.MINUTES)) { throw new DeviceCreationException( "Timed out waiting for virtual device to be created."); "Timed out waiting for virtual input device " + mDeviceName + " to be created."); } } catch (InterruptedException e) { throw new DeviceCreationException( "Interrupted while waiting for virtual device to be created.", e); "Interrupted while waiting for virtual input device " + mDeviceName + " to be created.", e); } if (mInputDeviceId == IInputConstants.INVALID_INPUT_DEVICE_ID) { throw new IllegalStateException( "Virtual input device was created with an invalid " "Virtual input device " + mDeviceName + " was created with an invalid " + "id=" + mInputDeviceId); } return mInputDeviceId; Loading