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

Commit e3029858 authored by Annie Chin's avatar Annie Chin
Browse files

Re-query for AlarmInstance state in AlarmActivity onResume.

Bug: 21101660
Change-Id: Ia0e221371d2b855be0d4ccc8bc814debcc0031d0
parent 4fc279c9
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -246,6 +246,10 @@ public class AlarmActivity extends AppCompatActivity
    protected void onResume() {
        super.onResume();

        // Re-query for AlarmInstance in case the state has changed externally
        final long instanceId = AlarmInstance.getId(getIntent().getData());
        mAlarmInstance = AlarmInstance.getInstance(getContentResolver(), instanceId);

        // 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);