Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6798f157 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

Avoid NPE under stress conditions

Fixes: 127657926
Test: make
Change-Id: I0b1137f96528e174eff959f2de08c054c56dc6c7
parent 0b4fa72b
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import java.util.Calendar;
 */
public class DozeUi implements DozeMachine.Part {

    private static final String TAG = "DozeUi";
    private static final long TIME_TICK_DEADLINE_MILLIS = 90 * 1000; // 1.5min
    private final Context mContext;
    private final DozeHost mHost;
@@ -93,6 +94,10 @@ public class DozeUi implements DozeMachine.Part {
                new DozeHost.PulseCallback() {
                    @Override
                    public void onPulseStarted() {
                        if (mMachine.getState() != DozeMachine.State.DOZE_REQUEST_PULSE) {
                            Log.w(TAG, "Pulse was cancelled before it could have been started");
                            return;
                        }
                        mMachine.requestState(DozeMachine.State.DOZE_PULSING);
                    }