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

Commit b2facb10 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Save one notifyColorListeners() call" into sc-dev am: 8c9039fc

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15079478

Change-Id: Ic0bc7f8dec58577baf527f5b7658220494956ee3
parents dbcf42b3 8c9039fc
Loading
Loading
Loading
Loading
+1 −11
Original line number Diff line number Diff line
@@ -405,21 +405,11 @@ public class WallpaperManagerService extends IWallpaperManager.Stub
            needsExtraction = wallpaper.primaryColors == null;
        }

        // Let's notify the current values, it's fine if it's null, it just means
        // that we don't know yet.
        notifyColorListeners(wallpaper.primaryColors, which, wallpaper.userId, displayId);

        if (needsExtraction) {
            extractColors(wallpaper);
            synchronized (mLock) {
                // Don't need to notify if nothing changed.
                if (wallpaper.primaryColors == null) {
                    return;
                }
        }
        notifyColorListeners(wallpaper.primaryColors, which, wallpaper.userId, displayId);
    }
    }

    private static <T extends IInterface> boolean emptyCallbackList(RemoteCallbackList<T> list) {
        return (list == null || list.getRegisteredCallbackCount() == 0);