From e7d697e19da37e7b7c8bb0ba8c8e19d8a036ac18 Mon Sep 17 00:00:00 2001 From: Mariia Sandrikova Date: Tue, 21 Feb 2023 12:12:18 +0000 Subject: Make WindowManager compat properties public. Bug: 263984287 Test: build and existing tests + CTS tests will be added later. Change-Id: I54e6d4e35397a1d533f097429f08c4a820c13c9e --- core/api/current.txt | 8 ++++++ core/java/android/view/WindowManager.java | 45 +++++++++++++++---------------- 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/core/api/current.txt b/core/api/current.txt index 443954b0cbb2..036d1c88945a 100644 --- a/core/api/current.txt +++ b/core/api/current.txt @@ -53903,6 +53903,14 @@ package android.view { method public void removeViewImmediate(android.view.View); field public static final String PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE = "android.window.PROPERTY_ACTIVITY_EMBEDDING_ALLOW_SYSTEM_OVERRIDE"; field public static final String PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED = "android.window.PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED"; + field public static final String PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION"; + field public static final String PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH"; + field public static final String PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE = "android.window.PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE"; + field public static final String PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE"; + field public static final String PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE"; + field public static final String PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_BOUNDS_APIS = "android.window.PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_BOUNDS_APIS"; + field public static final String PROPERTY_COMPAT_ENABLE_FAKE_FOCUS = "android.window.PROPERTY_COMPAT_ENABLE_FAKE_FOCUS"; + field public static final String PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION = "android.window.PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION"; } public static class WindowManager.BadTokenException extends java.lang.RuntimeException { diff --git a/core/java/android/view/WindowManager.java b/core/java/android/view/WindowManager.java index 35ed88fc420e..81e85a18576b 100644 --- a/core/java/android/view/WindowManager.java +++ b/core/java/android/view/WindowManager.java @@ -863,10 +863,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION = "android.window.PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION"; @@ -899,8 +897,6 @@ public interface WindowManager extends ViewManager { * android:value="false"/> * </application> * - * - * @hide */ // TODO(b/263984287): Make this public API. String PROPERTY_COMPAT_ALLOW_SANDBOXING_VIEW_BOUNDS_APIS = @@ -937,10 +933,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_COMPAT_ENABLE_FAKE_FOCUS = "android.window.PROPERTY_COMPAT_ENABLE_FAKE_FOCUS"; /** @@ -976,10 +970,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_FORCE_ROTATION"; @@ -1023,10 +1015,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH = "android.window.PROPERTY_CAMERA_COMPAT_ALLOW_REFRESH"; @@ -1073,17 +1063,28 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE = "android.window.PROPERTY_CAMERA_COMPAT_ENABLE_REFRESH_VIA_PAUSE"; /** * Application level {@link android.content.pm.PackageManager.Property PackageManager * .Property} for an app to inform the system that the app should be excluded from the - * compatibility override for orientation set by the device manufacturer. + * compatibility override for orientation set by the device manufacturer. When the orientation + * override is applied it can: + * + * + *

This property is different from {@link PROPERTY_COMPAT_IGNORE_REQUESTED_ORIENTATION} + * (which is used to avoid orientation loops caused by the incorrect use of {@link + * android.app.Activity#setRequestedOrientation}) because this property overrides the app to an + * orientation selected by the device manufacturer rather than ignoring one of orientation + * requests coming from the app while respecting the previous one. * *

With this property set to {@code true} or unset, device manufacturers can override * orientation for the app using their discretion to improve display compatibility. @@ -1099,10 +1100,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_ORIENTATION_OVERRIDE"; @@ -1144,10 +1143,8 @@ public interface WindowManager extends ViewManager { * android:value="true|false"/> * </application> * - * - * @hide */ - // TODO(b/263984287): Make this public API. + // TODO(b/263984287): Add CTS tests. String PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE = "android.window.PROPERTY_COMPAT_ALLOW_DISPLAY_ORIENTATION_OVERRIDE"; -- cgit v1.2.3-59-g8ed1b