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

Commit 13d398ab authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Log a bit to differentiate PendingIntent and callback alarms" into main

parents 49cd6477 8b4a771b
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -114,7 +114,8 @@ class MetricsHelper {
                a.repeatInterval != 0,
                reasonToStatsReason(a.exactAllowReason),
                AlarmManagerService.isRtc(a.type),
                ActivityManager.processStateAmToProto(callerProcState));
                ActivityManager.processStateAmToProto(callerProcState),
                a.listener != null);
    }

    static void pushAlarmBatchDelivered(
+13 −4
Original line number Diff line number Diff line
@@ -3482,11 +3482,20 @@ public final class AlarmManagerServiceTest {

    @Test
    public void alarmScheduledAtomPushed() {
        for (int i = 0; i < 10; i++) {
            final PendingIntent pi = getNewMockPendingIntent();
        for (int i = 0; i < 20; i++) {
            final PendingIntent pi;
            final IAlarmListener listener;
            if (i % 2 == 0) {
                pi = null;
                listener = getNewListener(() -> {});
                setTestAlarmWithListener(ELAPSED_REALTIME, mNowElapsedTest + i, listener);
            } else {
                pi = getNewMockPendingIntent();
                listener = null;
                setTestAlarm(ELAPSED_REALTIME, mNowElapsedTest + i, pi);
            }

            verify(() -> MetricsHelper.pushAlarmScheduled(argThat(a -> a.matches(pi, null)),
            verify(() -> MetricsHelper.pushAlarmScheduled(argThat(a -> a.matches(pi, listener)),
                    anyInt()));
        }
    }