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

Commit 3fd72ff2 authored by Lucas Dupin's avatar Lucas Dupin
Browse files

DO NOT MERGE Revert "Wallpaper color extraction API stub"

This reverts commit c40608c0.

Change-Id: Ia202f4b48b8ba22497db8aa97ba53d412f7b7bd5
parent c40608c0
Loading
Loading
Loading
Loading
+0 −21
Original line number Diff line number Diff line
@@ -6090,17 +6090,6 @@ package android.app {
    method public void onDetached();
  }
  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(android.os.Parcel);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
    method public int describeContents();
    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
    method public boolean supportsDarkText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
  }
  public final class WallpaperInfo implements android.os.Parcelable {
    ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
@@ -6123,8 +6112,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;
    method public void clearWallpaperOffsets(android.os.IBinder);
@@ -6139,7 +6126,6 @@ package android.app {
    method public android.graphics.drawable.Drawable getDrawable();
    method public android.graphics.drawable.Drawable getFastDrawable();
    method public static android.app.WallpaperManager getInstance(android.content.Context);
    method public android.app.WallpaperColors getWallpaperColors(int);
    method public android.os.ParcelFileDescriptor getWallpaperFile(int);
    method public int getWallpaperId(int);
    method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6148,7 +6134,6 @@ package android.app {
    method public boolean isWallpaperSupported();
    method public android.graphics.drawable.Drawable peekDrawable();
    method public android.graphics.drawable.Drawable peekFastDrawable();
    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
    method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6173,10 +6158,6 @@ package android.app {
    field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
  }
  public static abstract interface WallpaperManager.OnColorsChangedListener {
    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
  }
}
package android.app.admin {
@@ -37747,12 +37728,10 @@ package android.service.wallpaper {
    method public int getDesiredMinimumHeight();
    method public int getDesiredMinimumWidth();
    method public android.view.SurfaceHolder getSurfaceHolder();
    method public void invalidateColors();
    method public boolean isPreview();
    method public boolean isVisible();
    method public void onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
    method public android.app.WallpaperColors onComputeWallpaperColors();
    method public void onCreate(android.view.SurfaceHolder);
    method public void onDesiredSizeChanged(int, int);
    method public void onDestroy();
+0 −21
Original line number Diff line number Diff line
@@ -6294,17 +6294,6 @@ package android.app {
    method public void setPersistentVrModeEnabled(boolean);
  }
  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(android.os.Parcel);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
    method public int describeContents();
    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
    method public boolean supportsDarkText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
  }
  public final class WallpaperInfo implements android.os.Parcelable {
    ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
@@ -6327,8 +6316,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;
    method public void clearWallpaper();
@@ -6345,7 +6332,6 @@ package android.app {
    method public android.graphics.drawable.Drawable getDrawable();
    method public android.graphics.drawable.Drawable getFastDrawable();
    method public static android.app.WallpaperManager getInstance(android.content.Context);
    method public android.app.WallpaperColors getWallpaperColors(int);
    method public android.os.ParcelFileDescriptor getWallpaperFile(int);
    method public int getWallpaperId(int);
    method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6354,7 +6340,6 @@ package android.app {
    method public boolean isWallpaperSupported();
    method public android.graphics.drawable.Drawable peekDrawable();
    method public android.graphics.drawable.Drawable peekFastDrawable();
    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
    method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6382,10 +6367,6 @@ package android.app {
    field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
  }
  public static abstract interface WallpaperManager.OnColorsChangedListener {
    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
  }
}
package android.app.admin {
@@ -41005,12 +40986,10 @@ package android.service.wallpaper {
    method public int getDesiredMinimumHeight();
    method public int getDesiredMinimumWidth();
    method public android.view.SurfaceHolder getSurfaceHolder();
    method public void invalidateColors();
    method public boolean isPreview();
    method public boolean isVisible();
    method public void onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
    method public android.app.WallpaperColors onComputeWallpaperColors();
    method public void onCreate(android.view.SurfaceHolder);
    method public void onDesiredSizeChanged(int, int);
    method public void onDestroy();
+0 −21
Original line number Diff line number Diff line
@@ -6110,17 +6110,6 @@ package android.app {
    method public void onDetached();
  }
  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(android.os.Parcel);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>);
    ctor public WallpaperColors(java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>>, boolean);
    method public int describeContents();
    method public java.util.List<android.util.Pair<android.graphics.Color, java.lang.Integer>> getColors();
    method public boolean supportsDarkText();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR;
  }
  public final class WallpaperInfo implements android.os.Parcelable {
    ctor public WallpaperInfo(android.content.Context, android.content.pm.ResolveInfo) throws java.io.IOException, org.xmlpull.v1.XmlPullParserException;
    method public int describeContents();
@@ -6143,8 +6132,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;
    method public void clearWallpaperOffsets(android.os.IBinder);
@@ -6159,7 +6146,6 @@ package android.app {
    method public android.graphics.drawable.Drawable getDrawable();
    method public android.graphics.drawable.Drawable getFastDrawable();
    method public static android.app.WallpaperManager getInstance(android.content.Context);
    method public android.app.WallpaperColors getWallpaperColors(int);
    method public android.os.ParcelFileDescriptor getWallpaperFile(int);
    method public int getWallpaperId(int);
    method public android.app.WallpaperInfo getWallpaperInfo();
@@ -6168,7 +6154,6 @@ package android.app {
    method public boolean isWallpaperSupported();
    method public android.graphics.drawable.Drawable peekDrawable();
    method public android.graphics.drawable.Drawable peekFastDrawable();
    method public void removeOnColorsChangedListener(android.app.WallpaperManager.OnColorsChangedListener);
    method public void sendWallpaperCommand(android.os.IBinder, java.lang.String, int, int, int, android.os.Bundle);
    method public void setBitmap(android.graphics.Bitmap) throws java.io.IOException;
    method public int setBitmap(android.graphics.Bitmap, android.graphics.Rect, boolean) throws java.io.IOException;
@@ -6193,10 +6178,6 @@ package android.app {
    field public static final java.lang.String WALLPAPER_PREVIEW_META_DATA = "android.wallpaper.preview";
  }
  public static abstract interface WallpaperManager.OnColorsChangedListener {
    method public abstract void onColorsChanged(android.app.WallpaperColors, int);
  }
}
package android.app.admin {
@@ -37941,12 +37922,10 @@ package android.service.wallpaper {
    method public int getDesiredMinimumHeight();
    method public int getDesiredMinimumWidth();
    method public android.view.SurfaceHolder getSurfaceHolder();
    method public void invalidateColors();
    method public boolean isPreview();
    method public boolean isVisible();
    method public void onApplyWindowInsets(android.view.WindowInsets);
    method public android.os.Bundle onCommand(java.lang.String, int, int, int, android.os.Bundle, boolean);
    method public android.app.WallpaperColors onComputeWallpaperColors();
    method public void onCreate(android.view.SurfaceHolder);
    method public void onDesiredSizeChanged(int, int);
    method public void onDestroy();
+0 −97
Original line number Diff line number Diff line
/*
 * Copyright (C) 2017 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License
 */

package android.app;

import android.graphics.Color;
import android.os.Parcel;
import android.os.Parcelable;

import android.util.Pair;

import java.util.List;

/**
 * A class containing information about the colors of a wallpaper.
 */
public final class WallpaperColors implements Parcelable {

    public WallpaperColors(Parcel parcel) {
    }

    /**
     * Wallpaper color details containing a list of colors and their weights,
     * as if it were an histogram.
     * This list can be extracted from a bitmap by the Palette API.
     *
     * Dark text support will be calculated internally based on the histogram.
     *
     * @param colors list of pairs where each pair contains a color
     *               and number of occurrences/influence.
     */
    public WallpaperColors(List<Pair<Color, Integer>> colors) {
    }

    /**
     * Wallpaper color details containing a list of colors and their weights,
     * as if it were an histogram.
     * Explicit dark text support.
     *
     * @param colors list of pairs where each pair contains a color
     *               and number of occurrences/influence.
     * @param supportsDarkText can have dark text on top or not
     */
    public WallpaperColors(List<Pair<Color, Integer>> colors, boolean supportsDarkText) {
    }

    public static final Creator<WallpaperColors> CREATOR = new Creator<WallpaperColors>() {
        @Override
        public WallpaperColors createFromParcel(Parcel in) {
            return new WallpaperColors(in);
        }

        @Override
        public WallpaperColors[] newArray(int size) {
            return new WallpaperColors[size];
        }
    };

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
    }

    /**
     * List of colors with their occurrences. The bigger the int, the more relevant the color.
     * @return list of colors paired with their weights.
     */
    public List<Pair<Color, Integer>> getColors() {
        return null;
    }

    /**
     * Whether or not dark text is legible on top of this wallpaper.
     *
     * @return true if dark text is supported
     */
    public boolean supportsDarkText() {
        return false;
    }
}
+0 −54
Original line number Diff line number Diff line
@@ -17,8 +17,6 @@
package android.app;

import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.RawRes;
import android.annotation.SystemApi;
import android.content.ComponentName;
@@ -743,43 +741,6 @@ public class WallpaperManager {
        return getWallpaperFile(which, mContext.getUserId());
    }


    /**
     * 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) {
    }

    /**
     * Registers a listener to get notified when the wallpaper colors change
     * @param listener A listener to register
     * @param handler Where to call it from. Might be called from a background thread
     *                if null.
     */
    public void addOnColorsChangedListener(@NonNull OnColorsChangedListener listener,
            @Nullable Handler handler) {
    }

    /**
     * Stop listening to color updates.
     * @param callback A callback to unsubscribe
     */
    public void removeOnColorsChangedListener(@NonNull OnColorsChangedListener callback) {
    }

    /**
     * Get the primary colors of a wallpaper
     * @param which wallpaper type. Must be either {@link #FLAG_SYSTEM} or
     *     {@link #FLAG_LOCK}
     * @return a list of colors ordered by priority
     */
    public @Nullable WallpaperColors getWallpaperColors(int which) {
        return null;
    }

    /**
     * Version of {@link #getWallpaperFile(int)} that can access the wallpaper data
     * for a given user.  The caller must hold the INTERACT_ACROSS_USERS_FULL
@@ -1771,19 +1732,4 @@ public class WallpaperManager {
            mLatch.countDown();
        }
    }

    /**
     * Interface definition for a callback to be invoked when colors change on a wallpaper.
     */
    public interface OnColorsChangedListener {
        /**
         * Called when colors change.
         * A {@link android.app.WallpaperColors} object containing a simplified
         * color histogram will be given.
         *
         * @param colors Wallpaper color info
         * @param which A combination of {@link #FLAG_LOCK} and {@link #FLAG_SYSTEM}
         */
        void onColorsChanged(WallpaperColors colors, int which);
    }
}
Loading