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

Commit 1f890407 authored by Hui Yu's avatar Hui Yu Committed by Automerger Merge Worker
Browse files

Merge "Revert "Add isUidActiveOrForeground() for camera/audio to use."" into rvc-dev am: cc79094c

Change-Id: If3982837a446116391ec67360bd39c9daf42b530
parents c3e89810 cc79094c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -978,7 +978,7 @@ bool AudioPolicyService::UidPolicy::isUidActive(uid_t uid) {
        }
    }
    ActivityManager am;
    bool active = am.isUidActiveOrForeground(uid, String16("audioserver"));
    bool active = am.isUidActive(uid, String16("audioserver"));
    {
        Mutex::Autolock _l(mLock);
        mCachedUids.insert(std::pair<uid_t,
@@ -1023,7 +1023,7 @@ int AudioPolicyService::UidPolicy::getUidState(uid_t uid) {
        }
    }
    ActivityManager am;
    bool active = am.isUidActiveOrForeground(uid, String16("audioserver"));
    bool active = am.isUidActive(uid, String16("audioserver"));
    int state = ActivityManager::PROCESS_STATE_UNKNOWN;
    if (active) {
        state = am.getUidProcessState(uid, String16("audioserver"));
+1 −3
Original line number Diff line number Diff line
@@ -3192,9 +3192,7 @@ bool CameraService::UidPolicy::isUidActiveLocked(uid_t uid, String16 callingPack
            // some polling which should happen pretty rarely anyway as the race is hard
            // to hit.
            active = mActiveUids.find(uid) != mActiveUids.end();
            if (!active) {
                active = am.isUidActiveOrForeground(uid, callingPackage);
            }
            if (!active) active = am.isUidActive(uid, callingPackage);
            if (active) {
                break;
            }