Make sysprop for PiP2 flag persist
We are using a system property to easily
toggle the PiP2 flag during development.
However, the Core now caches the value
of the sysprop which means we have to do
adb reboot for flag change to take effect.
Hence the sysprop needs to be persistent.
Bug: 311462191
Test: adb shell setprop persist.wm_shell.pip2 1; adb reboot
Change-Id: Ia5ac78c1bdb41eaf28d7aaf727d17f3ff4225828
diff --git a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUtils.kt b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUtils.kt
index dba0a98..579a794 100644
--- a/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUtils.kt
+++ b/libs/WindowManager/Shell/src/com/android/wm/shell/common/pip/PipUtils.kt
@@ -152,7 +152,8 @@
"org.chromium.arc", 0)
val isTv = AppGlobals.getPackageManager().hasSystemFeature(
PackageManager.FEATURE_LEANBACK, 0)
- isPip2ExperimentEnabled = SystemProperties.getBoolean("wm_shell.pip2", false) ||
+ isPip2ExperimentEnabled = SystemProperties.getBoolean(
+ "persist.wm_shell.pip2", false) ||
(Flags.enablePip2Implementation() && !isArc && !isTv)
}
return isPip2ExperimentEnabled as Boolean
diff --git a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
index 237003a..3aa63af 100644
--- a/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
+++ b/services/core/java/com/android/server/wm/ActivityTaskManagerService.java
@@ -7418,7 +7418,8 @@
FEATURE_LEANBACK);
final boolean isArc = arcFeature != null && arcFeature.version >= 0;
final boolean isTv = tvFeature != null && tvFeature.version >= 0;
- sIsPip2ExperimentEnabled = SystemProperties.getBoolean("wm_shell.pip2", false)
+ sIsPip2ExperimentEnabled = SystemProperties.getBoolean(
+ "persist.wm_shell.pip2", false)
|| (Flags.enablePip2Implementation() && !isArc && !isTv);
}
return sIsPip2ExperimentEnabled;