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

Commit ba90d46a authored by Erik Wolsheimer's avatar Erik Wolsheimer Committed by android-build-merger
Browse files

Merge "Support multi-window on low-memory watches." into oc-dev

am: c6372cce

Change-Id: I77921a68a231dd3504f06a726af4f1b7903ac44d
parents 8002afb7 c6372cce
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1139,8 +1139,12 @@ public class ActivityManager {
     * E.g. freeform, split-screen, picture-in-picture.
     * @hide
     */
    static public boolean supportsMultiWindow() {
        return !isLowRamDeviceStatic()
    static public boolean supportsMultiWindow(Context context) {
        // On watches, multi-window is used to present essential system UI, and thus it must be
        // supported regardless of device memory characteristics.
        boolean isWatch = context.getPackageManager().hasSystemFeature(
                PackageManager.FEATURE_WATCH);
        return (!isLowRamDeviceStatic() || isWatch)
                && Resources.getSystem().getBoolean(
                    com.android.internal.R.bool.config_supportsMultiWindow);
    }
@@ -1149,8 +1153,8 @@ public class ActivityManager {
     * Returns true if the system supports split screen multi-window.
     * @hide
     */
    static public boolean supportsSplitScreenMultiWindow() {
        return supportsMultiWindow()
    static public boolean supportsSplitScreenMultiWindow(Context context) {
        return supportsMultiWindow(context)
                && Resources.getSystem().getBoolean(
                    com.android.internal.R.bool.config_supportsSplitScreenMultiWindow);
    }
+1 −1
Original line number Diff line number Diff line
@@ -138,7 +138,7 @@ public class RecentsViewTouchHandler {
        }

        mVisibleDockStates.clear();
        if (ActivityManager.supportsMultiWindow() && !ssp.hasDockedTask()
        if (ActivityManager.supportsMultiWindow(mRv.getContext()) && !ssp.hasDockedTask()
                && mDividerSnapAlgorithm.isSplitScreenFeasible()) {
            Recents.logDockAttempt(mRv.getContext(), event.task.getTopComponent(),
                    event.task.resizeMode);
+1 −1
Original line number Diff line number Diff line
@@ -59,7 +59,7 @@ public class TaskViewAccessibilityDelegate extends View.AccessibilityDelegate {
    @Override
    public void onInitializeAccessibilityNodeInfo(View host, AccessibilityNodeInfo info) {
        super.onInitializeAccessibilityNodeInfo(host, info);
        if (ActivityManager.supportsSplitScreenMultiWindow()
        if (ActivityManager.supportsSplitScreenMultiWindow(mTaskView.getContext())
                && !Recents.getSystemServices().hasDockedTask()) {
            TaskStack.DockState[] dockStates = Recents.getConfiguration()
                    .getDockStatesForCurrentOrientation();
+1 −1
Original line number Diff line number Diff line
@@ -545,7 +545,7 @@ public class NavigationBarFragment extends Fragment implements Callbacks {
    }

    private boolean onLongPressRecents() {
        if (mRecents == null || !ActivityManager.supportsMultiWindow()
        if (mRecents == null || !ActivityManager.supportsMultiWindow(getContext())
                || !mDivider.getView().getSnapAlgorithm().isSplitScreenFeasible()) {
            return false;
        }
+2 −2
Original line number Diff line number Diff line
@@ -13924,9 +13924,9 @@ public class ActivityManagerService extends IActivityManager.Stub
        final boolean supportsPictureInPicture =
                mContext.getPackageManager().hasSystemFeature(FEATURE_PICTURE_IN_PICTURE);
        final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow();
        final boolean supportsMultiWindow = ActivityManager.supportsMultiWindow(mContext);
        final boolean supportsSplitScreenMultiWindow =
                ActivityManager.supportsSplitScreenMultiWindow();
                ActivityManager.supportsSplitScreenMultiWindow(mContext);
        final boolean supportsMultiDisplay = mContext.getPackageManager()
                .hasSystemFeature(FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS);
        final String debugApp = Settings.Global.getString(resolver, DEBUG_APP);
Loading