Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +12 −17 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ import com.android.wm.shell.draganddrop.DragAndDropController; import com.android.wm.shell.onehanded.OneHandedController; import com.android.wm.shell.onehanded.OneHandedTransitionCallback; import com.android.wm.shell.pip.PinnedStackListenerForwarder; import com.android.wm.shell.sysui.ConfigurationChangeListener; import com.android.wm.shell.sysui.ShellController; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -119,7 +121,7 @@ import java.util.function.IntConsumer; * * The controller manages addition, removal, and visible state of bubbles on screen. */ public class BubbleController { public class BubbleController implements ConfigurationChangeListener { private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleController" : TAG_BUBBLES; Loading Loading @@ -155,6 +157,7 @@ public class BubbleController { private final DisplayController mDisplayController; private final TaskViewTransitions mTaskViewTransitions; private final SyncTransactionQueue mSyncQueue; private final ShellController mShellController; // Used to post to main UI thread private final ShellExecutor mMainExecutor; Loading Loading @@ -224,6 +227,7 @@ public class BubbleController { public BubbleController(Context context, ShellController shellController, BubbleData data, @Nullable BubbleStackView.SurfaceSynchronizer synchronizer, FloatingContentCoordinator floatingContentCoordinator, Loading @@ -246,6 +250,7 @@ public class BubbleController { TaskViewTransitions taskViewTransitions, SyncTransactionQueue syncQueue) { mContext = context; mShellController = shellController; mLauncherApps = launcherApps; mBarService = statusBarService == null ? IStatusBarService.Stub.asInterface( Loading Loading @@ -414,6 +419,8 @@ public class BubbleController { // Clear out any persisted bubbles on disk that no longer have a valid user. List<UserInfo> users = mUserManager.getAliveUsers(); mDataRepository.sanitizeBubbles(users); mShellController.addConfigurationChangeListener(this); } @VisibleForTesting Loading Loading @@ -798,7 +805,8 @@ public class BubbleController { mSavedBubbleKeysPerUser.remove(userId); } private void updateForThemeChanges() { @Override public void onThemeChanged() { if (mStackView != null) { mStackView.onThemeChanged(); } Loading @@ -818,7 +826,8 @@ public class BubbleController { } } private void onConfigChanged(Configuration newConfig) { @Override public void onConfigurationChanged(Configuration newConfig) { if (mBubblePositioner != null) { mBubblePositioner.update(); } Loading Loading @@ -1677,13 +1686,6 @@ public class BubbleController { }); } @Override public void updateForThemeChanges() { mMainExecutor.execute(() -> { BubbleController.this.updateForThemeChanges(); }); } @Override public void expandStackAndSelectBubble(BubbleEntry entry) { mMainExecutor.execute(() -> { Loading Loading @@ -1822,13 +1824,6 @@ public class BubbleController { }); } @Override public void onConfigChanged(Configuration newConfig) { mMainExecutor.execute(() -> { BubbleController.this.onConfigChanged(newConfig); }); } @Override public void onNotificationPanelExpandedChanged(boolean expanded) { mMainExecutor.execute( Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +0 −10 Original line number Diff line number Diff line Loading @@ -107,9 +107,6 @@ public interface Bubbles { /** Tell the stack of bubbles to collapse. */ void collapseStack(); /** Tell the controller need update its UI to fit theme. */ void updateForThemeChanges(); /** * Request the stack expand if needed, then select the specified Bubble as current. * If no bubble exists for this entry, one is created. Loading Loading @@ -255,13 +252,6 @@ public interface Bubbles { */ void onUserRemoved(int removedUserId); /** * Called when config changed. * * @param newConfig the new config. */ void onConfigChanged(Configuration newConfig); /** Description of current bubble state. */ void dump(PrintWriter pw, String[] args); Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/TvPipModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.wm.shell.pip.tv.TvPipNotificationController; import com.android.wm.shell.pip.tv.TvPipTaskOrganizer; import com.android.wm.shell.pip.tv.TvPipTransition; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.transition.Transitions; import java.util.Optional; Loading @@ -64,6 +65,7 @@ public abstract class TvPipModule { @Provides static Optional<Pip> providePip( Context context, ShellController shellController, TvPipBoundsState tvPipBoundsState, TvPipBoundsAlgorithm tvPipBoundsAlgorithm, TvPipBoundsController tvPipBoundsController, Loading @@ -81,6 +83,7 @@ public abstract class TvPipModule { return Optional.of( TvPipController.create( context, shellController, tvPipBoundsState, tvPipBoundsAlgorithm, tvPipBoundsController, Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +29 −6 Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ import com.android.wm.shell.startingsurface.StartingSurface; import com.android.wm.shell.startingsurface.StartingWindowController; import com.android.wm.shell.startingsurface.StartingWindowTypeAlgorithm; import com.android.wm.shell.startingsurface.phone.PhoneStartingWindowTypeAlgorithm; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInterface; import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelper; import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelperController; import com.android.wm.shell.transition.ShellTransitions; Loading Loading @@ -160,10 +162,13 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static DragAndDropController provideDragAndDropController(Context context, DisplayController displayController, UiEventLogger uiEventLogger, IconProvider iconProvider, @ShellMainThread ShellExecutor mainExecutor) { return new DragAndDropController(context, displayController, uiEventLogger, iconProvider, mainExecutor); ShellController shellController, DisplayController displayController, UiEventLogger uiEventLogger, IconProvider iconProvider, @ShellMainThread ShellExecutor mainExecutor) { return new DragAndDropController(context, shellController, displayController, uiEventLogger, iconProvider, mainExecutor); } @WMSingleton Loading Loading @@ -378,9 +383,11 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static Optional<HideDisplayCutoutController> provideHideDisplayCutoutController(Context context, DisplayController displayController, @ShellMainThread ShellExecutor mainExecutor) { ShellController shellController, DisplayController displayController, @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable( HideDisplayCutoutController.create(context, displayController, mainExecutor)); HideDisplayCutoutController.create(context, shellController, displayController, mainExecutor)); } // Loading Loading @@ -634,6 +641,22 @@ public abstract class WMShellBaseModule { return Optional.of(new ActivityEmbeddingController(context, transitions)); } // // SysUI -> Shell interface // @WMSingleton @Provides static ShellInterface provideShellSysuiCallbacks(ShellController shellController) { return shellController.asShell(); } @WMSingleton @Provides static ShellController provideShellController(@ShellMainThread ShellExecutor mainExecutor) { return new ShellController(mainExecutor); } // // Misc // Loading libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +10 −5 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.wm.shell.pip.phone.PipMotionHelper; import com.android.wm.shell.pip.phone.PipTouchHandler; import com.android.wm.shell.recents.RecentTasksController; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.unfold.ShellUnfoldProgressProvider; import com.android.wm.shell.unfold.UnfoldAnimationController; Loading Loading @@ -134,6 +135,7 @@ public abstract class WMShellModule { @WMSingleton @Provides static BubbleController provideBubbleController(Context context, ShellController shellController, BubbleData data, FloatingContentCoordinator floatingContentCoordinator, IStatusBarService statusBarService, Loading @@ -153,7 +155,7 @@ public abstract class WMShellModule { @ShellBackgroundThread ShellExecutor bgExecutor, TaskViewTransitions taskViewTransitions, SyncTransactionQueue syncQueue) { return new BubbleController(context, data, null /* synchronizer */, return new BubbleController(context, shellController, data, null /* synchronizer */, floatingContentCoordinator, new BubbleDataRepository(context, launcherApps, mainExecutor), statusBarService, windowManager, windowManagerShellWrapper, userManager, Loading Loading @@ -205,12 +207,14 @@ public abstract class WMShellModule { @Provides @DynamicOverride static OneHandedController provideOneHandedController(Context context, ShellController shellController, WindowManager windowManager, DisplayController displayController, DisplayLayout displayLayout, TaskStackListenerImpl taskStackListener, UiEventLogger uiEventLogger, InteractionJankMonitor jankMonitor, @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler) { return OneHandedController.create(context, windowManager, displayController, displayLayout, taskStackListener, jankMonitor, uiEventLogger, mainExecutor, mainHandler); return OneHandedController.create(context, shellController, windowManager, displayController, displayLayout, taskStackListener, jankMonitor, uiEventLogger, mainExecutor, mainHandler); } // Loading Loading @@ -242,7 +246,8 @@ public abstract class WMShellModule { @WMSingleton @Provides static Optional<Pip> providePip(Context context, DisplayController displayController, static Optional<Pip> providePip(Context context, ShellController shellController, DisplayController displayController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, PipBoundsState pipBoundsState, PipMotionHelper pipMotionHelper, PipMediaController pipMediaController, Loading @@ -254,7 +259,7 @@ public abstract class WMShellModule { PipParamsChangedForwarder pipParamsChangedForwarder, Optional<OneHandedController> oneHandedController, @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable(PipController.create(context, displayController, return Optional.ofNullable(PipController.create(context, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +12 −17 Original line number Diff line number Diff line Loading @@ -101,6 +101,8 @@ import com.android.wm.shell.draganddrop.DragAndDropController; import com.android.wm.shell.onehanded.OneHandedController; import com.android.wm.shell.onehanded.OneHandedTransitionCallback; import com.android.wm.shell.pip.PinnedStackListenerForwarder; import com.android.wm.shell.sysui.ConfigurationChangeListener; import com.android.wm.shell.sysui.ShellController; import java.io.PrintWriter; import java.util.ArrayList; Loading @@ -119,7 +121,7 @@ import java.util.function.IntConsumer; * * The controller manages addition, removal, and visible state of bubbles on screen. */ public class BubbleController { public class BubbleController implements ConfigurationChangeListener { private static final String TAG = TAG_WITH_CLASS_NAME ? "BubbleController" : TAG_BUBBLES; Loading Loading @@ -155,6 +157,7 @@ public class BubbleController { private final DisplayController mDisplayController; private final TaskViewTransitions mTaskViewTransitions; private final SyncTransactionQueue mSyncQueue; private final ShellController mShellController; // Used to post to main UI thread private final ShellExecutor mMainExecutor; Loading Loading @@ -224,6 +227,7 @@ public class BubbleController { public BubbleController(Context context, ShellController shellController, BubbleData data, @Nullable BubbleStackView.SurfaceSynchronizer synchronizer, FloatingContentCoordinator floatingContentCoordinator, Loading @@ -246,6 +250,7 @@ public class BubbleController { TaskViewTransitions taskViewTransitions, SyncTransactionQueue syncQueue) { mContext = context; mShellController = shellController; mLauncherApps = launcherApps; mBarService = statusBarService == null ? IStatusBarService.Stub.asInterface( Loading Loading @@ -414,6 +419,8 @@ public class BubbleController { // Clear out any persisted bubbles on disk that no longer have a valid user. List<UserInfo> users = mUserManager.getAliveUsers(); mDataRepository.sanitizeBubbles(users); mShellController.addConfigurationChangeListener(this); } @VisibleForTesting Loading Loading @@ -798,7 +805,8 @@ public class BubbleController { mSavedBubbleKeysPerUser.remove(userId); } private void updateForThemeChanges() { @Override public void onThemeChanged() { if (mStackView != null) { mStackView.onThemeChanged(); } Loading @@ -818,7 +826,8 @@ public class BubbleController { } } private void onConfigChanged(Configuration newConfig) { @Override public void onConfigurationChanged(Configuration newConfig) { if (mBubblePositioner != null) { mBubblePositioner.update(); } Loading Loading @@ -1677,13 +1686,6 @@ public class BubbleController { }); } @Override public void updateForThemeChanges() { mMainExecutor.execute(() -> { BubbleController.this.updateForThemeChanges(); }); } @Override public void expandStackAndSelectBubble(BubbleEntry entry) { mMainExecutor.execute(() -> { Loading Loading @@ -1822,13 +1824,6 @@ public class BubbleController { }); } @Override public void onConfigChanged(Configuration newConfig) { mMainExecutor.execute(() -> { BubbleController.this.onConfigChanged(newConfig); }); } @Override public void onNotificationPanelExpandedChanged(boolean expanded) { mMainExecutor.execute( Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +0 −10 Original line number Diff line number Diff line Loading @@ -107,9 +107,6 @@ public interface Bubbles { /** Tell the stack of bubbles to collapse. */ void collapseStack(); /** Tell the controller need update its UI to fit theme. */ void updateForThemeChanges(); /** * Request the stack expand if needed, then select the specified Bubble as current. * If no bubble exists for this entry, one is created. Loading Loading @@ -255,13 +252,6 @@ public interface Bubbles { */ void onUserRemoved(int removedUserId); /** * Called when config changed. * * @param newConfig the new config. */ void onConfigChanged(Configuration newConfig); /** Description of current bubble state. */ void dump(PrintWriter pw, String[] args); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/TvPipModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -48,6 +48,7 @@ import com.android.wm.shell.pip.tv.TvPipNotificationController; import com.android.wm.shell.pip.tv.TvPipTaskOrganizer; import com.android.wm.shell.pip.tv.TvPipTransition; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.transition.Transitions; import java.util.Optional; Loading @@ -64,6 +65,7 @@ public abstract class TvPipModule { @Provides static Optional<Pip> providePip( Context context, ShellController shellController, TvPipBoundsState tvPipBoundsState, TvPipBoundsAlgorithm tvPipBoundsAlgorithm, TvPipBoundsController tvPipBoundsController, Loading @@ -81,6 +83,7 @@ public abstract class TvPipModule { return Optional.of( TvPipController.create( context, shellController, tvPipBoundsState, tvPipBoundsAlgorithm, tvPipBoundsController, Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellBaseModule.java +29 −6 Original line number Diff line number Diff line Loading @@ -83,6 +83,8 @@ import com.android.wm.shell.startingsurface.StartingSurface; import com.android.wm.shell.startingsurface.StartingWindowController; import com.android.wm.shell.startingsurface.StartingWindowTypeAlgorithm; import com.android.wm.shell.startingsurface.phone.PhoneStartingWindowTypeAlgorithm; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.sysui.ShellInterface; import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelper; import com.android.wm.shell.tasksurfacehelper.TaskSurfaceHelperController; import com.android.wm.shell.transition.ShellTransitions; Loading Loading @@ -160,10 +162,13 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static DragAndDropController provideDragAndDropController(Context context, DisplayController displayController, UiEventLogger uiEventLogger, IconProvider iconProvider, @ShellMainThread ShellExecutor mainExecutor) { return new DragAndDropController(context, displayController, uiEventLogger, iconProvider, mainExecutor); ShellController shellController, DisplayController displayController, UiEventLogger uiEventLogger, IconProvider iconProvider, @ShellMainThread ShellExecutor mainExecutor) { return new DragAndDropController(context, shellController, displayController, uiEventLogger, iconProvider, mainExecutor); } @WMSingleton Loading Loading @@ -378,9 +383,11 @@ public abstract class WMShellBaseModule { @WMSingleton @Provides static Optional<HideDisplayCutoutController> provideHideDisplayCutoutController(Context context, DisplayController displayController, @ShellMainThread ShellExecutor mainExecutor) { ShellController shellController, DisplayController displayController, @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable( HideDisplayCutoutController.create(context, displayController, mainExecutor)); HideDisplayCutoutController.create(context, shellController, displayController, mainExecutor)); } // Loading Loading @@ -634,6 +641,22 @@ public abstract class WMShellBaseModule { return Optional.of(new ActivityEmbeddingController(context, transitions)); } // // SysUI -> Shell interface // @WMSingleton @Provides static ShellInterface provideShellSysuiCallbacks(ShellController shellController) { return shellController.asShell(); } @WMSingleton @Provides static ShellController provideShellController(@ShellMainThread ShellExecutor mainExecutor) { return new ShellController(mainExecutor); } // // Misc // Loading
libs/WindowManager/Shell/src/com/android/wm/shell/dagger/WMShellModule.java +10 −5 Original line number Diff line number Diff line Loading @@ -71,6 +71,7 @@ import com.android.wm.shell.pip.phone.PipMotionHelper; import com.android.wm.shell.pip.phone.PipTouchHandler; import com.android.wm.shell.recents.RecentTasksController; import com.android.wm.shell.splitscreen.SplitScreenController; import com.android.wm.shell.sysui.ShellController; import com.android.wm.shell.transition.Transitions; import com.android.wm.shell.unfold.ShellUnfoldProgressProvider; import com.android.wm.shell.unfold.UnfoldAnimationController; Loading Loading @@ -134,6 +135,7 @@ public abstract class WMShellModule { @WMSingleton @Provides static BubbleController provideBubbleController(Context context, ShellController shellController, BubbleData data, FloatingContentCoordinator floatingContentCoordinator, IStatusBarService statusBarService, Loading @@ -153,7 +155,7 @@ public abstract class WMShellModule { @ShellBackgroundThread ShellExecutor bgExecutor, TaskViewTransitions taskViewTransitions, SyncTransactionQueue syncQueue) { return new BubbleController(context, data, null /* synchronizer */, return new BubbleController(context, shellController, data, null /* synchronizer */, floatingContentCoordinator, new BubbleDataRepository(context, launcherApps, mainExecutor), statusBarService, windowManager, windowManagerShellWrapper, userManager, Loading Loading @@ -205,12 +207,14 @@ public abstract class WMShellModule { @Provides @DynamicOverride static OneHandedController provideOneHandedController(Context context, ShellController shellController, WindowManager windowManager, DisplayController displayController, DisplayLayout displayLayout, TaskStackListenerImpl taskStackListener, UiEventLogger uiEventLogger, InteractionJankMonitor jankMonitor, @ShellMainThread ShellExecutor mainExecutor, @ShellMainThread Handler mainHandler) { return OneHandedController.create(context, windowManager, displayController, displayLayout, taskStackListener, jankMonitor, uiEventLogger, mainExecutor, mainHandler); return OneHandedController.create(context, shellController, windowManager, displayController, displayLayout, taskStackListener, jankMonitor, uiEventLogger, mainExecutor, mainHandler); } // Loading Loading @@ -242,7 +246,8 @@ public abstract class WMShellModule { @WMSingleton @Provides static Optional<Pip> providePip(Context context, DisplayController displayController, static Optional<Pip> providePip(Context context, ShellController shellController, DisplayController displayController, PipAppOpsListener pipAppOpsListener, PipBoundsAlgorithm pipBoundsAlgorithm, PipKeepClearAlgorithm pipKeepClearAlgorithm, PipBoundsState pipBoundsState, PipMotionHelper pipMotionHelper, PipMediaController pipMediaController, Loading @@ -254,7 +259,7 @@ public abstract class WMShellModule { PipParamsChangedForwarder pipParamsChangedForwarder, Optional<OneHandedController> oneHandedController, @ShellMainThread ShellExecutor mainExecutor) { return Optional.ofNullable(PipController.create(context, displayController, return Optional.ofNullable(PipController.create(context, shellController, displayController, pipAppOpsListener, pipBoundsAlgorithm, pipKeepClearAlgorithm, pipBoundsState, pipMotionHelper, pipMediaController, phonePipMenuController, pipTaskOrganizer, pipTransitionState, Loading