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

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

Revert changes from ag/675319 and ag/696248

Bug: 21492917
Bug: 21093797

Change-Id: I16558685b41579db4b6a8f4a3f8e51afcd3019f6
parent f11b8823
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -58,9 +58,6 @@ public class AlarmInitReceiver extends BroadcastReceiver {
                    TimerObj.resetTimersInSharedPrefs(prefs);
                    Utils.clearSwSharedPref(prefs);

                    // Dismiss snoozed alarms after boot
                    AlarmStateManager.dismissSnoozedAlarms(context);

                    if (!prefs.getBoolean(PREF_VOLUME_DEF_DONE, false)) {
                        // Fix the default
                        LogUtils.v("AlarmInitReceiver - resetting volume button default");
+0 −21
Original line number Diff line number Diff line
@@ -692,18 +692,6 @@ public final class AlarmStateManager extends BroadcastReceiver {
        updateNextAlarm(context);
    }

    /**
     * Dismiss all snoozed alarms
     */
    public static void dismissSnoozedAlarms(Context context) {
        ContentResolver contentResolver = context.getContentResolver();
        for (AlarmInstance instance : AlarmInstance.getInstances(contentResolver, null)) {
            if (instance.mAlarmState == AlarmInstance.SNOOZE_STATE) {
                AlarmStateManager.setDismissState(context, instance);
            }
        }
    }

    /**
     * Fix and update all alarm instance when a time change event occurs.
     *
@@ -714,15 +702,6 @@ public final class AlarmStateManager extends BroadcastReceiver {
        // TODO: Refactor this code to not use the overloaded registerInstance method.
        ContentResolver contentResolver = context.getContentResolver();
        for (AlarmInstance instance : AlarmInstance.getInstances(contentResolver, null)) {
            final Alarm alarm = Alarm.getAlarm(contentResolver, instance.mAlarmId);
            // If the alarm is snoozed, keep the current next alarm time; do not set the time to
            // the next scheduled alarm.
            // This means that if the time has adjusted past the originally intended fire time,
            // we will schedule for the old time. AlarmManager will then fire the alarm immediately.
            if (instance.mAlarmState != AlarmInstance.SNOOZE_STATE) {
                instance.setAlarmTime(alarm.getNextAlarmTime(Calendar.getInstance()));
                AlarmInstance.updateInstance(contentResolver, instance);
            }
            AlarmStateManager.registerInstance(context, instance, false);
        }
        AlarmStateManager.updateNextAlarm(context);