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

Commit 0177c5f2 authored by Jeff Sharkey's avatar Jeff Sharkey Committed by Android (Google) Code Review
Browse files

Merge "Resolve requested deferral policy based on caller." into udc-dev

parents 19480373 5e68ab19
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -2625,7 +2625,7 @@ public class DeviceIdleController extends SystemService

                final Bundle mostRecentDeliveryOptions = BroadcastOptions.makeBasic()
                        .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
                        .setDeferUntilActive(true)
                        .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                        .toBundle();

                mIdleIntent = new Intent(PowerManager.ACTION_DEVICE_IDLE_MODE_CHANGED);
+1 −1
Original line number Diff line number Diff line
@@ -1948,7 +1948,7 @@ public class AlarmManagerService extends SystemService {
                            | Intent.FLAG_RECEIVER_VISIBLE_TO_INSTANT_APPS);
            mTimeTickOptions = BroadcastOptions.makeBasic()
                    .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
                    .setDeferUntilActive(true)
                    .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                    .toBundle();
            mTimeTickTrigger = new IAlarmListener.Stub() {
                @Override
+3 −3
Original line number Diff line number Diff line
@@ -194,19 +194,19 @@ public final class BatteryService extends SystemService {

    private Bundle mBatteryChangedOptions = BroadcastOptions.makeBasic()
            .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
            .setDeferUntilActive(true)
            .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
            .toBundle();
    /** Used for both connected/disconnected, so match using key */
    private Bundle mPowerOptions = BroadcastOptions.makeBasic()
            .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
            .setDeliveryGroupMatchingKey("android", Intent.ACTION_POWER_CONNECTED)
            .setDeferUntilActive(true)
            .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
            .toBundle();
    /** Used for both low/okay, so match using key */
    private Bundle mBatteryOptions = BroadcastOptions.makeBasic()
            .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MOST_RECENT)
            .setDeliveryGroupMatchingKey("android", Intent.ACTION_BATTERY_OKAY)
            .setDeferUntilActive(true)
            .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
            .toBundle();

    private MetricsLogger mMetricsLogger;
+1 −1
Original line number Diff line number Diff line
@@ -320,7 +320,7 @@ public final class DropBoxManagerService extends SystemService {
                    .setDeliveryGroupPolicy(BroadcastOptions.DELIVERY_GROUP_POLICY_MERGED)
                    .setDeliveryGroupMatchingFilter(matchingFilter)
                    .setDeliveryGroupExtrasMerger(extrasMerger)
                    .setDeferUntilActive(true)
                    .setDeferralPolicy(BroadcastOptions.DEFERRAL_POLICY_UNTIL_ACTIVE)
                    .toBundle();
        }

+0 −12
Original line number Diff line number Diff line
@@ -14507,18 +14507,6 @@ public class ActivityManagerService extends IActivityManager.Stub
            }
        }
        // resultTo broadcasts are always infinitely deferrable.
        if ((resultTo != null) && !ordered && mEnableModernQueue) {
            if (brOptions == null) {
                brOptions = BroadcastOptions.makeBasic();
            }
            brOptions.setDeferUntilActive(true);
        }
        if (mEnableModernQueue && ordered && brOptions != null && brOptions.isDeferUntilActive()) {
            throw new IllegalArgumentException("Ordered broadcasts can't be deferred until active");
        }
        // Verify that protected broadcasts are only being sent by system code,
        // and that system code is only sending protected broadcasts.
        final boolean isProtectedBroadcast;
Loading