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

Commit 17f7c255 authored by Achim Thesmann's avatar Achim Thesmann
Browse files

Opt in systemui for BAL

We see some calls from android.uid.systemui being blocked in our logs. Unfortunately we cannot exactly identify the source of these calls, but in a manual review we identified some invocations that may be affected. To avoid activities being blocked and functionality regression, this change will revert those code paths back to T behavior by opting into allowing the launch if the PI sender (systemUI) is in the foreground. Maybe not all these changes are required, but any missed change might cause functionality to break, while extra changes have no functional impact.

The change is relatively safe since it won't block anything, only allow the launch, as it was allowed by default in T.

Change-Id: Ide20c906e9852ac49abbc8af8570313a8f5f965e
Test: compile + presubmit
Bug: 284486752
parent e5cd5624
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -1253,6 +1253,9 @@ class MediaDataManager(
        return try {
        return try {
            val options = BroadcastOptions.makeBasic()
            val options = BroadcastOptions.makeBasic()
            options.setInteractive(true)
            options.setInteractive(true)
            options.setPendingIntentBackgroundActivityStartMode(
                BroadcastOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED
            )
            intent.send(options.toBundle())
            intent.send(options.toBundle())
            true
            true
        } catch (e: PendingIntent.CanceledException) {
        } catch (e: PendingIntent.CanceledException) {
+7 −1
Original line number Original line Diff line number Diff line
@@ -23,6 +23,7 @@ import static com.android.systemui.media.controls.models.recommendation.Smartspa
import android.animation.Animator;
import android.animation.Animator;
import android.animation.AnimatorInflater;
import android.animation.AnimatorInflater;
import android.animation.AnimatorSet;
import android.animation.AnimatorSet;
import android.app.ActivityOptions;
import android.app.BroadcastOptions;
import android.app.BroadcastOptions;
import android.app.PendingIntent;
import android.app.PendingIntent;
import android.app.WallpaperColors;
import android.app.WallpaperColors;
@@ -535,7 +536,10 @@ public class MediaControlPanel {
                        mLockscreenUserManager.getCurrentUserId());
                        mLockscreenUserManager.getCurrentUserId());
                if (showOverLockscreen) {
                if (showOverLockscreen) {
                    try {
                    try {
                        clickIntent.send();
                        ActivityOptions opts = ActivityOptions.makeBasic();
                        opts.setPendingIntentBackgroundActivityStartMode(
                                ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                        clickIntent.send(opts.toBundle());
                    } catch (PendingIntent.CanceledException e) {
                    } catch (PendingIntent.CanceledException e) {
                        Log.e(TAG, "Pending intent for " + key + " was cancelled");
                        Log.e(TAG, "Pending intent for " + key + " was cancelled");
                    }
                    }
@@ -684,6 +688,8 @@ public class MediaControlPanel {
                                try {
                                try {
                                    BroadcastOptions options = BroadcastOptions.makeBasic();
                                    BroadcastOptions options = BroadcastOptions.makeBasic();
                                    options.setInteractive(true);
                                    options.setInteractive(true);
                                    options.setPendingIntentBackgroundActivityStartMode(
                                            ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                                    deviceIntent.send(options.toBundle());
                                    deviceIntent.send(options.toBundle());
                                } catch (PendingIntent.CanceledException e) {
                                } catch (PendingIntent.CanceledException e) {
                                    Log.e(TAG, "Device pending intent was canceled");
                                    Log.e(TAG, "Device pending intent was canceled");
+2 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,8 @@ public class ActionProxyReceiver extends BroadcastReceiver {
            ActivityOptions opts = ActivityOptions.makeBasic();
            ActivityOptions opts = ActivityOptions.makeBasic();
            opts.setDisallowEnterPictureInPictureWhileLaunching(
            opts.setDisallowEnterPictureInPictureWhileLaunching(
                    intent.getBooleanExtra(EXTRA_DISALLOW_ENTER_PIP, false));
                    intent.getBooleanExtra(EXTRA_DISALLOW_ENTER_PIP, false));
            opts.setPendingIntentBackgroundActivityStartMode(
                    ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
            try {
            try {
                actionIntent.send(context, 0, null, null, null, null, opts.toBundle());
                actionIntent.send(context, 0, null, null, null, null, opts.toBundle());
                if (intent.getBooleanExtra(ScreenshotController.EXTRA_OVERRIDE_TRANSITION, false)) {
                if (intent.getBooleanExtra(ScreenshotController.EXTRA_OVERRIDE_TRANSITION, false)) {
+2 −0
Original line number Original line Diff line number Diff line
@@ -99,6 +99,8 @@ public class OverlayActionChip extends FrameLayout {
            try {
            try {
                BroadcastOptions options = BroadcastOptions.makeBasic();
                BroadcastOptions options = BroadcastOptions.makeBasic();
                options.setInteractive(true);
                options.setInteractive(true);
                options.setPendingIntentBackgroundActivityStartMode(
                        BroadcastOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
                intent.send(options.toBundle());
                intent.send(options.toBundle());
                finisher.run();
                finisher.run();
            } catch (PendingIntent.CanceledException e) {
            } catch (PendingIntent.CanceledException e) {
+2 −1
Original line number Original line Diff line number Diff line
@@ -55,7 +55,8 @@ public class SmartActionsReceiver extends BroadcastReceiver {
            Log.d(TAG, "Executing smart action [" + actionType + "]:" + pendingIntent.getIntent());
            Log.d(TAG, "Executing smart action [" + actionType + "]:" + pendingIntent.getIntent());
        }
        }
        ActivityOptions opts = ActivityOptions.makeBasic();
        ActivityOptions opts = ActivityOptions.makeBasic();

        opts.setPendingIntentBackgroundActivityStartMode(
                ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
        try {
        try {
            pendingIntent.send(context, 0, fillIn, null, null, null, opts.toBundle());
            pendingIntent.send(context, 0, fillIn, null, null, null, opts.toBundle());
        } catch (PendingIntent.CanceledException e) {
        } catch (PendingIntent.CanceledException e) {
Loading