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

Commit 03befa0c authored by Austin Borger's avatar Austin Borger
Browse files

Remove redundant calls to onCameraAccessPrioritiesChanged.

The current implementation calls onCameraAccessPrioritiesChanged once
when there's a change in the oom adj per process, and again when there's
a change uid-wide. The second is unnecessary, as a change in uid
priority scores necessarily implies a change to process oom adj scores.

Change-Id: I6dcad316542ccdbdecd831b9dddba808583d1e44
Test: Ran testCamera2AccessCallbackInSplitMode x100.
Bug: 224887921
parent 83302867
Loading
Loading
Loading
Loading
+4 −15
Original line number Diff line number Diff line
@@ -3717,21 +3717,10 @@ void CameraService::UidPolicy::onUidIdle(uid_t uid, bool /* disabled */) {

void CameraService::UidPolicy::onUidStateChanged(uid_t uid, int32_t procState,
        int64_t procStateSeq __unused, int32_t capability __unused) {
    bool procStateChange = false;
    {
    Mutex::Autolock _l(mUidLock);
    if (mMonitoredUids.find(uid) != mMonitoredUids.end() &&
            mMonitoredUids[uid].procState != procState) {
        mMonitoredUids[uid].procState = procState;
            procStateChange = true;
        }
    }

    if (procStateChange) {
        sp<CameraService> service = mService.promote();
        if (service != nullptr) {
            service->notifyMonitoredUids();
        }
    }
}