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

Commit be09f280 authored by vincentpeng's avatar vincentpeng Committed by Vincent Peng
Browse files

WallpaperColor's ColorHint API go for @SystemApi

Making color hint's relative api @SystemApi.
For pre-installed live wallpaper apps, change to @SystemApi so:

1. apps can be build with gradle build tools.
   (e.g.: PixelLiveWallpaper for app bundle feature).
2. apps can calculate and pass color hint information to interested system components.
   (Such as passing dark text support to SystemUi)

Fixes: 111395593

Test: make system sdk and check if the wallpaper apps can compile with android_system.jar.
Test: check whether the wallpaper apps can pass correct color hint after build (dark text).

Change-Id: I2ecf6ff77ff7a823949c6e3253a077e6eba9683a
parent 217e4352
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -537,6 +537,13 @@ package android.app {
    method public void onVrStateChanged(boolean);
  }

  public final class WallpaperColors implements android.os.Parcelable {
    ctor public WallpaperColors(android.graphics.Color, android.graphics.Color, 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();
  }
+5 −3
Original line number Diff line number Diff line
@@ -18,7 +18,7 @@ package android.app;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.UnsupportedAppUsage;
import android.annotation.SystemApi;
import android.graphics.Bitmap;
import android.graphics.Canvas;
import android.graphics.Color;
@@ -56,6 +56,7 @@ public final class WallpaperColors implements Parcelable {
     * 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;

    /**
@@ -64,6 +65,7 @@ public final class WallpaperColors implements Parcelable {
     * 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;

    /**
@@ -234,7 +236,7 @@ public final class WallpaperColors implements Parcelable {
     * @see WallpaperColors#fromDrawable(Drawable)
     * @hide
     */
    @UnsupportedAppUsage
    @SystemApi
    public WallpaperColors(@NonNull Color primaryColor, @Nullable Color secondaryColor,
            @Nullable Color tertiaryColor, int colorHints) {

@@ -349,7 +351,7 @@ public final class WallpaperColors implements Parcelable {
     * @return True if dark text is supported.
     * @hide
     */
    @UnsupportedAppUsage
    @SystemApi
    public int getColorHints() {
        return mColorHints;
    }