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

Commit 2eb771c8 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of ['googleplex-android-review.googlesource.com/34411480'] into 25Q2-release.

Change-Id: Ie82ecad8735e9747f00be9c7d3d2c1cfd740fd8c
parents c8391347 a819a965
Loading
Loading
Loading
Loading
+17 −5
Original line number Diff line number Diff line
@@ -145,6 +145,14 @@ class BroadcastController {
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.UPSIDE_DOWN_CAKE)
    private static final long DYNAMIC_RECEIVER_EXPLICIT_EXPORT_REQUIRED = 161145287L;

    /**
     * It is now required for apps to be in the foreground to send remote intent broadcasts on Wear
     * devices.
     */
    @ChangeId
    @EnabledSince(targetSdkVersion = Build.VERSION_CODES.BAKLAVA)
    private static final long WEAR_REMOTE_INTENT_BLOCKED_IN_BACKGROUND = 419106561L;

    // Maximum number of receivers an app can register.
    private static final int MAX_RECEIVERS_ALLOWED_PER_APP = 1000;

@@ -1106,10 +1114,14 @@ class BroadcastController {
                intent.addFlags(Intent.FLAG_RECEIVER_INCLUDE_BACKGROUND);
            }

            // TODO: b/329211459 - Remove this after background remote intent is fixed.
            // TODO: b/329211459 - Remove this when the remote intent broadcast receiver is removed
            // from Wear.
            if (mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_WATCH)
                    && getWearRemoteIntentAction().equals(action)) {
                final int callerProcState = callerApp != null
                    && getWearRemoteIntentAction().equals(action)
                    && CompatChanges.isChangeEnabled(
                            WEAR_REMOTE_INTENT_BLOCKED_IN_BACKGROUND, callingUid)) {
                final int callerProcState =
                        callerApp != null
                                ? callerApp.getCurProcState()
                                : ActivityManager.PROCESS_STATE_NONEXISTENT;
                if (ActivityManager.RunningAppProcessInfo.procStateToImportance(callerProcState)