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

Commit b62669f6 authored by Svet Ganov's avatar Svet Ganov Committed by android-build-merger
Browse files

Add API to query if a UID is active am: 0c1c9cd7

am: 1e8ea5f3

Change-Id: Ida7ab799376d14f8abcc7d918a7cd8bfaddaabe7
parents a5e76102 1e8ea5f3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -94,6 +94,7 @@ interface IActivityManager {
    void registerUidObserver(in IUidObserver observer, int which, int cutpoint,
            String callingPackage);
    void unregisterUidObserver(in IUidObserver observer);
    boolean isUidActive(int uid, String callingPackage);
    // =============== End of transactions used on native side as well ============================

    // Special low-level communication with activity manager.
+12 −0
Original line number Diff line number Diff line
@@ -13941,6 +13941,18 @@ public class ActivityManagerService extends IActivityManager.Stub
        }
    }
    @Override
    public boolean isUidActive(int uid, String callingPackage) {
        if (!hasUsageStatsPermission(callingPackage)) {
            enforceCallingPermission(android.Manifest.permission.PACKAGE_USAGE_STATS,
                    "getPackageProcessState");
        }
        synchronized (this) {
            final UidRecord uidRecord = mActiveUids.get(uid);
            return uidRecord != null && !uidRecord.setIdle;
        }
    }
    @Override
    public boolean convertFromTranslucent(IBinder token) {
        final long origId = Binder.clearCallingIdentity();