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

Commit d5c42a30 authored by Ricky Wai's avatar Ricky Wai
Browse files

Let virtualdevice.launchPendingIntent() to start BAL using its BAL permission

As it's going to display activities on a display, we should allow it
to use its BAL permission to start those pending intent.

Bug: 232921553
Test: atest CreateVirtualDisplayTest
Change-Id: Ib7bcb8314f818f72432b44c88bffd5fccb79c649
parent f598205c
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -241,6 +241,9 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub

    private void sendPendingIntent(int displayId, PendingIntent pendingIntent)
            throws PendingIntent.CanceledException {
        final ActivityOptions options = ActivityOptions.makeBasic().setLaunchDisplayId(displayId);
        options.setPendingIntentBackgroundActivityLaunchAllowed(true);
        options.setPendingIntentBackgroundActivityLaunchAllowedByPermission(true);
        pendingIntent.send(
                mContext,
                /* code= */ 0,
@@ -248,9 +251,7 @@ final class VirtualDeviceImpl extends IVirtualDevice.Stub
                /* onFinished= */ null,
                /* handler= */ null,
                /* requiredPermission= */ null,
                ActivityOptions.makeBasic()
                        .setLaunchDisplayId(displayId)
                        .toBundle());
                options.toBundle());
    }

    @Override // Binder call