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

Commit d99ba757 authored by Tony Huang's avatar Tony Huang
Browse files

Clean up the legacy split screen (8/n)

Remove remaing using of legacy split on SysUi and
wm-shell(not include legacy split screen packages).

Bug: 199236198
Test: pass exising tests
Change-Id: Iaf0bb6da51fce7dbcf4e9b262540628497fd2ba7
parent 1a6203e0
Loading
Loading
Loading
Loading
+1 −6
Original line number Diff line number Diff line
@@ -18,7 +18,6 @@ package com.android.wm.shell.pip;

import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_PINNED;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_UNDEFINED;
import static android.util.RotationUtils.deltaRotation;
import static android.util.RotationUtils.rotateBounds;
@@ -438,11 +437,7 @@ public class PipTaskOrganizer implements ShellTaskOrganizer.TaskListener,
            tx.setWindowCrop(mLeash, destinationBounds.width(), destinationBounds.height());
            // We set to fullscreen here for now, but later it will be set to UNDEFINED for
            // the proper windowing mode to take place. See #applyWindowingModeChangeOnExit.
            wct.setActivityWindowingMode(mToken,
                    direction == TRANSITION_DIRECTION_LEAVE_PIP_TO_SPLIT_SCREEN
                            && !requestEnterSplit
                            ? WINDOWING_MODE_SPLIT_SCREEN_SECONDARY
                            : WINDOWING_MODE_FULLSCREEN);
            wct.setActivityWindowingMode(mToken, WINDOWING_MODE_FULLSCREEN);
            wct.setBounds(mToken, destinationBounds);
            wct.setBoundsChangeTransaction(mToken, tx);
        }
+2 −16
Original line number Diff line number Diff line
@@ -17,36 +17,22 @@
package com.android.systemui.shared.system;

import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;

import android.app.ActivityOptions;
import android.content.Context;
import android.os.Handler;

import com.android.systemui.shared.recents.model.Task;

/**
 * Wrapper around internal ActivityOptions creation.
 */
public abstract class ActivityOptionsCompat {

    /**
     * @Deprecated
     * @return ActivityOptions for starting a task in split screen as the primary window.
     */
    public static ActivityOptions makeSplitScreenOptions(boolean dockTopLeft) {
        return makeSplitScreenOptions(dockTopLeft, true);
    }

    /**
     * @return ActivityOptions for starting a task in split screen.
     */
    public static ActivityOptions makeSplitScreenOptions(boolean dockTopLeft, boolean isPrimary) {
        final ActivityOptions options = ActivityOptions.makeBasic();
        options.setLaunchWindowingMode(isPrimary
                ? WINDOWING_MODE_SPLIT_SCREEN_PRIMARY
                : WINDOWING_MODE_SPLIT_SCREEN_SECONDARY);
        return options;
        return ActivityOptions.makeBasic();
    }

    /**
+0 −4
Original line number Diff line number Diff line
@@ -78,10 +78,6 @@ public class WindowManagerWrapper {
    public static final int WINDOWING_MODE_MULTI_WINDOW =
            WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;

    public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY =
            WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
    public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY =
            WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_SECONDARY;
    public static final int WINDOWING_MODE_FREEFORM = WindowConfiguration.WINDOWING_MODE_FREEFORM;

    public static final int ITYPE_EXTRA_NAVIGATION_BAR = InsetsState.ITYPE_EXTRA_NAVIGATION_BAR;
+0 −21
Original line number Diff line number Diff line
@@ -16,11 +16,9 @@

package com.android.systemui.statusbar.notification;

import static android.app.WindowConfiguration.ACTIVITY_TYPE_UNDEFINED;
import static android.app.WindowConfiguration.WINDOWING_MODE_FREEFORM;
import static android.app.WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
import static android.app.WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;
import static android.app.WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -181,25 +179,6 @@ public class InstantAppNotifier extends CoreStartable
                });
    }

    /**
     * Posts an instant app notification if the top activity of the primary container in the
     * splitted screen is an instant app and the corresponding instant app notification is not
     * posted yet. If the notification already exists, this method removes it from {@code
     * notifs} in the arguments.
     */
    private void checkAndPostForPrimaryScreen(
            @NonNull ArraySet<Pair<String, Integer>> notifs,
            @NonNull NotificationManager noMan,
            @NonNull IPackageManager pm) {
        try {
            final RootTaskInfo info = ActivityTaskManager.getService().getRootTaskInfo(
                    WINDOWING_MODE_SPLIT_SCREEN_PRIMARY, ACTIVITY_TYPE_UNDEFINED);
            checkAndPostForStack(info, notifs, noMan, pm);
        } catch (RemoteException e) {
            e.rethrowFromSystemServer();
        }
    }

    /**
     * Posts an instant app notification if the top activity of the given stack is an instant app
     * and the corresponding instant app notification is not posted yet. If the notification already