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

Commit 29a982ed authored by Jing Ji's avatar Jing Ji
Browse files

Fix the lock annotation in ProcessList

Bug: 267799126
Test: Treehugger
Change-Id: I1ba7840a508075c5ac6297b480240591b026439e
parent 6c692638
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -3851,7 +3851,7 @@ public final class ProcessList {
        return runList;
    }

    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    int getLruSizeLOSP() {
        return mLruProcesses.size();
    }
@@ -3859,7 +3859,7 @@ public final class ProcessList {
    /**
     * Return the reference to the LRU list, call this function for read-only access
     */
    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    ArrayList<ProcessRecord> getLruProcessesLOSP() {
        return mLruProcesses;
    }
@@ -3867,7 +3867,7 @@ public final class ProcessList {
    /**
     * Return the reference to the LRU list, call this function for read/write access
     */
    @GuardedBy({"mService", "mProfileLock"})
    @GuardedBy({"mService", "mProcLock"})
    ArrayList<ProcessRecord> getLruProcessesLSP() {
        return mLruProcesses;
    }
@@ -3876,12 +3876,12 @@ public final class ProcessList {
     * For test only
     */
    @VisibleForTesting
    @GuardedBy({"mService", "mProfileLock"})
    @GuardedBy({"mService", "mProcLock"})
    void setLruProcessServiceStartLSP(int pos) {
        mLruProcessServiceStart = pos;
    }

    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    int getLruProcessServiceStartLOSP() {
        return mLruProcessServiceStart;
    }
@@ -3894,7 +3894,7 @@ public final class ProcessList {
     *                       to most recent used ProcessRecord.
     * @param callback The callback interface to accept the current ProcessRecord.
     */
    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    void forEachLruProcessesLOSP(boolean iterateForward,
            @NonNull Consumer<ProcessRecord> callback) {
        if (iterateForward) {
@@ -3919,7 +3919,7 @@ public final class ProcessList {
     *                 a non-null object, the search will be halted and this object will be used
     *                 as the return value of this search function.
     */
    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    <R> R searchEachLruProcessesLOSP(boolean iterateForward,
            @NonNull Function<ProcessRecord, R> callback) {
        if (iterateForward) {
@@ -3940,17 +3940,17 @@ public final class ProcessList {
        return null;
    }

    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    boolean isInLruListLOSP(ProcessRecord app) {
        return mLruProcesses.contains(app);
    }

    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    int getLruSeqLOSP() {
        return mLruSeq;
    }

    @GuardedBy(anyOf = {"mService", "mProfileLock"})
    @GuardedBy(anyOf = {"mService", "mProcLock"})
    MyProcessMap getProcessNamesLOSP() {
        return mProcessNames;
    }