Merge "Allow non-resizable apps in split-screen (5/n)" into sc-dev
This commit is contained in:
@@ -10511,18 +10511,6 @@ public final class Settings {
|
||||
public static final String DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS =
|
||||
"force_desktop_mode_on_external_displays";
|
||||
|
||||
/**
|
||||
* Whether to allow non-resizable apps to be freeform.
|
||||
*
|
||||
* TODO(b/176061101) remove after update all usages
|
||||
* @deprecated use {@link #DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW}
|
||||
* @hide
|
||||
*/
|
||||
@Deprecated
|
||||
@Readable
|
||||
public static final String DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM =
|
||||
"enable_sizecompat_freeform";
|
||||
|
||||
/**
|
||||
* Whether to allow non-resizable apps to be shown in multi-window. The app will be
|
||||
* letterboxed if the request orientation is not met, and will be shown in size-compat
|
||||
|
||||
@@ -282,7 +282,8 @@ message GlobalSettingsProto {
|
||||
optional SettingProto force_rtl = 4 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||
optional SettingProto emulate_display_cutout = 5 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||
optional SettingProto force_desktop_mode_on_external_displays = 6 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||
optional SettingProto enable_sizecompat_freeform = 7 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||
// Deprecated, use enable_non_resizable_multi_window
|
||||
optional SettingProto enable_sizecompat_freeform = 7 [ (android.privacy).dest = DEST_AUTOMATIC, deprecated = true ];
|
||||
optional SettingProto enable_non_resizable_multi_window = 8 [ (android.privacy).dest = DEST_AUTOMATIC ];
|
||||
}
|
||||
optional Development development = 39;
|
||||
|
||||
@@ -550,9 +550,6 @@ class SettingsProtoDumpUtil {
|
||||
dumpSetting(s, p,
|
||||
Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||
GlobalSettingsProto.Development.FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS);
|
||||
dumpSetting(s, p,
|
||||
Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM,
|
||||
GlobalSettingsProto.Development.ENABLE_SIZECOMPAT_FREEFORM);
|
||||
dumpSetting(s, p,
|
||||
Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW,
|
||||
GlobalSettingsProto.Development.ENABLE_NON_RESIZABLE_MULTI_WINDOW);
|
||||
|
||||
@@ -227,7 +227,6 @@ public class SettingsBackupTest {
|
||||
Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS,
|
||||
Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES,
|
||||
Settings.Global.DEVELOPMENT_FORCE_RTL,
|
||||
Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM,
|
||||
Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW,
|
||||
Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR,
|
||||
Settings.Global.DEVELOPMENT_USE_BLAST_ADAPTER_SV,
|
||||
|
||||
@@ -808,7 +808,7 @@ class ActivityClientController extends IActivityClientController.Stub {
|
||||
|
||||
if (rootTask.inFreeformWindowingMode()) {
|
||||
rootTask.setWindowingMode(WINDOWING_MODE_FULLSCREEN);
|
||||
} else if (!mService.mSizeCompatFreeform && r.inSizeCompatMode()) {
|
||||
} else if (!mService.mSupportsNonResizableMultiWindow && r.inSizeCompatMode()) {
|
||||
throw new IllegalStateException("Size-compat windows are currently not"
|
||||
+ "freeform-enabled");
|
||||
} else if (rootTask.getParent().inFreeformWindowingMode()) {
|
||||
|
||||
@@ -2562,9 +2562,7 @@ final class ActivityRecord extends WindowToken implements WindowManagerService.A
|
||||
* root task.
|
||||
*/
|
||||
boolean supportsFreeform() {
|
||||
return mAtmService.mSupportsFreeformWindowManagement
|
||||
// Either the activity is resizable, or we allow size compat in freeform.
|
||||
&& (supportsMultiWindow() || mAtmService.mSizeCompatFreeform);
|
||||
return mAtmService.mSupportsFreeformWindowManagement && supportsMultiWindow();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -58,7 +58,6 @@ import static android.os.Process.SYSTEM_UID;
|
||||
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RTL;
|
||||
import static android.provider.Settings.Global.HIDE_ERROR_DIALOGS;
|
||||
@@ -557,7 +556,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
boolean mSupportsPictureInPicture;
|
||||
boolean mSupportsMultiDisplay;
|
||||
boolean mForceResizableActivities;
|
||||
boolean mSizeCompatFreeform;
|
||||
boolean mSupportsNonResizableMultiWindow;
|
||||
|
||||
final List<ActivityTaskManagerInternal.ScreenObserver> mScreenObservers = new ArrayList<>();
|
||||
@@ -788,8 +786,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
final boolean forceRtl = Settings.Global.getInt(resolver, DEVELOPMENT_FORCE_RTL, 0) != 0;
|
||||
final boolean forceResizable = Settings.Global.getInt(
|
||||
resolver, DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES, 0) != 0;
|
||||
final boolean sizeCompatFreeform = Settings.Global.getInt(
|
||||
resolver, DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM, 0) != 0;
|
||||
final boolean supportsNonResizableMultiWindow = Settings.Global.getInt(
|
||||
resolver, DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW, 1) != 0;
|
||||
|
||||
@@ -805,7 +801,6 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
|
||||
|
||||
synchronized (mGlobalLock) {
|
||||
mForceResizableActivities = forceResizable;
|
||||
mSizeCompatFreeform = sizeCompatFreeform;
|
||||
mSupportsNonResizableMultiWindow = supportsNonResizableMultiWindow;
|
||||
final boolean multiWindowFormEnabled = freeformWindowManagement
|
||||
|| supportsSplitScreenMultiWindow
|
||||
|
||||
@@ -2841,8 +2841,6 @@ class Task extends WindowContainer<WindowContainer> {
|
||||
windowingMode != WINDOWING_MODE_UNDEFINED ? windowingMode : parentWindowingMode;
|
||||
if (WindowConfiguration.inMultiWindowMode(candidateWindowingMode)
|
||||
&& candidateWindowingMode != WINDOWING_MODE_PINNED
|
||||
&& (candidateWindowingMode != WINDOWING_MODE_FREEFORM
|
||||
|| !mTaskSupervisor.mService.mSizeCompatFreeform)
|
||||
&& !mTaskSupervisor.mService.mSupportsNonResizableMultiWindow) {
|
||||
getResolvedOverrideConfiguration().windowConfiguration.setWindowingMode(
|
||||
WINDOWING_MODE_FULLSCREEN);
|
||||
|
||||
@@ -572,8 +572,7 @@ class TaskLaunchParamsModifier implements LaunchParamsModifier {
|
||||
|
||||
private boolean shouldLaunchUnresizableAppInFreeform(ActivityRecord activity,
|
||||
TaskDisplayArea displayArea) {
|
||||
// TODO(176061101): Migrate |mSizeCompatFreeform| to |mSupportsNonResizableMultiWindow|.
|
||||
if (!mSupervisor.mService.mSizeCompatFreeform || activity.isResizeable()) {
|
||||
if (!mSupervisor.mService.mSupportsNonResizableMultiWindow || activity.isResizeable()) {
|
||||
return false;
|
||||
}
|
||||
final DisplayContent display = displayArea.getDisplayContent();
|
||||
|
||||
@@ -39,7 +39,6 @@ import static android.os.Process.myPid;
|
||||
import static android.os.Trace.TRACE_TAG_WINDOW_MANAGER;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_RENDER_SHADOWS_IN_COMPOSITOR;
|
||||
@@ -803,8 +802,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT);
|
||||
private final Uri mForceResizableUri = Settings.Global.getUriFor(
|
||||
DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES);
|
||||
private final Uri mSizeCompatFreeformUri = Settings.Global.getUriFor(
|
||||
DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM);
|
||||
private final Uri mSupportsNonResizableMultiWindowUri = Settings.Global.getUriFor(
|
||||
DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW);
|
||||
private final Uri mRenderShadowsInCompositorUri = Settings.Global.getUriFor(
|
||||
@@ -831,8 +828,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(mFreeformWindowUri, false, this, UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(mForceResizableUri, false, this, UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(mSizeCompatFreeformUri, false, this,
|
||||
UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(mSupportsNonResizableMultiWindowUri, false, this,
|
||||
UserHandle.USER_ALL);
|
||||
resolver.registerContentObserver(mRenderShadowsInCompositorUri, false, this,
|
||||
@@ -872,11 +867,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSizeCompatFreeformUri.equals(uri)) {
|
||||
updateSizeCompatFreeform();
|
||||
return;
|
||||
}
|
||||
|
||||
if (mSupportsNonResizableMultiWindowUri.equals(uri)) {
|
||||
updateSupportsNonResizableMultiWindow();
|
||||
return;
|
||||
@@ -974,14 +964,6 @@ public class WindowManagerService extends IWindowManager.Stub
|
||||
mAtmService.mForceResizableActivities = forceResizable;
|
||||
}
|
||||
|
||||
void updateSizeCompatFreeform() {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
final boolean sizeCompatFreeform = Settings.Global.getInt(resolver,
|
||||
DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM, 0) != 0;
|
||||
|
||||
mAtmService.mSizeCompatFreeform = sizeCompatFreeform;
|
||||
}
|
||||
|
||||
void updateSupportsNonResizableMultiWindow() {
|
||||
ContentResolver resolver = mContext.getContentResolver();
|
||||
final boolean supportsNonResizableMultiWindow = Settings.Global.getInt(resolver,
|
||||
|
||||
@@ -1965,17 +1965,17 @@ public class ActivityRecordTests extends WindowTestsBase {
|
||||
|
||||
// Non-resizable
|
||||
mAtm.mForceResizableActivities = false;
|
||||
mAtm.mSizeCompatFreeform = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = false;
|
||||
assertFalse(activity.supportsFreeform());
|
||||
|
||||
// Force resizable
|
||||
mAtm.mForceResizableActivities = true;
|
||||
mAtm.mSizeCompatFreeform = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = false;
|
||||
assertTrue(activity.supportsFreeform());
|
||||
|
||||
// Allow non-resizable
|
||||
mAtm.mForceResizableActivities = false;
|
||||
mAtm.mSizeCompatFreeform = true;
|
||||
mAtm.mSupportsNonResizableMultiWindow = true;
|
||||
assertTrue(activity.supportsFreeform());
|
||||
}
|
||||
|
||||
|
||||
@@ -661,7 +661,7 @@ public class TaskLaunchParamsModifierTests extends WindowTestsBase {
|
||||
|
||||
@Test
|
||||
public void testForceMaximizesUnresizeableApp() {
|
||||
mAtm.mSizeCompatFreeform = false;
|
||||
mAtm.mSupportsNonResizableMultiWindow = false;
|
||||
final TestDisplayContent freeformDisplay = createNewDisplayContent(
|
||||
WINDOWING_MODE_FREEFORM);
|
||||
|
||||
@@ -684,7 +684,7 @@ public class TaskLaunchParamsModifierTests extends WindowTestsBase {
|
||||
|
||||
@Test
|
||||
public void testLaunchesPortraitSizeCompatOnFreeformLandscapeDisplayWithFreeformSizeCompat() {
|
||||
mAtm.mSizeCompatFreeform = true;
|
||||
mAtm.mSupportsNonResizableMultiWindow = true;
|
||||
final TestDisplayContent freeformDisplay = createNewDisplayContent(
|
||||
WINDOWING_MODE_FREEFORM);
|
||||
|
||||
@@ -712,7 +712,7 @@ public class TaskLaunchParamsModifierTests extends WindowTestsBase {
|
||||
|
||||
@Test
|
||||
public void testLaunchesLandscapeSizeCompatOnFreeformLandscapeDisplayWithFreeformSizeCompat() {
|
||||
mAtm.mSizeCompatFreeform = true;
|
||||
mAtm.mSupportsNonResizableMultiWindow = true;
|
||||
final TestDisplayContent freeformDisplay = createNewDisplayContent(
|
||||
WINDOWING_MODE_FREEFORM);
|
||||
final ActivityOptions options = ActivityOptions.makeBasic();
|
||||
@@ -728,7 +728,7 @@ public class TaskLaunchParamsModifierTests extends WindowTestsBase {
|
||||
|
||||
@Test
|
||||
public void testLaunchesPortraitUnresizableOnFreeformDisplayWithFreeformSizeCompat() {
|
||||
mAtm.mSizeCompatFreeform = true;
|
||||
mAtm.mSupportsNonResizableMultiWindow = true;
|
||||
final TestDisplayContent freeformDisplay = createNewDisplayContent(
|
||||
WINDOWING_MODE_FREEFORM);
|
||||
final ActivityOptions options = ActivityOptions.makeBasic();
|
||||
|
||||
@@ -18,7 +18,6 @@ package com.android.server.wm;
|
||||
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_FREEFORM_WINDOWS_SUPPORT;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_NON_RESIZABLE_MULTI_WINDOW;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_DESKTOP_MODE_ON_EXTERNAL_DISPLAYS;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_FORCE_RESIZABLE_ACTIVITIES;
|
||||
import static android.provider.Settings.Global.DEVELOPMENT_WM_DISPLAY_SETTINGS_PATH;
|
||||
@@ -118,20 +117,6 @@ public class WindowManagerSettingsTests extends WindowTestsBase {
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testEnableSizeCompatFreeform() {
|
||||
try (BoolSettingsSession enableSizeCompatFreeformSession = new
|
||||
BoolSettingsSession(DEVELOPMENT_ENABLE_SIZECOMPAT_FREEFORM)) {
|
||||
final boolean enableSizeCompatFreeform =
|
||||
!enableSizeCompatFreeformSession.getSetting();
|
||||
final Uri enableSizeCompatFreeformUri =
|
||||
enableSizeCompatFreeformSession.setSetting(enableSizeCompatFreeform);
|
||||
mWm.mSettingsObserver.onChange(false, enableSizeCompatFreeformUri);
|
||||
|
||||
assertEquals(mWm.mAtmService.mSizeCompatFreeform, enableSizeCompatFreeform);
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testSupportsNonResizableMultiWindow() {
|
||||
try (BoolSettingsSession supportsNonResizableMultiWindowSession = new
|
||||
|
||||
Reference in New Issue
Block a user