Merge "Check that InputDevice isn't null and add annotations" into tm-dev am: 94bba02785 am: c110d59a03

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17546183

Change-Id: Ibf09245f0969bef2b5bd3a02d012d50296fed5e5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-07 01:03:23 +00:00
committed by Automerger Merge Worker

View File

@@ -98,7 +98,7 @@ public class InputDeviceSensorManager implements InputManager.InputDeviceListene
*/
private void updateInputDeviceSensorInfoLocked(int deviceId) {
final InputDevice inputDevice = InputDevice.getDevice(deviceId);
if (inputDevice.hasSensor()) {
if (inputDevice != null && inputDevice.hasSensor()) {
final InputSensorInfo[] sensorInfos =
mInputManager.getSensorList(deviceId);
populateSensorsForInputDeviceLocked(deviceId, sensorInfos);