Add interface tempAllowWhileInUsePermissionInFgs() to

ActivityManagerInternal.

So Telecomm can potentially call tempAllowWhileInUsePermissionInFgs() to
allow a FGS started for incoming call to have a while-in-use permission.
Previously tempAllowWhileInUsePermissionInFgs() is an interface in
ActivityManagerLocal, because Telecomm is in packages/services/Telecomm directory, it has
difficulty to call ActivityManagerLocal interfaces. Add
tempAllowWhileInUsePermissionInFgs() to ActivityManagerInternal is the
easiest workaround.

Bug: 270966067
Test: build and run.

Change-Id: I1112ec2b9d4d4a273f47d7d9abae1bd91f2987c2
This commit is contained in:
Hui Yu
2023-02-27 17:09:56 +00:00
parent 00a9833dc8
commit 8797e1f00b

View File

@@ -994,6 +994,16 @@ public abstract class ActivityManagerInternal {
*/
public abstract void logFgsApiEnd(int apiType, int uid, int pid);
/**
* Temporarily allow foreground service started by an uid to have while-in-use permission
* for durationMs.
*
* @param uid The UID of the app that starts the foreground service.
* @param durationMs elapsedRealTime duration in milliseconds.
* @hide
*/
public abstract void tempAllowWhileInUsePermissionInFgs(int uid, long durationMs);
/**
* The list of the events about the {@link android.media.projection.IMediaProjection} itself.
*