diff options
| author | 2017-04-26 19:28:10 +0000 | |
|---|---|---|
| committer | 2017-04-26 19:28:10 +0000 | |
| commit | 3fd72ff2e7a9d40dc3d295be6cbc712814fed0f6 (patch) | |
| tree | 10e46789ac028565e3f8b93a581dd6ee51ff0092 | |
| parent | c40608c041b1eb8b8cb4b96347c7ca29f4f79169 (diff) | |
DO NOT MERGE Revert "Wallpaper color extraction API stub"
This reverts commit c40608c041b1eb8b8cb4b96347c7ca29f4f79169.
Change-Id: Ia202f4b48b8ba22497db8aa97ba53d412f7b7bd5
| -rw-r--r-- | api/current.txt | 21 | ||||
| -rw-r--r-- | api/system-current.txt | 21 | ||||
| -rw-r--r-- | api/test-current.txt | 21 | ||||
| -rw-r--r-- | core/java/android/app/WallpaperColors.java | 97 | ||||
| -rw-r--r-- | core/java/android/app/WallpaperManager.java | 54 | ||||
| -rw-r--r-- | core/java/android/service/wallpaper/WallpaperService.java | 20 |
6 files changed, 0 insertions, 234 deletions
diff --git a/api/current.txt b/api/current.txt index b4e52a3aeaca..e2dd78fcbd17 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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(); diff --git a/api/system-current.txt b/api/system-current.txt index bd82ef4861d5..4a0b6f3de3d2 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -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(); diff --git a/api/test-current.txt b/api/test-current.txt index 780446c1e972..0e8a52f4974e 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -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(); diff --git a/core/java/android/app/WallpaperColors.java b/core/java/android/app/WallpaperColors.java deleted file mode 100644 index 5ed66cac5f8f..000000000000 --- a/core/java/android/app/WallpaperColors.java +++ /dev/null @@ -1,97 +0,0 @@ -/* - * 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; - } -} diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java index 0676bca0e796..aa0eaaebf975 100644 --- a/core/java/android/app/WallpaperManager.java +++ b/core/java/android/app/WallpaperManager.java @@ -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); - } } diff --git a/core/java/android/service/wallpaper/WallpaperService.java b/core/java/android/service/wallpaper/WallpaperService.java index 98780a7d73d5..6bbb0ff9861b 100644 --- a/core/java/android/service/wallpaper/WallpaperService.java +++ b/core/java/android/service/wallpaper/WallpaperService.java @@ -16,8 +16,6 @@ package android.service.wallpaper; -import android.annotation.Nullable; -import android.app.WallpaperColors; import android.content.res.TypedArray; import android.graphics.Canvas; import android.util.MergedConfiguration; @@ -544,24 +542,6 @@ public abstract class WallpaperService extends Service { */ public void onSurfaceDestroyed(SurfaceHolder holder) { } - - /** - * Notifies the engine that wallpaper colors changed significantly. - * This will trigger a {@link #onComputeWallpaperColors()} call. - */ - public void invalidateColors() { - } - - /** - * Notifies the system about what colors the wallpaper is using. - * You might return null if no color information is available at the moment. In that case - * you might want to call {@link #invalidateColors()} in a near future. - * - * @return List of wallpaper colors and their weights. - */ - public @Nullable WallpaperColors onComputeWallpaperColors() { - return null; - } protected void dump(String prefix, FileDescriptor fd, PrintWriter out, String[] args) { out.print(prefix); out.print("mInitializing="); out.print(mInitializing); |