diff options
| author | 2020-03-04 12:19:37 -0800 | |
|---|---|---|
| committer | 2020-03-04 23:15:26 +0000 | |
| commit | 06a7bf9e9e1ae1b6b5a162fa664ad5ed5670ad74 (patch) | |
| tree | 71a254730fdf0b593e9dfb8778e44d35406c9dfd | |
| parent | 8af68ccfb586f0bc661c605a71711b3c92c7e4fc (diff) | |
DO NOT MERGE Set the sensor threshold only if sensor exists
Bug: 150779130
Test: atest SystemUITests and manual test for automotive
Change-Id: I18e3584c66f1286713a6fdadc678a9048869913b
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java index b7c8f707b850..e6cbab26c655 100644 --- a/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java +++ b/packages/SystemUI/src/com/android/systemui/doze/DozeSensors.java @@ -305,7 +305,7 @@ public class DozeSensors { mContext.getResources()); } else { sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); - mSensorThreshold = sensor.getMaximumRange(); + mSensorThreshold = sensor == null ? 0 : sensor.getMaximumRange(); } mSensor = sensor; } |