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

Commit a1de334a authored by Danesh M's avatar Danesh M Committed by Gerrit Code Review
Browse files

DeskClock : Don't set POWER_OFF_ALARM_MODE unecessarily

Setting this even if alarm is cancelled can get the user in a state
where the flag is never unset, and hence consume their home/search/menu keys...etc.

CYNGNOS-2119

Change-Id: I7b16de8530c937192d2c87b0ae52438185eca8d8
parent aa1c1fd7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -205,7 +205,6 @@ public class AlarmActivity extends AppCompatActivity
            // if we are invoked by a power off alarm, we may have just missed the alarm
            // time if the boot took unusually long (we normally wake up two minutes early)
            mAlarmInstance = AlarmInstance.getFirstMissedInstance(mContext.getContentResolver());
            Settings.System.putInt(mContext.getContentResolver(), POWER_OFF_ALARM_MODE, 1);
        } else if (intentData != null) {
            long instanceId = AlarmInstance.getId(intentData);
            mAlarmInstance = AlarmInstance.getInstance(this.getContentResolver(), instanceId);
@@ -230,6 +229,7 @@ public class AlarmActivity extends AppCompatActivity
                        SettingsActivity.DEFAULT_VOLUME_BEHAVIOR);

        if (mIsPowerOffAlarm) {
            Settings.System.putInt(mContext.getContentResolver(), POWER_OFF_ALARM_MODE, 1);
            getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_OVERLAY);
            getWindow().addFlags(WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED
                    | WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD