Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,8 @@ public class BubbleController { } } private void onStatusBarStateChanged(boolean isShade) { @VisibleForTesting public void onStatusBarStateChanged(boolean isShade) { mIsStatusBarShade = isShade; if (!mIsStatusBarShade) { collapseStack(); Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +30 −12 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import com.android.systemui.lowlightclock.LowLightClockController; import com.android.systemui.model.SysUiState; import com.android.systemui.navigationbar.NavigationBarComponent; import com.android.systemui.plugins.BcSmartspaceDataPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.recents.Recents; import com.android.systemui.screenshot.dagger.ScreenshotModule; import com.android.systemui.settings.dagger.SettingsModule; Loading @@ -72,6 +71,7 @@ import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.systemui.statusbar.policy.dagger.SmartRepliesInflationModule; import com.android.systemui.statusbar.policy.dagger.StatusBarPolicyModule; Loading Loading @@ -198,25 +198,43 @@ public abstract class SystemUIModule { static Optional<BubblesManager> provideBubblesManager(Context context, Optional<Bubbles> bubblesOptional, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, ShadeController shadeController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, NotificationVisibilityProvider visibilityProvider, NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, NotifPipelineFlags notifPipelineFlags, DumpManager dumpManager, NotifPipeline notifPipeline, SysUiState sysUiState, NotifPipelineFlags notifPipelineFlags, DumpManager dumpManager, @Main Executor sysuiMainExecutor) { return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, keyguardStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor)); interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor)); } @BindsOptionalOf Loading packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +27 −14 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static android.service.notification.NotificationListenerService.REASON_GR import static android.service.notification.NotificationStats.DISMISSAL_BUBBLE; import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.notification.NotificationEntryManager.UNDEFINED_DISMISS_REASON; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -61,7 +60,6 @@ import com.android.systemui.Dumpable; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.model.SysUiState; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShadeWindowController; Loading @@ -81,6 +79,7 @@ import com.android.systemui.statusbar.notification.collection.render.Notificatio import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleEntry; Loading Loading @@ -132,7 +131,7 @@ public class BubblesManager implements Dumpable { public static BubblesManager create(Context context, Optional<Bubbles> bubblesOptional, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, Loading @@ -150,13 +149,26 @@ public class BubblesManager implements Dumpable { DumpManager dumpManager, Executor sysuiMainExecutor) { if (bubblesOptional.isPresent()) { return new BubblesManager(context, bubblesOptional.get(), notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, return new BubblesManager(context, bubblesOptional.get(), notificationShadeWindowController, keyguardStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor); interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor); } else { return null; } Loading @@ -166,7 +178,7 @@ public class BubblesManager implements Dumpable { BubblesManager(Context context, Bubbles bubbles, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, Loading Loading @@ -210,11 +222,12 @@ public class BubblesManager implements Dumpable { dumpManager.registerDumpable(TAG, this); statusBarStateController.addCallback(new StatusBarStateController.StateListener() { keyguardStateController.addCallback(new KeyguardStateController.Callback() { @Override public void onStateChanged(int newState) { boolean isShade = newState == SHADE; bubbles.onStatusBarStateChanged(isShade); public void onKeyguardShowingChanged() { boolean isUnlockedShade = !keyguardStateController.isShowing() && !keyguardStateController.isOccluded(); bubbles.onStatusBarStateChanged(isUnlockedShade); } }); Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.ZenModeConfig; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -377,7 +378,7 @@ public class BubblesTest extends SysuiTestCase { mContext, mBubbleController.asBubbles(), mNotificationShadeWindowController, mStatusBarStateController, mock(KeyguardStateController.class), mShadeController, mConfigurationController, mStatusBarService, Loading Loading @@ -1427,6 +1428,23 @@ public class BubblesTest extends SysuiTestCase { assertStackCollapsed(); } @Test public void testOnStatusBarStateChanged() { mBubbleController.updateBubble(mBubbleEntry); mBubbleData.setExpanded(true); assertStackExpanded(); BubbleStackView stackView = mBubbleController.getStackView(); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); mBubbleController.onStatusBarStateChanged(false); assertStackCollapsed(); assertThat(stackView.getVisibility()).isEqualTo(View.INVISIBLE); mBubbleController.onStatusBarStateChanged(true); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); } /** Creates a bubble using the userId and package. */ private Bubble createBubble(int userId, String pkg) { final UserHandle userHandle = new UserHandle(userId); Loading packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.ZenModeConfig; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -342,7 +343,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { mContext, mBubbleController.asBubbles(), mNotificationShadeWindowController, mStatusBarStateController, mock(KeyguardStateController.class), mShadeController, mConfigurationController, mStatusBarService, Loading Loading @@ -1247,6 +1248,23 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { assertStackCollapsed(); } @Test public void testOnStatusBarStateChanged() { mBubbleController.updateBubble(mBubbleEntry); mBubbleData.setExpanded(true); assertStackExpanded(); BubbleStackView stackView = mBubbleController.getStackView(); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); mBubbleController.onStatusBarStateChanged(false); assertStackCollapsed(); assertThat(stackView.getVisibility()).isEqualTo(View.INVISIBLE); mBubbleController.onStatusBarStateChanged(true); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); } /** * Sets the bubble metadata flags for this entry. These flags are normally set by * NotificationManagerService when the notification is sent, however, these tests do not Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −1 Original line number Diff line number Diff line Loading @@ -530,7 +530,8 @@ public class BubbleController { } } private void onStatusBarStateChanged(boolean isShade) { @VisibleForTesting public void onStatusBarStateChanged(boolean isShade) { mIsStatusBarShade = isShade; if (!mIsStatusBarShade) { collapseStack(); Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +30 −12 Original line number Diff line number Diff line Loading @@ -45,7 +45,6 @@ import com.android.systemui.lowlightclock.LowLightClockController; import com.android.systemui.model.SysUiState; import com.android.systemui.navigationbar.NavigationBarComponent; import com.android.systemui.plugins.BcSmartspaceDataPlugin; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.recents.Recents; import com.android.systemui.screenshot.dagger.ScreenshotModule; import com.android.systemui.settings.dagger.SettingsModule; Loading @@ -72,6 +71,7 @@ import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.phone.dagger.CentralSurfacesComponent; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.systemui.statusbar.policy.dagger.SmartRepliesInflationModule; import com.android.systemui.statusbar.policy.dagger.StatusBarPolicyModule; Loading Loading @@ -198,25 +198,43 @@ public abstract class SystemUIModule { static Optional<BubblesManager> provideBubblesManager(Context context, Optional<Bubbles> bubblesOptional, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, ShadeController shadeController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, INotificationManager notificationManager, NotificationVisibilityProvider visibilityProvider, NotificationInterruptStateProvider interruptionStateProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, NotificationGroupManagerLegacy groupManager, NotificationEntryManager entryManager, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, NotifPipelineFlags notifPipelineFlags, DumpManager dumpManager, NotifPipeline notifPipeline, SysUiState sysUiState, NotifPipelineFlags notifPipelineFlags, DumpManager dumpManager, @Main Executor sysuiMainExecutor) { return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, return Optional.ofNullable(BubblesManager.create(context, bubblesOptional, notificationShadeWindowController, keyguardStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor)); interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor)); } @BindsOptionalOf Loading
packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +27 −14 Original line number Diff line number Diff line Loading @@ -28,7 +28,6 @@ import static android.service.notification.NotificationListenerService.REASON_GR import static android.service.notification.NotificationStats.DISMISSAL_BUBBLE; import static android.service.notification.NotificationStats.DISMISS_SENTIMENT_NEUTRAL; import static com.android.systemui.statusbar.StatusBarState.SHADE; import static com.android.systemui.statusbar.notification.NotificationEntryManager.UNDEFINED_DISMISS_REASON; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -61,7 +60,6 @@ import com.android.systemui.Dumpable; import com.android.systemui.dagger.SysUISingleton; import com.android.systemui.dump.DumpManager; import com.android.systemui.model.SysUiState; import com.android.systemui.plugins.statusbar.StatusBarStateController; import com.android.systemui.shared.system.QuickStepContract; import com.android.systemui.statusbar.NotificationLockscreenUserManager; import com.android.systemui.statusbar.NotificationShadeWindowController; Loading @@ -81,6 +79,7 @@ import com.android.systemui.statusbar.notification.collection.render.Notificatio import com.android.systemui.statusbar.notification.interruption.NotificationInterruptStateProvider; import com.android.systemui.statusbar.phone.ShadeController; import com.android.systemui.statusbar.policy.ConfigurationController; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleEntry; Loading Loading @@ -132,7 +131,7 @@ public class BubblesManager implements Dumpable { public static BubblesManager create(Context context, Optional<Bubbles> bubblesOptional, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, Loading @@ -150,13 +149,26 @@ public class BubblesManager implements Dumpable { DumpManager dumpManager, Executor sysuiMainExecutor) { if (bubblesOptional.isPresent()) { return new BubblesManager(context, bubblesOptional.get(), notificationShadeWindowController, statusBarStateController, shadeController, configurationController, statusBarService, notificationManager, return new BubblesManager(context, bubblesOptional.get(), notificationShadeWindowController, keyguardStateController, shadeController, configurationController, statusBarService, notificationManager, visibilityProvider, interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor); interruptionStateProvider, zenModeController, notifUserManager, groupManager, entryManager, notifCollection, notifPipeline, sysUiState, notifPipelineFlags, dumpManager, sysuiMainExecutor); } else { return null; } Loading @@ -166,7 +178,7 @@ public class BubblesManager implements Dumpable { BubblesManager(Context context, Bubbles bubbles, NotificationShadeWindowController notificationShadeWindowController, StatusBarStateController statusBarStateController, KeyguardStateController keyguardStateController, ShadeController shadeController, ConfigurationController configurationController, @Nullable IStatusBarService statusBarService, Loading Loading @@ -210,11 +222,12 @@ public class BubblesManager implements Dumpable { dumpManager.registerDumpable(TAG, this); statusBarStateController.addCallback(new StatusBarStateController.StateListener() { keyguardStateController.addCallback(new KeyguardStateController.Callback() { @Override public void onStateChanged(int newState) { boolean isShade = newState == SHADE; bubbles.onStatusBarStateChanged(isShade); public void onKeyguardShowingChanged() { boolean isUnlockedShade = !keyguardStateController.isShowing() && !keyguardStateController.isOccluded(); bubbles.onStatusBarStateChanged(isUnlockedShade); } }); Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/BubblesTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -70,6 +70,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.ZenModeConfig; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -377,7 +378,7 @@ public class BubblesTest extends SysuiTestCase { mContext, mBubbleController.asBubbles(), mNotificationShadeWindowController, mStatusBarStateController, mock(KeyguardStateController.class), mShadeController, mConfigurationController, mStatusBarService, Loading Loading @@ -1427,6 +1428,23 @@ public class BubblesTest extends SysuiTestCase { assertStackCollapsed(); } @Test public void testOnStatusBarStateChanged() { mBubbleController.updateBubble(mBubbleEntry); mBubbleData.setExpanded(true); assertStackExpanded(); BubbleStackView stackView = mBubbleController.getStackView(); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); mBubbleController.onStatusBarStateChanged(false); assertStackCollapsed(); assertThat(stackView.getVisibility()).isEqualTo(View.INVISIBLE); mBubbleController.onStatusBarStateChanged(true); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); } /** Creates a bubble using the userId and package. */ private Bubble createBubble(int userId, String pkg) { final UserHandle userHandle = new UserHandle(userId); Loading
packages/SystemUI/tests/src/com/android/systemui/wmshell/NewNotifPipelineBubblesTest.java +19 −1 Original line number Diff line number Diff line Loading @@ -59,6 +59,7 @@ import android.service.notification.NotificationListenerService; import android.service.notification.ZenModeConfig; import android.testing.AndroidTestingRunner; import android.testing.TestableLooper; import android.view.View; import android.view.WindowManager; import androidx.test.filters.SmallTest; Loading Loading @@ -342,7 +343,7 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { mContext, mBubbleController.asBubbles(), mNotificationShadeWindowController, mStatusBarStateController, mock(KeyguardStateController.class), mShadeController, mConfigurationController, mStatusBarService, Loading Loading @@ -1247,6 +1248,23 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase { assertStackCollapsed(); } @Test public void testOnStatusBarStateChanged() { mBubbleController.updateBubble(mBubbleEntry); mBubbleData.setExpanded(true); assertStackExpanded(); BubbleStackView stackView = mBubbleController.getStackView(); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); mBubbleController.onStatusBarStateChanged(false); assertStackCollapsed(); assertThat(stackView.getVisibility()).isEqualTo(View.INVISIBLE); mBubbleController.onStatusBarStateChanged(true); assertThat(stackView.getVisibility()).isEqualTo(View.VISIBLE); } /** * Sets the bubble metadata flags for this entry. These flags are normally set by * NotificationManagerService when the notification is sent, however, these tests do not Loading