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

Commit 0dc85ebd authored by Chris Li's avatar Chris Li
Browse files

Move system property for Window Extensions to WindowManager

So that it can be reference outside of the wm/ directory, and used in
CTS.

Bug: 235797785
Test: refactor only
Change-Id: I837ecf978bb42b7da45dd5afdc7d7de0b4d2914e
parent e06e067a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -3263,6 +3263,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();
+21 −0
Original line number Diff line number Diff line
@@ -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;
@@ -1103,6 +1104,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}
+1 −1
Original line number Diff line number Diff line
@@ -2149,7 +2149,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();
+0 −10
Original line number Diff line number Diff line
@@ -441,16 +441,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})