summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ching-Sung Li <chriscsli@google.com> 2025-01-15 03:35:52 -0800
committer Android (Google) Code Review <android-gerrit@google.com> 2025-01-15 03:35:52 -0800
commitf7adc60487e476650278e133a7a8233537c302c6 (patch)
treeff5780960f1ac1e945ccc24d8cbda04b444e087c
parente09cb245c7c437e27d19f9b46f98b192160cf9d1 (diff)
parent161c47f7deb32a496b6d5cf9989250f97803f12e (diff)
Merge "Remove flag related with new getBitmapCrops API" into main
-rw-r--r--core/api/system-current.txt6
-rw-r--r--core/api/test-current.txt1
-rw-r--r--core/java/android/app/DisabledWallpaperManager.java7
-rw-r--r--core/java/android/app/WallpaperManager.java59
-rw-r--r--core/java/android/app/wallpaper.aconfig8
5 files changed, 0 insertions, 81 deletions
diff --git a/core/api/system-current.txt b/core/api/system-current.txt
index ae5542be7548..6dedfa4cf535 100644
--- a/core/api/system-current.txt
+++ b/core/api/system-current.txt
@@ -1290,9 +1290,7 @@ package android.app {
public class WallpaperManager {
method @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) public void clearWallpaper(int, int);
- method @FlaggedApi("android.app.customization_packs_apis") public static int getOrientation(@NonNull android.graphics.Point);
method @FloatRange(from=0.0f, to=1.0f) @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT) public float getWallpaperDimAmount();
- method @FlaggedApi("android.app.customization_packs_apis") @Nullable public android.os.ParcelFileDescriptor getWallpaperFile(int, boolean);
method @FlaggedApi("android.app.live_wallpaper_content_handling") @Nullable @RequiresPermission(android.Manifest.permission.READ_WALLPAPER_INTERNAL) public android.app.wallpaper.WallpaperInstance getWallpaperInstance(int);
method public void setDisplayOffset(android.os.IBinder, int, int);
method @FlaggedApi("com.android.window.flags.multi_crop") @RequiresPermission(android.Manifest.permission.SET_WALLPAPER) public int setStreamWithCrops(@NonNull java.io.InputStream, @NonNull android.util.SparseArray<android.graphics.Rect>, boolean, int) throws java.io.IOException;
@@ -1301,10 +1299,6 @@ package android.app {
method @FlaggedApi("android.app.live_wallpaper_content_handling") @RequiresPermission(allOf={android.Manifest.permission.SET_WALLPAPER_COMPONENT, android.Manifest.permission.INTERACT_ACROSS_USERS_FULL}, conditional=true) public boolean setWallpaperComponentWithDescription(@NonNull android.app.wallpaper.WallpaperDescription, int);
method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_COMPONENT) public boolean setWallpaperComponentWithFlags(@NonNull android.content.ComponentName, int);
method @RequiresPermission(android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT) public void setWallpaperDimAmount(@FloatRange(from=0.0f, to=1.0f) float);
- field @FlaggedApi("android.app.customization_packs_apis") public static final int ORIENTATION_LANDSCAPE = 1; // 0x1
- field @FlaggedApi("android.app.customization_packs_apis") public static final int ORIENTATION_PORTRAIT = 0; // 0x0
- field @FlaggedApi("android.app.customization_packs_apis") public static final int ORIENTATION_SQUARE_LANDSCAPE = 3; // 0x3
- field @FlaggedApi("android.app.customization_packs_apis") public static final int ORIENTATION_SQUARE_PORTRAIT = 2; // 0x2
}
}
diff --git a/core/api/test-current.txt b/core/api/test-current.txt
index b118c7b6fed8..eb483c82b450 100644
--- a/core/api/test-current.txt
+++ b/core/api/test-current.txt
@@ -508,7 +508,6 @@ package android.app {
method @Nullable public android.graphics.Bitmap getBitmap();
method @Nullable public android.graphics.Bitmap getBitmapAsUser(int, boolean, int);
method @FlaggedApi("com.android.window.flags.multi_crop") @NonNull @RequiresPermission(android.Manifest.permission.READ_WALLPAPER_INTERNAL) public java.util.List<android.graphics.Rect> getBitmapCrops(@NonNull java.util.List<android.graphics.Point>, int, boolean);
- method @FlaggedApi("android.app.customization_packs_apis") @NonNull @RequiresPermission(android.Manifest.permission.READ_WALLPAPER_INTERNAL) public android.util.SparseArray<android.graphics.Rect> getBitmapCrops(int);
method @FlaggedApi("com.android.window.flags.multi_crop") @NonNull public java.util.List<android.graphics.Rect> getBitmapCrops(@NonNull android.graphics.Point, @NonNull java.util.List<android.graphics.Point>, @Nullable java.util.Map<android.graphics.Point,android.graphics.Rect>);
method public boolean isLockscreenLiveWallpaperEnabled();
method @Nullable public android.graphics.Rect peekBitmapDimensions();
diff --git a/core/java/android/app/DisabledWallpaperManager.java b/core/java/android/app/DisabledWallpaperManager.java
index 233dc75b810f..087bcd8620e4 100644
--- a/core/java/android/app/DisabledWallpaperManager.java
+++ b/core/java/android/app/DisabledWallpaperManager.java
@@ -177,13 +177,6 @@ final class DisabledWallpaperManager extends WallpaperManager {
}
@Override
- @NonNull
- public SparseArray<Rect> getBitmapCrops(int which) {
- unsupported();
- return new SparseArray<>();
- }
-
- @Override
public List<Rect> getBitmapCrops(@NonNull Point bitmapSize, @NonNull List<Point> displaySizes,
@Nullable Map<Point, Rect> cropHints) {
return unsupported();
diff --git a/core/java/android/app/WallpaperManager.java b/core/java/android/app/WallpaperManager.java
index 73ecc7199686..076f856635b5 100644
--- a/core/java/android/app/WallpaperManager.java
+++ b/core/java/android/app/WallpaperManager.java
@@ -19,7 +19,6 @@ package android.app;
import static android.Manifest.permission.MANAGE_EXTERNAL_STORAGE;
import static android.Manifest.permission.READ_WALLPAPER_INTERNAL;
import static android.Manifest.permission.SET_WALLPAPER_DIM_AMOUNT;
-import static android.app.Flags.FLAG_CUSTOMIZATION_PACKS_APIS;
import static android.app.Flags.FLAG_LIVE_WALLPAPER_CONTENT_HANDLING;
import static android.content.pm.PackageManager.PERMISSION_GRANTED;
import static android.os.ParcelFileDescriptor.MODE_READ_ONLY;
@@ -343,32 +342,24 @@ public class WallpaperManager {
* Portrait orientation of most screens
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
public static final int ORIENTATION_PORTRAIT = 0;
/**
* Landscape orientation of most screens
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
public static final int ORIENTATION_LANDSCAPE = 1;
/**
* Portrait orientation with similar width and height (e.g. the inner screen of a foldable)
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
public static final int ORIENTATION_SQUARE_PORTRAIT = 2;
/**
* Landscape orientation with similar width and height (e.g. the inner screen of a foldable)
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
public static final int ORIENTATION_SQUARE_LANDSCAPE = 3;
/**
@@ -377,8 +368,6 @@ public class WallpaperManager {
* @return the corresponding {@link ScreenOrientation}.
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
public static @ScreenOrientation int getOrientation(@NonNull Point screenSize) {
float ratio = ((float) screenSize.x) / screenSize.y;
// ratios between 3/4 and 4/3 are considered square
@@ -1665,52 +1654,6 @@ public class WallpaperManager {
}
/**
- * For the current user, if the wallpaper of the specified destination is an ImageWallpaper,
- * return the custom crops of the wallpaper, that have been provided for example via
- * {@link #setStreamWithCrops}. These crops are relative to the original bitmap.
- * <p>
- * This method helps apps that change wallpapers provide an undo option. Calling
- * {@link #setStreamWithCrops(InputStream, SparseArray, boolean, int)} with this SparseArray and
- * the current original bitmap file, that can be obtained with {@link #getWallpaperFile(int,
- * boolean)} with {@code getCropped=false}, will exactly lead to the current wallpaper state.
- *
- * @param which wallpaper type. Must be either {@link #FLAG_SYSTEM} or {@link #FLAG_LOCK}.
- * @return A map from {{@link #ORIENTATION_PORTRAIT}, {@link #ORIENTATION_LANDSCAPE},
- * {@link #ORIENTATION_SQUARE_PORTRAIT}, {{@link #ORIENTATION_SQUARE_LANDSCAPE}}} to
- * Rect, representing the custom cropHints. The map can be empty and will only contains
- * entries for screen orientations for which a custom crop was provided. If no custom
- * crop is provided for an orientation, the system will infer the crop based on the
- * custom crops of the other orientations; or center-align the full image if no custom
- * crops are provided at all.
- * <p>
- * Return an empty map if the wallpaper is not an ImageWallpaper. Also return
- * an empty map when called with which={@link #FLAG_LOCK} if there is a shared
- * home + lock wallpaper.
- *
- * @hide
- */
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @TestApi
- @RequiresPermission(READ_WALLPAPER_INTERNAL)
- @NonNull
- public SparseArray<Rect> getBitmapCrops(@SetWallpaperFlags int which) {
- checkExactlyOneWallpaperFlagSet(which);
- try {
- Bundle bundle = sGlobals.mService.getCurrentBitmapCrops(which, mContext.getUserId());
- SparseArray<Rect> result = new SparseArray<>();
- if (bundle == null) return result;
- for (String key : bundle.keySet()) {
- int intKey = Integer.parseInt(key);
- Rect rect = bundle.getParcelable(key, Rect.class);
- result.put(intKey, rect);
- }
- return result;
- } catch (RemoteException e) {
- throw e.rethrowFromSystemServer();
- }
- }
-
- /**
* For preview purposes.
* Return how a bitmap of a given size would be cropped for a given list of display sizes, if
* it was set as wallpaper via {@link #setBitmapWithCrops(Bitmap, Map, boolean, int)} or
@@ -1955,8 +1898,6 @@ public class WallpaperManager {
* which={@link #FLAG_LOCK} if there is a shared home + lock wallpaper.
* @hide
*/
- @FlaggedApi(FLAG_CUSTOMIZATION_PACKS_APIS)
- @SystemApi
@Nullable
public ParcelFileDescriptor getWallpaperFile(@SetWallpaperFlags int which, boolean getCropped) {
return getWallpaperFile(which, mContext.getUserId(), getCropped);
diff --git a/core/java/android/app/wallpaper.aconfig b/core/java/android/app/wallpaper.aconfig
index be9e286f5eb7..7aba172fad79 100644
--- a/core/java/android/app/wallpaper.aconfig
+++ b/core/java/android/app/wallpaper.aconfig
@@ -24,14 +24,6 @@ flag {
}
flag {
- name: "customization_packs_apis"
- is_exported: true
- namespace: "systemui"
- description: "Move APIs related to bitmap and crops to @SystemApi."
- bug: "372344184"
-}
-
-flag {
name: "accurate_wallpaper_downsampling"
namespace: "systemui"
description: "Accurate downsampling of wallpaper bitmap for high resolution images"