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

Skip to content
Commit f1f080fd authored by Ricky Wai's avatar Ricky Wai
Browse files

Add hidden API to allow PendingIntent sender to allow/block BAL

For example, AlarmManagerService uses it to block all PendingIntent BAL,
so no apps can use alarm manager api to start activity from background.

The current default behavior is allowing PendingIntent to use caller's
foreground visibility to determine if BAL can be launched. We may want to
change this behavior becomes disallow by default, but it may need androidx
changes as SliceView is using PendingIntent.send() to launch apps and it
should allow apps to start BAL activity using Slice API.

For legacy app (targetSDK < T), even the flag is allowed, it won't use
caller's BAL permission to bypass BAL checking, to match the original
behavior.

Next step will be removing @hide and formalize the api.

Bug: 192341120
Test: atest BackgroundActivityLaunchTest
Test: Test AlarmManager API, PendingIntent won't cause BAL.
Change-Id: I89588473f0f028078adb9230caacb18ed4d6c504
parent b103b8b3
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment