Merge "Add UID states and capabiliites to FGS atom" into udc-dev

This commit is contained in:
Makoto Onuki
2023-05-01 16:39:56 +00:00
committed by Android (Google) Code Review
3 changed files with 17 additions and 3 deletions

View File

@@ -771,6 +771,7 @@ public class ActivityManager {
/**
* The set of flags for process capability.
* Keep it in sync with ProcessCapability in atoms.proto.
* @hide
*/
@IntDef(flag = true, prefix = { "PROCESS_CAPABILITY_" }, value = {

View File

@@ -8240,7 +8240,11 @@ public final class ActiveServices {
: ForegroundServiceDelegationOptions.DELEGATION_SERVICE_DEFAULT,
0 /* api_sate */,
null /* api_type */,
null /* api_timestamp */);
null /* api_timestamp */,
mAm.getUidStateLocked(r.appInfo.uid),
mAm.getUidProcessCapabilityLocked(r.appInfo.uid),
mAm.getUidStateLocked(r.mRecentCallingUid),
mAm.getUidProcessCapabilityLocked(r.mRecentCallingUid));
int event = 0;
if (state == FOREGROUND_SERVICE_STATE_CHANGED__STATE__ENTER) {

View File

@@ -28,6 +28,7 @@ import static android.app.ActivityManager.FOREGROUND_SERVICE_API_TYPE_USB;
import static android.os.Process.INVALID_UID;
import android.annotation.IntDef;
import android.app.ActivityManager;
import android.app.ActivityManager.ForegroundServiceApiType;
import android.app.ForegroundServiceDelegationOptions;
import android.content.ComponentName;
@@ -466,7 +467,11 @@ public class ForegroundServiceTypeLoggerModule {
: ForegroundServiceDelegationOptions.DELEGATION_SERVICE_DEFAULT,
apiState,
apiType,
timestamp);
timestamp,
ActivityManager.PROCESS_STATE_UNKNOWN,
ActivityManager.PROCESS_CAPABILITY_NONE,
ActivityManager.PROCESS_STATE_UNKNOWN,
ActivityManager.PROCESS_CAPABILITY_NONE);
}
/**
@@ -500,7 +505,11 @@ public class ForegroundServiceTypeLoggerModule {
0,
apiState,
apiType,
timestamp);
timestamp,
ActivityManager.PROCESS_STATE_UNKNOWN,
ActivityManager.PROCESS_CAPABILITY_NONE,
ActivityManager.PROCESS_STATE_UNKNOWN,
ActivityManager.PROCESS_CAPABILITY_NONE);
}
/**