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

Commit 9e33fe39 authored by Robyn Coultas's avatar Robyn Coultas Committed by Isaac Katzenelson
Browse files

Renumbered Timer+Stopwatch notification id

Bugs: 7367575, 7367541

Change-Id: Ie64fa1ebfb38976a13385c50621bd71d81068dd9
parent a8c8c063
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -303,7 +303,7 @@ public class AlarmAlertFullScreen extends Activity implements GlowPadView.OnTrig
    @Override
    public void onDestroy() {
        super.onDestroy();
        if (LOG) Log.v("AlarmAlert.onDestroy()");
        if (LOG) Log.v("AlarmAlertFullScreen.onDestroy()");
        // No longer care about the alarm being killed.
        unregisterReceiver(mReceiver);
    }
+3 −3
Original line number Diff line number Diff line
@@ -98,6 +98,9 @@ public class AlarmKlaxon extends Service {
    @Override
    public void onDestroy() {
        stop();
        Intent alarmDone = new Intent(Alarms.ALARM_DONE_ACTION);
        sendBroadcast(alarmDone);

        // Stop listening for incoming calls.
        mTelephonyManager.listen(mPhoneStateListener, 0);
        AlarmAlertWakeLock.releaseCpuLock();
@@ -260,9 +263,6 @@ public class AlarmKlaxon extends Service {
        if (mPlaying) {
            mPlaying = false;

            Intent alarmDone = new Intent(Alarms.ALARM_DONE_ACTION);
            sendBroadcast(alarmDone);

            // Stop audio playing
            if (mMediaPlayer != null) {
                mMediaPlayer.stop();
+3 −1
Original line number Diff line number Diff line
@@ -74,6 +74,8 @@ public class AlarmReceiver extends BroadcastReceiver {
                Log.wtf("Unable to parse Alarm from intent.");
                Alarms.saveSnoozeAlert(context, Alarms.INVALID_ALARM_ID, -1);
            }
            // Inform any active UI that alarm snooze was cancelled
            context.sendBroadcast(new Intent(Alarms.ALARM_SNOOZE_CANCELLED));
            return;
        } else if (!Alarms.ALARM_ALERT_ACTION.equals(intent.getAction())) {
            // Unknown intent, bail.
@@ -114,7 +116,7 @@ public class AlarmReceiver extends BroadcastReceiver {
        // Intentionally verbose: always log the alarm time to provide useful
        // information in bug reports.
        long now = System.currentTimeMillis();
        Log.v("Recevied alarm set for " + Log.formatTime(alarm.time));
        Log.v("Received alarm set for " + Log.formatTime(alarm.time));

        // Always verbose to track down time change problems.
        if (now > alarm.time + STALE_WINDOW) {
+5 −1
Original line number Diff line number Diff line
@@ -61,6 +61,10 @@ public class Alarms {
    // can dismiss the alarm (after ALARM_ALERT_ACTION and before ALARM_DONE_ACTION).
    public static final String ALARM_DISMISS_ACTION = "com.android.deskclock.ALARM_DISMISS";

    // A public action sent by AlarmAlertFullScreen when a snoozed alarm was dismissed due
    // to it handling ALARM_DISMISS_ACTION cancelled
    public static final String ALARM_SNOOZE_CANCELLED = "com.android.deskclock.ALARM_SNOOZE_CANCELLED";

    // This is a private action used by the AlarmKlaxon to update the UI to
    // show the alarm has been killed.
    public static final String ALARM_KILLED = "alarm_killed";
@@ -448,7 +452,7 @@ public class Alarms {
    }

    /**
     * Disables alert in AlarmManger and StatusBar.
     * Disables alert in AlarmManager and StatusBar.
     *
     * @param context The context
     */
+5 −2
Original line number Diff line number Diff line
@@ -79,7 +79,7 @@ public class ClockFragment extends DeskClockFragment implements OnSharedPreferen
        public void onReceive(Context context, Intent intent) {
            boolean changed = intent.getAction().equals(Intent.ACTION_TIME_CHANGED)
                    || intent.getAction().equals(Intent.ACTION_TIMEZONE_CHANGED);
            if (intent.getAction().equals(ACTION_ON_QUARTER_HOUR) || changed) {
            if (changed || intent.getAction().equals(ACTION_ON_QUARTER_HOUR)) {
                updateDate();
                if (mAdapter != null) {
                    // *CHANGED may modify the need for showing the Home City
@@ -90,7 +90,8 @@ public class ClockFragment extends DeskClockFragment implements OnSharedPreferen
                    }
                }
            }
            if (changed) {
            if (changed || intent.getAction().equals(Alarms.ALARM_DONE_ACTION)
                    || intent.getAction().equals(Alarms.ALARM_SNOOZE_CANCELLED)) {
                refreshAlarm();
            }
        }
@@ -160,6 +161,8 @@ public class ClockFragment extends DeskClockFragment implements OnSharedPreferen
                AlarmManager.RTC, alarmOnQuarterHour, AlarmManager.INTERVAL_FIFTEEN_MINUTES, mQuarterlyIntent);
        // Besides monitoring when quarter-hour changes, monitor other actions that effect clock time
        IntentFilter filter = new IntentFilter(ACTION_ON_QUARTER_HOUR);
        filter.addAction(Alarms.ALARM_DONE_ACTION);
        filter.addAction(Alarms.ALARM_SNOOZE_CANCELLED);
        filter.addAction(Intent.ACTION_TIME_CHANGED);
        filter.addAction(Intent.ACTION_TIMEZONE_CHANGED);
        getActivity().registerReceiver(mIntentReceiver, filter);
Loading