Merge "Move system property for Window Extensions to WindowManager" into udc-dev

This commit is contained in:
TreeHugger Robot
2023-02-22 02:44:17 +00:00
committed by Android (Google) Code Review
4 changed files with 23 additions and 11 deletions

View File

@@ -3310,6 +3310,7 @@ package android.view {
public interface WindowManager extends android.view.ViewManager {
method public default int getDisplayImePolicy(int);
method public static boolean hasWindowExtensionsEnabled();
method public default void holdLock(android.os.IBinder, int);
method public default boolean isGlobalKey(int);
method public default boolean isTaskSnapshotSupported();

View File

@@ -108,6 +108,7 @@ import android.os.Bundle;
import android.os.IBinder;
import android.os.Parcel;
import android.os.Parcelable;
import android.os.SystemProperties;
import android.text.TextUtils;
import android.util.Log;
import android.util.proto.ProtoOutputStream;
@@ -1104,6 +1105,26 @@ public interface WindowManager extends ViewManager {
*/
public static final String PARCEL_KEY_SHORTCUTS_ARRAY = "shortcuts_array";
/**
* Whether the device supports the WindowManager Extensions.
* OEMs can enable this by having their device config to inherit window_extensions.mk, such as:
* <pre>
* $(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk)
* </pre>
* @hide
*/
boolean WINDOW_EXTENSIONS_ENABLED =
SystemProperties.getBoolean("persist.wm.extensions.enabled", false);
/**
* @see #WINDOW_EXTENSIONS_ENABLED
* @hide
*/
@TestApi
static boolean hasWindowExtensionsEnabled() {
return WINDOW_EXTENSIONS_ENABLED;
}
/**
* Application-level
* {@link android.content.pm.PackageManager.Property PackageManager.Property}

View File

@@ -2159,7 +2159,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
boolean appActivityEmbeddingEnabled = false;
try {
appActivityEmbeddingEnabled = WindowManagerService.sWindowExtensionsEnabled
appActivityEmbeddingEnabled = WindowManager.hasWindowExtensionsEnabled()
&& mAtmService.mContext.getPackageManager()
.getProperty(PROPERTY_ACTIVITY_EMBEDDING_SPLITS_ENABLED, packageName)
.getBoolean();

View File

@@ -443,16 +443,6 @@ public class WindowManagerService extends IWindowManager.Stub
static final boolean ENABLE_FIXED_ROTATION_TRANSFORM =
SystemProperties.getBoolean("persist.wm.fixed_rotation_transform", true);
/**
* Whether the device supports the WindowManager Extensions.
* OEMs can enable this by having their device config to inherit window_extensions.mk, such as:
* <pre>
* $(call inherit-product, $(SRC_TARGET_DIR)/product/window_extensions.mk)
* </pre>
*/
static final boolean sWindowExtensionsEnabled =
SystemProperties.getBoolean("persist.wm.extensions.enabled", false);
// Enums for animation scale update types.
@Retention(RetentionPolicy.SOURCE)
@IntDef({WINDOW_ANIMATION_SCALE, TRANSITION_ANIMATION_SCALE, ANIMATION_DURATION_SCALE})