Loading core/java/android/app/ActivityManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -647,6 +647,16 @@ public class ActivityManager { return stackId != PINNED_STACK_ID && stackId != FREEFORM_WORKSPACE_STACK_ID && stackId != DOCKED_STACK_ID; } /** * Returns true if the input stack id should only be present on a device that supports * multi-window mode. * @see android.app.ActivityManager#supportsMultiWindow */ public static boolean isMultiWindowStack(int stackId) { return isStaticStack(stackId) || stackId == PINNED_STACK_ID || stackId == FREEFORM_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID; } } /** Loading Loading @@ -867,6 +877,17 @@ public class ActivityManager { return getMaxRecentTasksStatic() / 2; } /** * Returns true if the system supports at least one form of multi-window. * E.g. freeform, split-screen, picture-in-picture. * @hide */ static public boolean supportsMultiWindow() { return !isLowRamDeviceStatic() && Resources.getSystem().getBoolean( com.android.internal.R.bool.config_supportsMultiWindow); } /** * Information you can set and retrieve about the current activity within the recent task list. */ Loading core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -2479,4 +2479,8 @@ handle wallpaper cropping. --> <string name="config_wallpaperCropperPackage" translatable="false">com.android.wallpapercropper</string> <!-- True if the device supports at least one form of multi-window. E.g. freeform, split-screen, picture-in-picture. --> <bool name="config_supportsMultiWindow">true</bool> </resources> core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,7 @@ <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" /> <java-symbol type="bool" name="config_freeformWindowManagement" /> <java-symbol type="bool" name="config_supportsMultiWindow" /> <java-symbol type="bool" name="config_guestUserEphemeral" /> <java-symbol type="string" name="config_defaultPictureInPictureBounds" /> <java-symbol type="string" name="config_centeredPictureInPictureBounds" /> Loading services/core/java/com/android/server/am/ActivityManagerService.java +11 −2 Original line number Diff line number Diff line Loading @@ -1294,6 +1294,7 @@ public final class ActivityManagerService extends ActivityManagerNative boolean mAlwaysFinishActivities = false; boolean mLenientBackgroundCheck = false; boolean mForceResizableActivities; boolean mSupportsMultiWindow; boolean mSupportsFreeformWindowManagement; boolean mSupportsPictureInPicture; Rect mDefaultPinnedStackBounds; Loading Loading @@ -12371,6 +12372,7 @@ public final class ActivityManagerService extends ActivityManagerNative final boolean supportsPictureInPicture = mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE); final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow(); final String debugApp = Settings.Global.getString(resolver, DEBUG_APP); final boolean waitForDebugger = Settings.Global.getInt(resolver, WAIT_FOR_DEBUGGER, 0) != 0; final boolean alwaysFinishActivities = Loading @@ -12397,8 +12399,15 @@ public final class ActivityManagerService extends ActivityManagerNative mLenientBackgroundCheck = lenientBackgroundCheck; mForceResizableActivities = forceResizable; mWindowManager.setForceResizableTasks(mForceResizableActivities); if (supportsMultiWindow || forceResizable) { mSupportsMultiWindow = true; mSupportsFreeformWindowManagement = freeformWindowManagement || forceResizable; mSupportsPictureInPicture = supportsPictureInPicture || forceResizable; } else { mSupportsMultiWindow = false; mSupportsFreeformWindowManagement = false; mSupportsPictureInPicture = false; } // This happens before any activities are started, so we can // change mConfiguration in-place. updateConfigurationLocked(configuration, null, true); services/core/java/com/android/server/am/ActivityStackSupervisor.java +6 −2 Original line number Diff line number Diff line Loading @@ -2174,6 +2174,12 @@ public final class ActivityStackSupervisor implements DisplayListener { */ ActivityStack moveTaskToStackUncheckedLocked( TaskRecord task, int stackId, boolean toTop, boolean forceFocus, String reason) { if (StackId.isMultiWindowStack(stackId) && !mService.mSupportsMultiWindow) { throw new IllegalStateException("moveTaskToStackUncheckedLocked: Device doesn't " + "support multi-window task=" + task + " to stackId=" + stackId); } final ActivityRecord r = task.getTopActivity(); final ActivityStack prevStack = task.stack; final boolean wasFocused = isFocusedStack(prevStack) && (topRunningActivityLocked() == r); Loading @@ -2184,8 +2190,6 @@ public final class ActivityStackSupervisor implements DisplayListener { final boolean wasFront = isFrontStack(prevStack) && (prevStack.topRunningActivityLocked() == r); final int resizeMode = task.mResizeMode; if (stackId == DOCKED_STACK_ID && !task.isResizeable()) { // We don't allow moving a unresizeable task to the docked stack since the docked // stack is used for split-screen mode and will cause things like the docked divider to Loading Loading
core/java/android/app/ActivityManager.java +21 −0 Original line number Diff line number Diff line Loading @@ -647,6 +647,16 @@ public class ActivityManager { return stackId != PINNED_STACK_ID && stackId != FREEFORM_WORKSPACE_STACK_ID && stackId != DOCKED_STACK_ID; } /** * Returns true if the input stack id should only be present on a device that supports * multi-window mode. * @see android.app.ActivityManager#supportsMultiWindow */ public static boolean isMultiWindowStack(int stackId) { return isStaticStack(stackId) || stackId == PINNED_STACK_ID || stackId == FREEFORM_WORKSPACE_STACK_ID || stackId == DOCKED_STACK_ID; } } /** Loading Loading @@ -867,6 +877,17 @@ public class ActivityManager { return getMaxRecentTasksStatic() / 2; } /** * Returns true if the system supports at least one form of multi-window. * E.g. freeform, split-screen, picture-in-picture. * @hide */ static public boolean supportsMultiWindow() { return !isLowRamDeviceStatic() && Resources.getSystem().getBoolean( com.android.internal.R.bool.config_supportsMultiWindow); } /** * Information you can set and retrieve about the current activity within the recent task list. */ Loading
core/res/res/values/config.xml +4 −0 Original line number Diff line number Diff line Loading @@ -2479,4 +2479,8 @@ handle wallpaper cropping. --> <string name="config_wallpaperCropperPackage" translatable="false">com.android.wallpapercropper</string> <!-- True if the device supports at least one form of multi-window. E.g. freeform, split-screen, picture-in-picture. --> <bool name="config_supportsMultiWindow">true</bool> </resources>
core/res/res/values/symbols.xml +1 −0 Original line number Diff line number Diff line Loading @@ -303,6 +303,7 @@ <java-symbol type="bool" name="config_supportSpeakerNearUltrasound" /> <java-symbol type="bool" name="config_supportAudioSourceUnprocessed" /> <java-symbol type="bool" name="config_freeformWindowManagement" /> <java-symbol type="bool" name="config_supportsMultiWindow" /> <java-symbol type="bool" name="config_guestUserEphemeral" /> <java-symbol type="string" name="config_defaultPictureInPictureBounds" /> <java-symbol type="string" name="config_centeredPictureInPictureBounds" /> Loading
services/core/java/com/android/server/am/ActivityManagerService.java +11 −2 Original line number Diff line number Diff line Loading @@ -1294,6 +1294,7 @@ public final class ActivityManagerService extends ActivityManagerNative boolean mAlwaysFinishActivities = false; boolean mLenientBackgroundCheck = false; boolean mForceResizableActivities; boolean mSupportsMultiWindow; boolean mSupportsFreeformWindowManagement; boolean mSupportsPictureInPicture; Rect mDefaultPinnedStackBounds; Loading Loading @@ -12371,6 +12372,7 @@ public final class ActivityManagerService extends ActivityManagerNative final boolean supportsPictureInPicture = mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE); final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow(); final String debugApp = Settings.Global.getString(resolver, DEBUG_APP); final boolean waitForDebugger = Settings.Global.getInt(resolver, WAIT_FOR_DEBUGGER, 0) != 0; final boolean alwaysFinishActivities = Loading @@ -12397,8 +12399,15 @@ public final class ActivityManagerService extends ActivityManagerNative mLenientBackgroundCheck = lenientBackgroundCheck; mForceResizableActivities = forceResizable; mWindowManager.setForceResizableTasks(mForceResizableActivities); if (supportsMultiWindow || forceResizable) { mSupportsMultiWindow = true; mSupportsFreeformWindowManagement = freeformWindowManagement || forceResizable; mSupportsPictureInPicture = supportsPictureInPicture || forceResizable; } else { mSupportsMultiWindow = false; mSupportsFreeformWindowManagement = false; mSupportsPictureInPicture = false; } // This happens before any activities are started, so we can // change mConfiguration in-place. updateConfigurationLocked(configuration, null, true);
services/core/java/com/android/server/am/ActivityStackSupervisor.java +6 −2 Original line number Diff line number Diff line Loading @@ -2174,6 +2174,12 @@ public final class ActivityStackSupervisor implements DisplayListener { */ ActivityStack moveTaskToStackUncheckedLocked( TaskRecord task, int stackId, boolean toTop, boolean forceFocus, String reason) { if (StackId.isMultiWindowStack(stackId) && !mService.mSupportsMultiWindow) { throw new IllegalStateException("moveTaskToStackUncheckedLocked: Device doesn't " + "support multi-window task=" + task + " to stackId=" + stackId); } final ActivityRecord r = task.getTopActivity(); final ActivityStack prevStack = task.stack; final boolean wasFocused = isFocusedStack(prevStack) && (topRunningActivityLocked() == r); Loading @@ -2184,8 +2190,6 @@ public final class ActivityStackSupervisor implements DisplayListener { final boolean wasFront = isFrontStack(prevStack) && (prevStack.topRunningActivityLocked() == r); final int resizeMode = task.mResizeMode; if (stackId == DOCKED_STACK_ID && !task.isResizeable()) { // We don't allow moving a unresizeable task to the docked stack since the docked // stack is used for split-screen mode and will cause things like the docked divider to Loading