Skip to content
Commit 36429f87 authored by Hui Yu's avatar Hui Yu
Browse files

Allow FGS started from MediaButtonReceiver to have while-in-use

permissions.

1. Create a generic FgsTempAllowList class, mFgsStartTempAllowList and
 mFgsWhileInUseTempAllowList are instantiated from FgsTempAllowList.
2. For mFgsWhileInUseTempAllowList, the uid on this list is allowed to
have while-in-use permission when the FGS is started from background for
a duration of time.
3. When media button is pressed, the targetUid is added to
mFgsWhileInUseTempAllowList, for the duration of 10 seconds, this way the
targetUid can start FGS from background and have while-in-use permission.
4. When checking for ProcessRecord.
mAllowBackgroundActivityStartsTokens, it is the caller app's
ProcessRecord should be checked instead of the service's ProcessRecord.

Bug: 182481312
Test: use b/167998084 reproduce steps, make a voip call, the
 receiver side screen is unlocked, the receiver side uses bluetooth
headset button to pick up the call, "dumpsys activity -a" shows the FGS
has "allowWhileInUsePermissionInFgs=true" and "isForeground=true".

Change-Id: Ic80aefe4202fe2210881bb8eea24b6e34cb1e7d0
parent ef9e6a7c
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