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

Commit 9a818444 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Avoid acquiring lock when feature flag is disabled" into main

parents a4007410 6df9c2f6
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -665,6 +665,9 @@ public class MediaSessionService extends SystemService implements Monitor {
    }

    private void addUserEngagedSession(MediaSessionRecordImpl mediaSessionRecord) {
        if (!Flags.enableNotifyingActivityManagerWithMediaSessionStatusChange()) {
            return;
        }
        synchronized (mLock) {
            int uid = mediaSessionRecord.getUid();
            mUserEngagedSessionsForFgs.putIfAbsent(uid, new HashSet<>());
@@ -673,6 +676,9 @@ public class MediaSessionService extends SystemService implements Monitor {
    }

    private void removeUserEngagedSession(MediaSessionRecordImpl mediaSessionRecord) {
        if (!Flags.enableNotifyingActivityManagerWithMediaSessionStatusChange()) {
            return;
        }
        synchronized (mLock) {
            int uid = mediaSessionRecord.getUid();
            Set<MediaSessionRecordImpl> mUidUserEngagedSessionsForFgs =