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

Commit 51e43193 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

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
parent c43ed523
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -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 = {
+5 −1
Original line number Diff line number Diff line
@@ -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) {
+11 −2
Original line number Diff line number Diff line
@@ -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);
    }

    /**