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

Commit eeb36bee authored by Lucas Dupin's avatar Lucas Dupin
Browse files

API Council feedback

Change-Id: I35b1d2a8a32d2fdf1b698640030dc42c1e595904
Fixes: 64330915
Fixes: 64331343
Test: read the docs
parent 1d66ccde
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -6141,7 +6141,6 @@ package android.app {
  }
  public class WallpaperManager {
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
+0 −1
Original line number Diff line number Diff line
@@ -6358,7 +6358,6 @@ package android.app {
  }
  public class WallpaperManager {
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
+0 −1
Original line number Diff line number Diff line
@@ -6162,7 +6162,6 @@ package android.app {
  }
  public class WallpaperManager {
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void addOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener, android.os.Handler);
    method public void clear() throws java.io.IOException;
    method public void clear(int) throws java.io.IOException;
+11 −14
Original line number Diff line number Diff line
@@ -59,6 +59,7 @@ import android.os.RemoteException;
import android.os.ServiceManager;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.service.wallpaper.WallpaperService;
import android.text.TextUtils;
import android.util.Log;
import android.util.Pair;
@@ -855,16 +856,6 @@ public class WallpaperManager {

    /**
     * Registers a listener to get notified when the wallpaper colors change.
     * Callback might be called from an arbitrary background thread.
     *
     * @param listener A listener to register
     */
    public void addOnColorsChangedListener(@NonNull OnColorsChangedListener listener) {
        addOnColorsChangedListener(listener, null);
    }

    /**
     * Registers a listener to get notified when the wallpaper colors change
     * @param listener A listener to register
     * @param handler Where to call it from. Will be called from the main thread
     *                if null.
@@ -907,10 +898,16 @@ public class WallpaperManager {
    }

    /**
     * Get the primary colors of a wallpaper
     * @param which wallpaper type. Must be either {@link #FLAG_SYSTEM} or
     *     {@link #FLAG_LOCK}
     * @return {@link WallpaperColors} or null if colors are unknown.
     * Get the primary colors of a wallpaper.
     *
     * <p>You can expect null if:
     * • Colors are still being processed by the system.
     * • A live wallpaper doesn't implement {@link WallpaperService.Engine#onComputeColors()}.
     *
     * @param which Wallpaper type. Must be either {@link #FLAG_SYSTEM} or
     *     {@link #FLAG_LOCK}.
     * @return Current {@link WallpaperColors} or null if colors are unknown.
     * @see #addOnColorsChangedListener(OnColorsChangedListener, Handler)
     */
    public @Nullable WallpaperColors getWallpaperColors(int which) {
        return getWallpaperColors(which, mContext.getUserId());
+1 −1
Original line number Diff line number Diff line
@@ -80,7 +80,7 @@ public class ColorExtractor implements WallpaperManager.OnColorsChangedListener
        if (wallpaperManager == null) {
            Log.w(TAG, "Can't listen to color changes!");
        } else {
            wallpaperManager.addOnColorsChangedListener(this);
            wallpaperManager.addOnColorsChangedListener(this, null /* handler */);

            // Initialize all gradients with the current colors
            Trace.beginSection("ColorExtractor#getWallpaperColors");