Add UID states and capabiliites to FGS atom

Bug: 270963079
Test: statsd_testdrive 60
  Then start an FGS and make sure the new fields are filled in.
Change-Id: I0388b53a85b0c9dbf6089a662fac47cb60685a60
This commit is contained in:
Makoto Onuki
2023-04-28 14:08:13 -07:00
parent c43ed52346
commit 51e431932a
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

@@ -8217,7 +8217,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);
}
/**