Allow RemoteViews to start Activities via PI

A remoteview shows an UI rendered by another app and allows starting
that app's Activity. Since that App probably does not possess BAL
permissions the App showing the RemoteView needs to grant its
permissions.

Bug: 269240329
Test: manual testing with feature enabled
Change-Id: Ic2ec605631654cead5cb6cf47c4d0125b0765b7a
(cherry picked from commit cbef1ced75)
This commit is contained in:
Achim Thesmann
2023-02-16 16:37:36 -08:00
parent ca9e2463e9
commit 860b4f6f65

View File

@@ -6717,6 +6717,10 @@ public class RemoteViews implements Parcelable, Filter {
Log.w(LOG_TAG, "getLaunchOptions: view.getDisplay() is null!",
new Exception());
}
// If the user interacts with a visible element it is safe to assume they consent that
// something is going to start.
opts.setPendingIntentBackgroundActivityStartMode(
ActivityOptions.MODE_BACKGROUND_ACTIVITY_START_ALLOWED);
return Pair.create(intent, opts);
}
}