Loading core/api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -6810,14 +6810,18 @@ package android.app { public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(android.os.Parcel); ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color); ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int); method public int describeContents(); method public static android.app.WallpaperColors fromBitmap(@NonNull android.graphics.Bitmap); method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable); method public int getColorHints(); method @NonNull public android.graphics.Color getPrimaryColor(); method @Nullable public android.graphics.Color getSecondaryColor(); method @Nullable public android.graphics.Color getTertiaryColor(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR; field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2 } public final class WallpaperInfo implements android.os.Parcelable { core/api/system-current.txt +0 −7 Original line number Diff line number Diff line Loading @@ -857,13 +857,6 @@ package android.app { method public void onVrStateChanged(boolean); } public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int); method public int getColorHints(); field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2 } public final class WallpaperInfo implements android.os.Parcelable { method public boolean supportsAmbientMode(); } Loading core/java/android/app/WallpaperColors.java +18 −28 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package android.app; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; Loading @@ -35,6 +35,8 @@ import com.android.internal.graphics.palette.Palette; import com.android.internal.util.ContrastColorUtil; import java.io.FileOutputStream; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; Loading @@ -50,6 +52,13 @@ import java.util.stream.Collectors; * or {@link WallpaperColors#getTertiaryColor()}. */ public final class WallpaperColors implements Parcelable { /** * @hide */ @IntDef(prefix = "HINT_", value = {HINT_SUPPORTS_DARK_TEXT, HINT_SUPPORTS_DARK_THEME}, flag = true) @Retention(RetentionPolicy.SOURCE) public @interface ColorsHints {} private static final boolean DEBUG_DARK_PIXELS = false; Loading @@ -57,18 +66,14 @@ public final class WallpaperColors implements Parcelable { * Specifies that dark text is preferred over the current wallpaper for best presentation. * <p> * eg. A launcher may set its text color to black if this flag is specified. * @hide */ @SystemApi public static final int HINT_SUPPORTS_DARK_TEXT = 1 << 0; /** * Specifies that dark theme is preferred over the current wallpaper for best presentation. * <p> * eg. A launcher may set its drawer color to black if this flag is specified. * @hide */ @SystemApi public static final int HINT_SUPPORTS_DARK_THEME = 1 << 1; /** Loading Loading @@ -229,15 +234,12 @@ public final class WallpaperColors implements Parcelable { * @param primaryColor Primary color. * @param secondaryColor Secondary color. * @param tertiaryColor Tertiary color. * @param colorHints A combination of WallpaperColor hints. * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @param colorHints A combination of color hints. * @see WallpaperColors#fromBitmap(Bitmap) * @see WallpaperColors#fromDrawable(Drawable) * @hide */ @SystemApi public WallpaperColors(@NonNull Color primaryColor, @Nullable Color secondaryColor, @Nullable Color tertiaryColor, int colorHints) { @Nullable Color tertiaryColor, @ColorsHints int colorHints) { if (primaryColor == null) { throw new IllegalArgumentException("Primary color should never be null."); Loading Loading @@ -268,13 +270,14 @@ public final class WallpaperColors implements Parcelable { * * @param populationByColor Map with keys of colors, and value representing the number of * occurrences of color in the wallpaper. * @param colorHints A combination of WallpaperColor hints. * @param colorHints A combination of color hints. * @hide * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @see WallpaperColors#fromBitmap(Bitmap) * @see WallpaperColors#fromDrawable(Drawable) */ public WallpaperColors(@NonNull Map<Integer, Integer> populationByColor, int colorHints) { public WallpaperColors(@NonNull Map<Integer, Integer> populationByColor, @ColorsHints int colorHints) { mAllColors = populationByColor; ArrayList<Map.Entry<Integer, Integer>> mapEntries = new ArrayList( Loading Loading @@ -386,26 +389,13 @@ public final class WallpaperColors implements Parcelable { } /** * Combination of WallpaperColor hints. * * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @return True if dark text is supported. * @hide * Returns the color hints for this instance. * @return The color hints. */ @SystemApi public int getColorHints() { public @ColorsHints int getColorHints() { return mColorHints; } /** * @param colorHints Combination of WallpaperColors hints. * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @hide */ public void setColorHints(int colorHints) { mColorHints = colorHints; } /** * Checks if image is bright and clean enough to support light text. * Loading Loading
core/api/current.txt +4 −0 Original line number Diff line number Diff line Loading @@ -6810,14 +6810,18 @@ package android.app { public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(android.os.Parcel); ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color); ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int); method public int describeContents(); method public static android.app.WallpaperColors fromBitmap(@NonNull android.graphics.Bitmap); method public static android.app.WallpaperColors fromDrawable(android.graphics.drawable.Drawable); method public int getColorHints(); method @NonNull public android.graphics.Color getPrimaryColor(); method @Nullable public android.graphics.Color getSecondaryColor(); method @Nullable public android.graphics.Color getTertiaryColor(); method public void writeToParcel(android.os.Parcel, int); field @NonNull public static final android.os.Parcelable.Creator<android.app.WallpaperColors> CREATOR; field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2 } public final class WallpaperInfo implements android.os.Parcelable {
core/api/system-current.txt +0 −7 Original line number Diff line number Diff line Loading @@ -857,13 +857,6 @@ package android.app { method public void onVrStateChanged(boolean); } public final class WallpaperColors implements android.os.Parcelable { ctor public WallpaperColors(@NonNull android.graphics.Color, @Nullable android.graphics.Color, @Nullable android.graphics.Color, int); method public int getColorHints(); field public static final int HINT_SUPPORTS_DARK_TEXT = 1; // 0x1 field public static final int HINT_SUPPORTS_DARK_THEME = 2; // 0x2 } public final class WallpaperInfo implements android.os.Parcelable { method public boolean supportsAmbientMode(); } Loading
core/java/android/app/WallpaperColors.java +18 −28 Original line number Diff line number Diff line Loading @@ -16,9 +16,9 @@ package android.app; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.SystemApi; import android.graphics.Bitmap; import android.graphics.Canvas; import android.graphics.Color; Loading @@ -35,6 +35,8 @@ import com.android.internal.graphics.palette.Palette; import com.android.internal.util.ContrastColorUtil; import java.io.FileOutputStream; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; import java.util.Collections; import java.util.HashMap; Loading @@ -50,6 +52,13 @@ import java.util.stream.Collectors; * or {@link WallpaperColors#getTertiaryColor()}. */ public final class WallpaperColors implements Parcelable { /** * @hide */ @IntDef(prefix = "HINT_", value = {HINT_SUPPORTS_DARK_TEXT, HINT_SUPPORTS_DARK_THEME}, flag = true) @Retention(RetentionPolicy.SOURCE) public @interface ColorsHints {} private static final boolean DEBUG_DARK_PIXELS = false; Loading @@ -57,18 +66,14 @@ public final class WallpaperColors implements Parcelable { * Specifies that dark text is preferred over the current wallpaper for best presentation. * <p> * eg. A launcher may set its text color to black if this flag is specified. * @hide */ @SystemApi public static final int HINT_SUPPORTS_DARK_TEXT = 1 << 0; /** * Specifies that dark theme is preferred over the current wallpaper for best presentation. * <p> * eg. A launcher may set its drawer color to black if this flag is specified. * @hide */ @SystemApi public static final int HINT_SUPPORTS_DARK_THEME = 1 << 1; /** Loading Loading @@ -229,15 +234,12 @@ public final class WallpaperColors implements Parcelable { * @param primaryColor Primary color. * @param secondaryColor Secondary color. * @param tertiaryColor Tertiary color. * @param colorHints A combination of WallpaperColor hints. * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @param colorHints A combination of color hints. * @see WallpaperColors#fromBitmap(Bitmap) * @see WallpaperColors#fromDrawable(Drawable) * @hide */ @SystemApi public WallpaperColors(@NonNull Color primaryColor, @Nullable Color secondaryColor, @Nullable Color tertiaryColor, int colorHints) { @Nullable Color tertiaryColor, @ColorsHints int colorHints) { if (primaryColor == null) { throw new IllegalArgumentException("Primary color should never be null."); Loading Loading @@ -268,13 +270,14 @@ public final class WallpaperColors implements Parcelable { * * @param populationByColor Map with keys of colors, and value representing the number of * occurrences of color in the wallpaper. * @param colorHints A combination of WallpaperColor hints. * @param colorHints A combination of color hints. * @hide * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @see WallpaperColors#fromBitmap(Bitmap) * @see WallpaperColors#fromDrawable(Drawable) */ public WallpaperColors(@NonNull Map<Integer, Integer> populationByColor, int colorHints) { public WallpaperColors(@NonNull Map<Integer, Integer> populationByColor, @ColorsHints int colorHints) { mAllColors = populationByColor; ArrayList<Map.Entry<Integer, Integer>> mapEntries = new ArrayList( Loading Loading @@ -386,26 +389,13 @@ public final class WallpaperColors implements Parcelable { } /** * Combination of WallpaperColor hints. * * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @return True if dark text is supported. * @hide * Returns the color hints for this instance. * @return The color hints. */ @SystemApi public int getColorHints() { public @ColorsHints int getColorHints() { return mColorHints; } /** * @param colorHints Combination of WallpaperColors hints. * @see WallpaperColors#HINT_SUPPORTS_DARK_TEXT * @hide */ public void setColorHints(int colorHints) { mColorHints = colorHints; } /** * Checks if image is bright and clean enough to support light text. * Loading