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

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

Change-Id: I72fe3385f39bf5023ec603eae26bf14e02044e60
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
TreeHugger Robot
2022-04-07 00:39:52 +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);