Avoid crashing when sensors are under stress
Fixes: 127657926
Test: make
Change-Id: Ifb24032454fd76860758cc983e877f5db314d0d3
diff --git a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
index 7656564..847182d 100644
--- a/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
+++ b/packages/SystemUI/src/com/android/systemui/doze/DozeUi.java
@@ -93,7 +93,13 @@
new DozeHost.PulseCallback() {
@Override
public void onPulseStarted() {
- mMachine.requestState(DozeMachine.State.DOZE_PULSING);
+ try {
+ mMachine.requestState(DozeMachine.State.DOZE_PULSING);
+ } catch (IllegalStateException e) {
+ // It's possible that the pulse was asynchronously cancelled while
+ // we were waiting for it to start (under stress conditions.)
+ // In those cases we should just ignore it. b/127657926
+ }
}
@Override