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

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

Merge "Fix cache in update picture profile" into main

parents d3335bd5 495c62c1
Loading
Loading
Loading
Loading
+17 −11
Original line number Diff line number Diff line
@@ -390,7 +390,10 @@ public class MediaQualityService extends SystemService {
                    // Keep cache in sync with database, and check for profile id and handle of the
                    // updated picture profile, because user might call this with a picture profile
                    // without handle or profileId.
                    PictureProfile cachedPp = mOriginalHandleToCurrentPictureProfile.get(dbId);
                    Long originalHandle = mCurrentPictureHandleToOriginal.getValue(dbId);
                    if (originalHandle != null) {
                        PictureProfile cachedPp = mOriginalHandleToCurrentPictureProfile
                                .get(originalHandle);
                        if (cachedPp != null) {
                            if (pp.getProfileId() == null
                                    || pp.getHandle() == PictureProfileHandle.NONE) {
@@ -398,11 +401,14 @@ public class MediaQualityService extends SystemService {
                                        .setProfileId(cachedPp.getProfileId())
                                        .setParameters(pp.getParameters())
                                        .build();
                            mOriginalHandleToCurrentPictureProfile.put(dbId, cachedPp);
                                mOriginalHandleToCurrentPictureProfile
                                        .put(originalHandle, cachedPp);
                            } else {
                            mOriginalHandleToCurrentPictureProfile.put(dbId, pp);
                                mOriginalHandleToCurrentPictureProfile.put(originalHandle, pp);
                            }
                        }
                    }

                    if (isPackageDefaultPictureProfile(pp)) {
                        if (DEBUG) {
                            Slog.d(TAG, "updatePictureProfile: "