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

Commit c4e7722f authored by Hongwei Wang's avatar Hongwei Wang
Browse files

Migrate PiP2 flag to aconfig

Bug: 304838465
Test: m -j
Flag: ACONFIG com.android.wm.shell.enable_pip2_implementation DEVELOPMENT
Change-Id: I84dd3740915869ff913919b926110b4ae14dcb12
parent 831a9637
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -42,3 +42,11 @@ flag {
    description: "Enables PiP UI state callback on entering"
    bug: "303718131"
}

flag {
    name: "enable_pip2_implementation"
    namespace: "multitasking"
    description: "Enables the new implementation of PiP (PiP2)"
    bug: "290220798"
    is_fixed_read_only: true
}
+2 −3
Original line number Diff line number Diff line
@@ -21,13 +21,13 @@ import android.app.WindowConfiguration
import android.content.ComponentName
import android.content.Context
import android.os.RemoteException
import android.os.SystemProperties
import android.util.DisplayMetrics
import android.util.Log
import android.util.Pair
import android.util.TypedValue
import android.window.TaskSnapshot
import com.android.internal.protolog.common.ProtoLog
import com.android.wm.shell.Flags
import com.android.wm.shell.protolog.ShellProtoLogGroup
import kotlin.math.abs

@@ -37,7 +37,6 @@ object PipUtils {

    // Minimum difference between two floats (e.g. aspect ratios) to consider them not equal.
    private const val EPSILON = 1e-7
    private const val ENABLE_PIP2_IMPLEMENTATION = "persist.wm.debug.enable_pip2_implementation"

    /**
     * @return the ComponentName and user id of the top non-SystemUI activity in the pinned stack.
@@ -138,5 +137,5 @@ object PipUtils {

    @JvmStatic
    val isPip2ExperimentEnabled: Boolean
        get() = SystemProperties.getBoolean(ENABLE_PIP2_IMPLEMENTATION, false)
        get() = Flags.enablePip2Implementation()
}
 No newline at end of file
+0 −6
Original line number Diff line number Diff line
@@ -472,12 +472,6 @@ object Flags {
    val WALLPAPER_MULTI_CROP =
        sysPropBooleanFlag("persist.wm.debug.wallpaper_multi_crop", default = false)

    // TODO(b/290220798): Tracking Bug
    @Keep
    @JvmField
    val ENABLE_PIP2_IMPLEMENTATION =
        sysPropBooleanFlag("persist.wm.debug.enable_pip2_implementation", default = false)

    // 1200 - predictive back
    @Keep
    @JvmField
+2 −3
Original line number Diff line number Diff line
@@ -279,6 +279,7 @@ import com.android.server.statusbar.StatusBarManagerInternal;
import com.android.server.uri.NeededUriGrants;
import com.android.server.uri.UriGrantsManagerInternal;
import com.android.server.wallpaper.WallpaperManagerInternal;
import com.android.wm.shell.Flags;

import java.io.BufferedReader;
import java.io.File;
@@ -314,8 +315,6 @@ import java.util.Set;
public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
    private static final String GRAMMATICAL_GENDER_PROPERTY = "persist.sys.grammatical_gender";
    private static final String TAG = TAG_WITH_CLASS_NAME ? "ActivityTaskManagerService" : TAG_ATM;
    private static final String ENABLE_PIP2_IMPLEMENTATION =
            "persist.wm.debug.enable_pip2_implementation";
    static final String TAG_ROOT_TASK = TAG + POSTFIX_ROOT_TASK;
    static final String TAG_SWITCH = TAG + POSTFIX_SWITCH;

@@ -7251,6 +7250,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
    }

    static boolean isPip2ExperimentEnabled() {
        return SystemProperties.getBoolean(ENABLE_PIP2_IMPLEMENTATION, false);
        return Flags.enablePip2Implementation();
    }
}