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

Commit 2ed04c67 authored by Annie Chin's avatar Annie Chin
Browse files

Add AlarmInstance null check in AlarmActivity.onResume.

Bug:21705483
Change-Id: Ia585709a4eaef41f5645389059a0f6c452eb6297
parent 4c709e0c
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -250,6 +250,12 @@ public class AlarmActivity extends AppCompatActivity
        final long instanceId = AlarmInstance.getId(getIntent().getData());
        mAlarmInstance = AlarmInstance.getInstance(getContentResolver(), instanceId);

        if (mAlarmInstance == null) {
            LogUtils.i(LOGTAG, "No alarm instance for instanceId: %d", instanceId);
            finish();
            return;
        }

        // Verify that the alarm is still firing before showing the activity
        if (mAlarmInstance.mAlarmState != AlarmInstance.FIRED_STATE) {
            LogUtils.i(LOGTAG, "Skip displaying alarm for instance: %s", mAlarmInstance);