Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +19 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,17 @@ public class BubbleController implements ConfigurationChangeListener, mDataRepository.removeBubblesForUser(removedUserId, parentUserId); } /** Called when sensitive notification state has changed */ public void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { if (mStackView != null) { mStackView.onSensitiveNotificationProtectionStateChanged( sensitiveNotificationProtectionActive); ProtoLog.d(WM_SHELL_BUBBLES, "onSensitiveNotificationProtectionStateChanged=%b", sensitiveNotificationProtectionActive); } } /** Whether bubbles are showing in the bubble bar. */ public boolean isShowingAsBubbleBar() { return canShowAsBubbleBar() && mBubbleStateListener != null; Loading Loading @@ -2583,6 +2594,14 @@ public class BubbleController implements ConfigurationChangeListener, mMainExecutor.execute( () -> BubbleController.this.onNotificationPanelExpandedChanged(expanded)); } @Override public void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { mMainExecutor.execute( () -> BubbleController.this.onSensitiveNotificationProtectionStateChanged( sensitiveNotificationProtectionActive)); } } /** Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +11 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,11 @@ public class BubbleStackView extends FrameLayout */ private boolean mRemovingLastBubbleWhileExpanded = false; /** * Whether sensitive notification protection should disable flyout */ private boolean mSensitiveNotificationProtectionActive = false; /** Animator for animating the expanded view's alpha (including the TaskView inside it). */ private final ValueAnimator mExpandedViewAlphaAnimator = ValueAnimator.ofFloat(0f, 1f); Loading Loading @@ -2199,6 +2204,11 @@ public class BubbleStackView extends FrameLayout } } void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { mSensitiveNotificationProtectionActive = sensitiveNotificationProtectionActive; } /** * Asks the BubbleController to hide the IME from anywhere, whether it's focused on Bubbles or * not. Loading Loading @@ -2842,6 +2852,7 @@ public class BubbleStackView extends FrameLayout || isExpanded() || mIsExpansionAnimating || mIsGestureInProgress || mSensitiveNotificationProtectionActive || mBubbleToExpandAfterFlyoutCollapse != null || bubbleView == null) { if (bubbleView != null && mFlyout.getVisibility() != VISIBLE) { Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +10 −0 Original line number Diff line number Diff line Loading @@ -285,6 +285,16 @@ public interface Bubbles { */ void onUserRemoved(int removedUserId); /** * Called when the Sensitive notification protection state has changed, such as when media * projection starts and stops. * * @param sensitiveNotificationProtectionActive {@code true} if notifications should be * protected */ void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive); /** * A listener to be notified of bubble state changes, used by launcher to render bubbles in * its process. Loading packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ import com.android.systemui.statusbar.pipeline.dagger.StatusBarPipelineModule; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.PolicyModule; import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController; 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 @@ -358,6 +359,7 @@ public abstract class SystemUIModule { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -376,6 +378,7 @@ public abstract class SystemUIModule { visualInterruptionDecisionProvider, zenModeController, notifUserManager, sensitiveNotificationProtectionController, notifCollection, notifPipeline, sysUiState, Loading packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ 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.server.notification.Flags.screenshareNotificationHiding; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -69,6 +70,7 @@ import com.android.systemui.statusbar.notification.collection.render.Notificatio import com.android.systemui.statusbar.notification.interruption.VisualInterruptionDecisionProvider; import com.android.systemui.statusbar.phone.StatusBarWindowCallback; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleEntry; Loading Loading @@ -102,6 +104,7 @@ public class BubblesManager { private final NotificationVisibilityProvider mVisibilityProvider; private final VisualInterruptionDecisionProvider mVisualInterruptionDecisionProvider; private final NotificationLockscreenUserManager mNotifUserManager; private final SensitiveNotificationProtectionController mSensitiveNotifProtectionController; private final CommonNotifCollection mCommonNotifCollection; private final NotifPipeline mNotifPipeline; private final NotifPipelineFlags mNotifPipelineFlags; Loading @@ -111,6 +114,7 @@ public class BubblesManager { // TODO (b/145659174): allow for multiple callbacks to support the "shadow" new notif pipeline private final List<NotifCallback> mCallbacks = new ArrayList<>(); private final StatusBarWindowCallback mStatusBarWindowCallback; private final Runnable mSensitiveStateChangedListener; private boolean mPanelExpanded; /** Loading @@ -130,6 +134,7 @@ public class BubblesManager { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -149,6 +154,7 @@ public class BubblesManager { visualInterruptionDecisionProvider, zenModeController, notifUserManager, sensitiveNotificationProtectionController, notifCollection, notifPipeline, sysUiState, Loading @@ -173,6 +179,7 @@ public class BubblesManager { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -188,6 +195,7 @@ public class BubblesManager { mVisibilityProvider = visibilityProvider; mVisualInterruptionDecisionProvider = visualInterruptionDecisionProvider; mNotifUserManager = notifUserManager; mSensitiveNotifProtectionController = sensitiveNotificationProtectionController; mCommonNotifCollection = notifCollection; mNotifPipeline = notifPipeline; mNotifPipelineFlags = notifPipelineFlags; Loading Loading @@ -251,6 +259,22 @@ public class BubblesManager { }; notificationShadeWindowController.registerCallback(mStatusBarWindowCallback); mSensitiveStateChangedListener = new Runnable() { @Override public void run() { if (!screenshareNotificationHiding()) { return; } bubbles.onSensitiveNotificationProtectionStateChanged( mSensitiveNotifProtectionController.isSensitiveStateActive()); } }; if (screenshareNotificationHiding()) { mSensitiveNotifProtectionController .registerSensitiveStateListener(mSensitiveStateChangedListener); } mSysuiProxy = new Bubbles.SysuiProxy() { @Override public void isNotificationPanelExpand(Consumer<Boolean> callback) { Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +19 −0 Original line number Diff line number Diff line Loading @@ -683,6 +683,17 @@ public class BubbleController implements ConfigurationChangeListener, mDataRepository.removeBubblesForUser(removedUserId, parentUserId); } /** Called when sensitive notification state has changed */ public void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { if (mStackView != null) { mStackView.onSensitiveNotificationProtectionStateChanged( sensitiveNotificationProtectionActive); ProtoLog.d(WM_SHELL_BUBBLES, "onSensitiveNotificationProtectionStateChanged=%b", sensitiveNotificationProtectionActive); } } /** Whether bubbles are showing in the bubble bar. */ public boolean isShowingAsBubbleBar() { return canShowAsBubbleBar() && mBubbleStateListener != null; Loading Loading @@ -2583,6 +2594,14 @@ public class BubbleController implements ConfigurationChangeListener, mMainExecutor.execute( () -> BubbleController.this.onNotificationPanelExpandedChanged(expanded)); } @Override public void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { mMainExecutor.execute( () -> BubbleController.this.onSensitiveNotificationProtectionStateChanged( sensitiveNotificationProtectionActive)); } } /** Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleStackView.java +11 −0 Original line number Diff line number Diff line Loading @@ -291,6 +291,11 @@ public class BubbleStackView extends FrameLayout */ private boolean mRemovingLastBubbleWhileExpanded = false; /** * Whether sensitive notification protection should disable flyout */ private boolean mSensitiveNotificationProtectionActive = false; /** Animator for animating the expanded view's alpha (including the TaskView inside it). */ private final ValueAnimator mExpandedViewAlphaAnimator = ValueAnimator.ofFloat(0f, 1f); Loading Loading @@ -2199,6 +2204,11 @@ public class BubbleStackView extends FrameLayout } } void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive) { mSensitiveNotificationProtectionActive = sensitiveNotificationProtectionActive; } /** * Asks the BubbleController to hide the IME from anywhere, whether it's focused on Bubbles or * not. Loading Loading @@ -2842,6 +2852,7 @@ public class BubbleStackView extends FrameLayout || isExpanded() || mIsExpansionAnimating || mIsGestureInProgress || mSensitiveNotificationProtectionActive || mBubbleToExpandAfterFlyoutCollapse != null || bubbleView == null) { if (bubbleView != null && mFlyout.getVisibility() != VISIBLE) { Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/Bubbles.java +10 −0 Original line number Diff line number Diff line Loading @@ -285,6 +285,16 @@ public interface Bubbles { */ void onUserRemoved(int removedUserId); /** * Called when the Sensitive notification protection state has changed, such as when media * projection starts and stops. * * @param sensitiveNotificationProtectionActive {@code true} if notifications should be * protected */ void onSensitiveNotificationProtectionStateChanged( boolean sensitiveNotificationProtectionActive); /** * A listener to be notified of bubble state changes, used by launcher to render bubbles in * its process. Loading
packages/SystemUI/src/com/android/systemui/dagger/SystemUIModule.java +3 −0 Original line number Diff line number Diff line Loading @@ -126,6 +126,7 @@ import com.android.systemui.statusbar.pipeline.dagger.StatusBarPipelineModule; import com.android.systemui.statusbar.policy.HeadsUpManager; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.PolicyModule; import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController; 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 @@ -358,6 +359,7 @@ public abstract class SystemUIModule { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -376,6 +378,7 @@ public abstract class SystemUIModule { visualInterruptionDecisionProvider, zenModeController, notifUserManager, sensitiveNotificationProtectionController, notifCollection, notifPipeline, sysUiState, Loading
packages/SystemUI/src/com/android/systemui/wmshell/BubblesManager.java +24 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ 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.server.notification.Flags.screenshareNotificationHiding; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_BUBBLES; import static com.android.wm.shell.bubbles.BubbleDebugConfig.TAG_WITH_CLASS_NAME; Loading Loading @@ -69,6 +70,7 @@ import com.android.systemui.statusbar.notification.collection.render.Notificatio import com.android.systemui.statusbar.notification.interruption.VisualInterruptionDecisionProvider; import com.android.systemui.statusbar.phone.StatusBarWindowCallback; import com.android.systemui.statusbar.policy.KeyguardStateController; import com.android.systemui.statusbar.policy.SensitiveNotificationProtectionController; import com.android.systemui.statusbar.policy.ZenModeController; import com.android.wm.shell.bubbles.Bubble; import com.android.wm.shell.bubbles.BubbleEntry; Loading Loading @@ -102,6 +104,7 @@ public class BubblesManager { private final NotificationVisibilityProvider mVisibilityProvider; private final VisualInterruptionDecisionProvider mVisualInterruptionDecisionProvider; private final NotificationLockscreenUserManager mNotifUserManager; private final SensitiveNotificationProtectionController mSensitiveNotifProtectionController; private final CommonNotifCollection mCommonNotifCollection; private final NotifPipeline mNotifPipeline; private final NotifPipelineFlags mNotifPipelineFlags; Loading @@ -111,6 +114,7 @@ public class BubblesManager { // TODO (b/145659174): allow for multiple callbacks to support the "shadow" new notif pipeline private final List<NotifCallback> mCallbacks = new ArrayList<>(); private final StatusBarWindowCallback mStatusBarWindowCallback; private final Runnable mSensitiveStateChangedListener; private boolean mPanelExpanded; /** Loading @@ -130,6 +134,7 @@ public class BubblesManager { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -149,6 +154,7 @@ public class BubblesManager { visualInterruptionDecisionProvider, zenModeController, notifUserManager, sensitiveNotificationProtectionController, notifCollection, notifPipeline, sysUiState, Loading @@ -173,6 +179,7 @@ public class BubblesManager { VisualInterruptionDecisionProvider visualInterruptionDecisionProvider, ZenModeController zenModeController, NotificationLockscreenUserManager notifUserManager, SensitiveNotificationProtectionController sensitiveNotificationProtectionController, CommonNotifCollection notifCollection, NotifPipeline notifPipeline, SysUiState sysUiState, Loading @@ -188,6 +195,7 @@ public class BubblesManager { mVisibilityProvider = visibilityProvider; mVisualInterruptionDecisionProvider = visualInterruptionDecisionProvider; mNotifUserManager = notifUserManager; mSensitiveNotifProtectionController = sensitiveNotificationProtectionController; mCommonNotifCollection = notifCollection; mNotifPipeline = notifPipeline; mNotifPipelineFlags = notifPipelineFlags; Loading Loading @@ -251,6 +259,22 @@ public class BubblesManager { }; notificationShadeWindowController.registerCallback(mStatusBarWindowCallback); mSensitiveStateChangedListener = new Runnable() { @Override public void run() { if (!screenshareNotificationHiding()) { return; } bubbles.onSensitiveNotificationProtectionStateChanged( mSensitiveNotifProtectionController.isSensitiveStateActive()); } }; if (screenshareNotificationHiding()) { mSensitiveNotifProtectionController .registerSensitiveStateListener(mSensitiveStateChangedListener); } mSysuiProxy = new Bubbles.SysuiProxy() { @Override public void isNotificationPanelExpand(Consumer<Boolean> callback) { Loading