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

Commit 8afb7d57 authored by Paul Sliwowski's avatar Paul Sliwowski
Browse files

Add more logging to help debug scheduling issues.

Bug: b10746233
Change-Id: I551e4700b45a601723159ad50a9f1ca0d2d25eda
(cherry picked from commit 1207c579)
parent ae905091
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -137,8 +137,9 @@ public final class AlarmStateManager extends BroadcastReceiver {
     */
    private static void scheduleInstanceStateChange(Context context, Calendar time,
            AlarmInstance instance, int newState) {
        long timeInMillis = time.getTimeInMillis();
        Log.v("Scheduling state change " + newState + " to instance " + instance.mId +
                " at " + AlarmUtils.getFormattedTime(context, time));
                " at " + AlarmUtils.getFormattedTime(context, time) + " (" + timeInMillis + ")");
        Intent stateChangeIntent = createStateChangeIntent(context, ALARM_MANAGER_TAG, instance,
                newState);
        PendingIntent pendingIntent = PendingIntent.getBroadcast(context, instance.hashCode(),
@@ -146,9 +147,9 @@ public final class AlarmStateManager extends BroadcastReceiver {

        AlarmManager am = (AlarmManager) context.getSystemService(Context.ALARM_SERVICE);
        if (Utils.isKeyLimePieOrLater()) {
            am.setExact(AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), pendingIntent);
            am.setExact(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
        } else {
            am.set(AlarmManager.RTC_WAKEUP, time.getTimeInMillis(), pendingIntent);
            am.set(AlarmManager.RTC_WAKEUP, timeInMillis, pendingIntent);
        }
    }