diff options
| author | 2025-02-20 13:42:48 -0800 | |
|---|---|---|
| committer | 2025-02-20 13:42:48 -0800 | |
| commit | 9da17e294662f1b60e1d2cc1e8e024f9c857a15c (patch) | |
| tree | ff9c5c6ebbdbcb42d2862a416a517a920dcedff0 | |
| parent | 67bfd021ecba691cb5004c162da7fcfe0a57515b (diff) | |
| parent | b7be1991a7e754e076d5032f25f495b6ce00cfdd (diff) | |
Merge "Deprecate setZOrderOnTop() and setZOrderMediaOverlay() APIs" into main
| -rw-r--r-- | core/api/current.txt | 4 | ||||
| -rw-r--r-- | core/java/android/view/SurfaceView.java | 15 | ||||
| -rw-r--r-- | core/java/android/view/flags/view_flags.aconfig | 8 |
3 files changed, 25 insertions, 2 deletions
diff --git a/core/api/current.txt b/core/api/current.txt index 9ebb5068bf19..4862236a35e3 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -53802,8 +53802,8 @@ package android.view { method @FlaggedApi("com.android.graphics.hwui.flags.limited_hdr") public void setDesiredHdrHeadroom(@FloatRange(from=0.0f, to=10000.0) float); method public void setSecure(boolean); method public void setSurfaceLifecycle(int); - method public void setZOrderMediaOverlay(boolean); - method public void setZOrderOnTop(boolean); + method @Deprecated @FlaggedApi("android.view.flags.deprecate_surface_view_z_order_apis") public void setZOrderMediaOverlay(boolean); + method @Deprecated @FlaggedApi("android.view.flags.deprecate_surface_view_z_order_apis") public void setZOrderOnTop(boolean); field public static final int SURFACE_LIFECYCLE_DEFAULT = 0; // 0x0 field public static final int SURFACE_LIFECYCLE_FOLLOWS_ATTACHMENT = 2; // 0x2 field public static final int SURFACE_LIFECYCLE_FOLLOWS_VISIBILITY = 1; // 0x1 diff --git a/core/java/android/view/SurfaceView.java b/core/java/android/view/SurfaceView.java index dd32947c69e4..b98f4db5dce6 100644 --- a/core/java/android/view/SurfaceView.java +++ b/core/java/android/view/SurfaceView.java @@ -16,6 +16,7 @@ package android.view; +import static android.view.flags.Flags.FLAG_DEPRECATE_SURFACE_VIEW_Z_ORDER_APIS; import static android.view.flags.Flags.FLAG_SURFACE_VIEW_GET_SURFACE_PACKAGE; import static android.view.flags.Flags.FLAG_SURFACE_VIEW_SET_COMPOSITION_ORDER; import static android.view.WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON; @@ -812,7 +813,12 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall * window is attached to the window manager. * * <p>Calling this overrides any previous call to {@link #setZOrderOnTop}. + * + * @deprecated Use {@link #setCompositionOrder(int)} instead. It provides more + * control over the Z ordering behavior. */ + @Deprecated + @FlaggedApi(FLAG_DEPRECATE_SURFACE_VIEW_Z_ORDER_APIS) public void setZOrderMediaOverlay(boolean isMediaOverlay) { mRequestedSubLayer = isMediaOverlay ? APPLICATION_MEDIA_OVERLAY_SUBLAYER : APPLICATION_MEDIA_SUBLAYER; @@ -834,7 +840,12 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall * <p>Calling this overrides any previous call to {@link #setZOrderMediaOverlay}. * * @param onTop Whether to show the surface on top of this view's window. + * + * @deprecated Use {@link #setCompositionOrder(int)} instead. It provides more + * control over the Z ordering behavior. */ + @Deprecated + @FlaggedApi(FLAG_DEPRECATE_SURFACE_VIEW_Z_ORDER_APIS) public void setZOrderOnTop(boolean onTop) { // In R and above we allow dynamic layer changes. final boolean allowDynamicChange = getContext().getApplicationInfo().targetSdkVersion @@ -866,7 +877,11 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall * @return Whether the Z ordering changed. * * @hide + * + * @deprecated Use {@link #setCompositionOrder(int)} instead. It provides more control + * over the Z ordering behavior. */ + @Deprecated public boolean setZOrderedOnTop(boolean onTop, boolean allowDynamicChange) { final int subLayer; if (onTop) { diff --git a/core/java/android/view/flags/view_flags.aconfig b/core/java/android/view/flags/view_flags.aconfig index f6fdec94c332..d06f885638b6 100644 --- a/core/java/android/view/flags/view_flags.aconfig +++ b/core/java/android/view/flags/view_flags.aconfig @@ -129,6 +129,14 @@ flag { } flag { + name: "deprecate_surface_view_z_order_apis" + namespace: "window_surfaces" + description: "Deprecate SurfaceView z order control APIs." + bug: "341021569" + is_fixed_read_only: true +} + +flag { name: "use_refactored_round_scrollbar" namespace: "wear_frameworks" description: "Use refactored round scrollbar." |