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

Commit c56d3677 authored by Robyn Coultas's avatar Robyn Coultas Committed by Robyn Coultas
Browse files

Log to report changes in quarter-hour alarm intent

Bug: 8239532
Change-Id: I08261e8280719ba2229fcc67bab7fe8029d90e88
(cherry picked from commit 7651c373)
parent 6da4068d
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -360,6 +360,9 @@ public class Utils {
                || (alarmOnQuarterHour - System.currentTimeMillis()) > 901000) {
            Log.wtf("quarterly alarm calculation error");
        }
        Log.v("getAlarmOnQuarterHour returns "
                + new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(nextQuarter.getTime())
                + " to fire in " + (alarmOnQuarterHour - System.currentTimeMillis()));
        return alarmOnQuarterHour;
    }

@@ -371,6 +374,8 @@ public class Utils {
            ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).setRepeating(
                    AlarmManager.RTC, getAlarmOnQuarterHour(),
                    AlarmManager.INTERVAL_FIFTEEN_MINUTES, quarterlyIntent);
            Log.v("startAlarmOnQuarterHour " + context.toString()
                    + " " + quarterlyIntent.toString());
            return quarterlyIntent;
        } else {
            return null;
@@ -379,6 +384,8 @@ public class Utils {

    public static void cancelAlarmOnQuarterHour(Context context, PendingIntent quarterlyIntent) {
        if (quarterlyIntent != null && context != null) {
            Log.v("cancelAlarmOnQuarterHour " + context.toString()
                    + " " + quarterlyIntent.toString());
            ((AlarmManager) context.getSystemService(Context.ALARM_SERVICE)).cancel(
                    quarterlyIntent);
        }