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

Commit a6d1e207 authored by Greg Kaiser's avatar Greg Kaiser
Browse files

Revert "Decouple systemui shared componements from PipController..."

Revert "Decouple systemui shared componements from PipController..."

Revert submission 12500984-WM-Shell-PIP-migration-8

Reason for revert: Suspect for b/168701961
Reverted Changes:
Ib41f203f2:Decouple systemui shared componements from PipCont...
I4862508a6:Decouple systemui shared componements from PipCont...

Exempt-From-Owner-Approval: Revert to address a P0
Change-Id: I8ef9840610ec8dd8a65c14c617b7ba190cec277d
parent 2fd465d6
Loading
Loading
Loading
Loading
+26 −1
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.view.WindowManagerGlobal;

import com.android.systemui.shared.recents.view.AppTransitionAnimationSpecsFuture;
import com.android.systemui.shared.recents.view.RecentsTransition;
import com.android.systemui.shared.system.PinnedStackListenerForwarder.PinnedStackListener;

public class WindowManagerWrapper {

@@ -74,7 +75,7 @@ public class WindowManagerWrapper {
            WindowConfiguration.WINDOWING_MODE_FULLSCREEN;
    public static final int WINDOWING_MODE_MULTI_WINDOW =
            WindowConfiguration.WINDOWING_MODE_MULTI_WINDOW;

    public static final int WINDOWING_MODE_PINNED = WindowConfiguration.WINDOWING_MODE_PINNED;
    public static final int WINDOWING_MODE_SPLIT_SCREEN_PRIMARY =
            WindowConfiguration.WINDOWING_MODE_SPLIT_SCREEN_PRIMARY;
    public static final int WINDOWING_MODE_SPLIT_SCREEN_SECONDARY =
@@ -83,6 +84,13 @@ public class WindowManagerWrapper {

    private static final WindowManagerWrapper sInstance = new WindowManagerWrapper();

    /**
     * Forwarder to which we can add multiple pinned stack listeners. Each listener will receive
     * updates from the window manager service.
     */
    private PinnedStackListenerForwarder mPinnedStackListenerForwarder =
            new PinnedStackListenerForwarder();

    public static WindowManagerWrapper getInstance() {
        return sInstance;
    }
@@ -179,6 +187,23 @@ public class WindowManagerWrapper {
        return NAV_BAR_POS_INVALID;
    }

    /**
     * Adds a pinned stack listener, which will receive updates from the window manager service
     * along with any other pinned stack listeners that were added via this method.
     */
    public void addPinnedStackListener(PinnedStackListener listener) throws RemoteException {
        mPinnedStackListenerForwarder.addListener(listener);
        WindowManagerGlobal.getWindowManagerService().registerPinnedStackListener(
                DEFAULT_DISPLAY, mPinnedStackListenerForwarder);
    }

    /**
     * Removes a pinned stack listener.
     */
    public void removePinnedStackListener(PinnedStackListener listener) {
        mPinnedStackListenerForwarder.removeListener(listener);
    }

    /**
     * Mirrors a specified display. The SurfaceControl returned is the root of the mirrored
     * hierarchy.
+3 −3
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import static android.view.View.INVISIBLE;
import static android.view.View.VISIBLE;
import static android.view.WindowManager.LayoutParams.LAYOUT_IN_DISPLAY_CUTOUT_MODE_ALWAYS;

import static com.android.systemui.bubbles.BubbleDebugConfig.DEBUG_BUBBLE_CONTROLLER;
import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_BUBBLES;
import static com.android.systemui.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME;
import static com.android.systemui.statusbar.StatusBarState.SHADE;
@@ -90,6 +91,7 @@ import com.android.systemui.plugins.statusbar.StatusBarStateController;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.PinnedStackListenerForwarder;
import com.android.systemui.shared.system.TaskStackChangeListener;
import com.android.systemui.shared.system.WindowManagerWrapper;
import com.android.systemui.statusbar.FeatureFlags;
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
import com.android.systemui.statusbar.NotificationRemoveInterceptor;
@@ -113,7 +115,6 @@ import com.android.systemui.statusbar.phone.StatusBar;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.util.FloatingContentCoordinator;
import com.android.systemui.wmshell.WindowManagerShellWrapper;

import java.io.FileDescriptor;
import java.io.PrintWriter;
@@ -365,7 +366,6 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
            INotificationManager notificationManager,
            @Nullable IStatusBarService statusBarService,
            WindowManager windowManager,
            WindowManagerShellWrapper windowManagerShellWrapper,
            LauncherApps launcherApps) {
        dumpManager.registerDumpable(TAG, this);
        mContext = context;
@@ -441,7 +441,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
        ActivityManagerWrapper.getInstance().registerTaskStackListener(mTaskStackListener);

        try {
            windowManagerShellWrapper.addPinnedStackListener(new BubblesImeListener());
            WindowManagerWrapper.getInstance().addPinnedStackListener(new BubblesImeListener());
        } catch (RemoteException e) {
            e.printStackTrace();
        }
+0 −3
Original line number Diff line number Diff line
@@ -40,7 +40,6 @@ import com.android.systemui.statusbar.phone.ShadeController;
import com.android.systemui.statusbar.policy.ConfigurationController;
import com.android.systemui.statusbar.policy.ZenModeController;
import com.android.systemui.util.FloatingContentCoordinator;
import com.android.systemui.wmshell.WindowManagerShellWrapper;

import dagger.Module;
import dagger.Provides;
@@ -74,7 +73,6 @@ public interface BubbleModule {
            INotificationManager notifManager,
            IStatusBarService statusBarService,
            WindowManager windowManager,
            WindowManagerShellWrapper windowManagerShellWrapper,
            LauncherApps launcherApps) {
        return new BubbleController(
                context,
@@ -98,7 +96,6 @@ public interface BubbleModule {
                notifManager,
                statusBarService,
                windowManager,
                windowManagerShellWrapper,
                launcherApps);
    }
}
+0 −8
Original line number Diff line number Diff line
@@ -66,7 +66,6 @@ import com.android.systemui.shared.plugins.PluginManager;
import com.android.systemui.shared.plugins.PluginManagerImpl;
import com.android.systemui.shared.system.ActivityManagerWrapper;
import com.android.systemui.shared.system.DevicePolicyManagerWrapper;
import com.android.systemui.shared.system.WindowManagerWrapper;
import com.android.systemui.statusbar.CommandQueue;
import com.android.systemui.statusbar.NotificationRemoteInputManager;
import com.android.systemui.statusbar.phone.AutoHideController;
@@ -313,13 +312,6 @@ public class DependencyProvider {

    /** */
    @Provides
    public WindowManagerWrapper providesWindowManagerWrapper() {
        return WindowManagerWrapper.getInstance();
    }

    /** */
    @Provides
    @SysUISingleton
    public SystemActions providesSystemActions(Context context) {
        return new SystemActions(context);
    }
+22 −80
Original line number Diff line number Diff line
@@ -16,11 +16,9 @@

package com.android.systemui.pip;

import android.app.ActivityManager;
import android.content.ComponentName;
import android.content.res.Configuration;
import android.media.session.MediaController;

import com.android.systemui.pip.phone.PipTouchHandler;
import com.android.systemui.pip.tv.PipController;
import com.android.systemui.shared.recents.IPinnedStackAnimationListener;

@@ -30,6 +28,11 @@ import java.io.PrintWriter;
 * Interface to engage picture in picture feature.
 */
public interface Pip {
    /**
     * Called when showing Pip menu.
     */
    void showPictureInPictureMenu();

    /**
     * Registers {@link com.android.systemui.pip.tv.PipController.Listener} that gets called.
     * whenever receiving notification on changes in PIP.
@@ -49,14 +52,6 @@ public interface Pip {
    default void closePip() {
    }

    /**
     * Dump the current state and information if need.
     *
     * @param pw The stream to dump information to.
     */
    default void dump(PrintWriter pw) {
    }

    /**
     * Expand PIP, it's possible that specific request to activate the window via Alt-tab.
     */
@@ -69,11 +64,7 @@ public interface Pip {
     * @return The state of defined in PipController.
     */
    default int getPlaybackState() {
        return -1;
    }

    default PipTouchHandler getPipTouchHandler() {
        return null;
        return 0;
    }

    /**
@@ -104,61 +95,9 @@ public interface Pip {
    }

    /**
     * Called whenever an Activity is moved to the pinned stack from another stack.
     */
    default void onActivityPinned(String packageName) {
    }

    /**
     * Called whenever an Activity is moved from the pinned stack to another stack
     */
    default void onActivityUnpinned(ComponentName topActivity) {
    }

    /**
     * Called whenever IActivityManager.startActivity is called on an activity that is already
     * running, but the task is either brought to the front or a new Intent is delivered to it.
     *
     * @param task        information about the task the activity was relaunched into
     * @param clearedTask whether or not the launch activity also cleared the task as a part of
     *                    starting
     */
    default void onActivityRestartAttempt(ActivityManager.RunningTaskInfo task,
            boolean clearedTask) {
    }

    /**
     * Called when display size or font size of settings changed
     */
    default void onDensityOrFontScaleChanged() {
    }

    /**
     * Called when overlay package change invoked.
     */
    default void onOverlayChanged() {
    }

    /**
     * Registers the session listener for the current user.
     */
    default void registerSessionListenerForCurrentUser() {
    }

    /**
     * Called when SysUI state changed.
     *
     * @param isSysUiStateValid Is SysUI state valid or not.
     * @param flag Current SysUI state.
     */
    default void onSystemUiStateChanged(boolean isSysUiStateValid, int flag) {
    }

    /**
     * Called when task stack changed.
     * Called when configuration change invoked.
     */
    default void onTaskStackChanged() {
    }
    void onConfigurationChanged(Configuration newConfig);

    /**
     * Removes a {@link PipController.Listener} from PipController.
@@ -197,14 +136,6 @@ public interface Pip {
    default void setShelfHeight(boolean visible, int height) {
    }

    /**
     * Registers the pinned stack animation listener.
     *
     * @param listener The listener of pinned stack animation.
     */
    default void setPinnedStackAnimationListener(IPinnedStackAnimationListener listener) {
    }

    /**
     * Set the pinned stack with {@link PipAnimationController.AnimationType}
     *
@@ -214,9 +145,12 @@ public interface Pip {
    }

    /**
     * Called when showing Pip menu.
     * Registers the pinned stack animation listener.
     *
     * @param listener The listener of pinned stack animation.
     */
    void showPictureInPictureMenu();
    default void setPinnedStackAnimationListener(IPinnedStackAnimationListener listener) {
    }

    /**
     * Suspends resizing operation on the Pip until {@link #resumePipResizing} is called.
@@ -225,4 +159,12 @@ public interface Pip {
     */
    default void suspendPipResizing(int reason) {
    }

    /**
     * Dump the current state and information if need.
     *
     * @param pw The stream to dump information to.
     */
    default void dump(PrintWriter pw) {
    }
}
Loading