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

Commit c320eeaa authored by Sudheer Shanka's avatar Sudheer Shanka Committed by Android (Google) Code Review
Browse files

Merge "Update delivery group policy for TIME_CHANGED and TIMEZONE_CHANGED." into main

parents fcb8191e 0e85b380
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -2163,6 +2163,8 @@ public class AlarmManagerService extends SystemService {
                    mActivityManagerInternal.getBootTimeTempAllowListDuration(),
                    TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED,
                    PowerExemptionManager.REASON_TIMEZONE_CHANGED, "");
            mOptsTimeBroadcast.setDeliveryGroupPolicy(
                    BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT);
            getContext().sendBroadcastAsUser(intent, UserHandle.ALL,
                    null /* receiverPermission */, mOptsTimeBroadcast.toBundle());
        }
@@ -4608,6 +4610,8 @@ public class AlarmManagerService extends SystemService {
                                mActivityManagerInternal.getBootTimeTempAllowListDuration(),
                                TEMPORARY_ALLOW_LIST_TYPE_FOREGROUND_SERVICE_ALLOWED,
                                PowerExemptionManager.REASON_TIME_CHANGED, "");
                        mOptsTimeBroadcast.setDeliveryGroupPolicy(
                                BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT);
                        getContext().sendBroadcastAsUser(intent, UserHandle.ALL,
                                null /* receiverPermission */, mOptsTimeBroadcast.toBundle());
                        // The world has changed on us, so we need to re-evaluate alarms
+2 −0
Original line number Diff line number Diff line
@@ -3397,6 +3397,8 @@ public final class AlarmManagerServiceTest {
                bOptions.getTemporaryAppAllowlistType());
        assertEquals(PowerExemptionManager.REASON_TIMEZONE_CHANGED,
                bOptions.getTemporaryAppAllowlistReasonCode());
        assertEquals(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT,
                bOptions.getDeliveryGroupPolicy());
    }

    @Test