Merge "Adds SYSUI_STATE_BUBBLES_EXPANDED to QuickStepContract." into rvc-dev am: 040c89290b am: bd850de2ed
Change-Id: I3adef5be4980376c7ce3d9bab3ad4fd664a49409
This commit is contained in:
@@ -73,14 +73,19 @@ public class QuickStepContract {
|
|||||||
public static final int SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED = 1 << 9;
|
public static final int SYSUI_STATE_STATUS_BAR_KEYGUARD_SHOWING_OCCLUDED = 1 << 9;
|
||||||
// The search feature is disabled (either by SUW/SysUI/device policy)
|
// The search feature is disabled (either by SUW/SysUI/device policy)
|
||||||
public static final int SYSUI_STATE_SEARCH_DISABLED = 1 << 10;
|
public static final int SYSUI_STATE_SEARCH_DISABLED = 1 << 10;
|
||||||
// The notification panel is expanded and interactive (either locked or unlocked), and the
|
// The notification panel is expanded and interactive (either locked or unlocked), and quick
|
||||||
// quick settings is not expanded
|
// settings is expanded.
|
||||||
public static final int SYSUI_STATE_QUICK_SETTINGS_EXPANDED = 1 << 11;
|
public static final int SYSUI_STATE_QUICK_SETTINGS_EXPANDED = 1 << 11;
|
||||||
// Winscope tracing is enabled
|
// Winscope tracing is enabled
|
||||||
public static final int SYSUI_STATE_TRACING_ENABLED = 1 << 12;
|
public static final int SYSUI_STATE_TRACING_ENABLED = 1 << 12;
|
||||||
// The Assistant gesture should be constrained. It is up to the launcher implementation to
|
// The Assistant gesture should be constrained. It is up to the launcher implementation to
|
||||||
// decide how to constrain it
|
// decide how to constrain it
|
||||||
public static final int SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED = 1 << 13;
|
public static final int SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED = 1 << 13;
|
||||||
|
// The bubble stack is expanded. This means that the home gesture should be ignored, since a
|
||||||
|
// swipe up is an attempt to close the bubble stack, but that the back gesture should remain
|
||||||
|
// enabled (since it's used to navigate back within the bubbled app, or to collapse the bubble
|
||||||
|
// stack.
|
||||||
|
public static final int SYSUI_STATE_BUBBLES_EXPANDED = 1 << 14;
|
||||||
|
|
||||||
@Retention(RetentionPolicy.SOURCE)
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
@IntDef({SYSUI_STATE_SCREEN_PINNING,
|
@IntDef({SYSUI_STATE_SCREEN_PINNING,
|
||||||
@@ -96,7 +101,8 @@ public class QuickStepContract {
|
|||||||
SYSUI_STATE_HOME_DISABLED,
|
SYSUI_STATE_HOME_DISABLED,
|
||||||
SYSUI_STATE_SEARCH_DISABLED,
|
SYSUI_STATE_SEARCH_DISABLED,
|
||||||
SYSUI_STATE_TRACING_ENABLED,
|
SYSUI_STATE_TRACING_ENABLED,
|
||||||
SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED
|
SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED,
|
||||||
|
SYSUI_STATE_BUBBLES_EXPANDED
|
||||||
})
|
})
|
||||||
public @interface SystemUiStateFlags {}
|
public @interface SystemUiStateFlags {}
|
||||||
|
|
||||||
@@ -118,6 +124,7 @@ public class QuickStepContract {
|
|||||||
str.add((flags & SYSUI_STATE_TRACING_ENABLED) != 0 ? "tracing" : "");
|
str.add((flags & SYSUI_STATE_TRACING_ENABLED) != 0 ? "tracing" : "");
|
||||||
str.add((flags & SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED) != 0
|
str.add((flags & SYSUI_STATE_ASSIST_GESTURE_CONSTRAINED) != 0
|
||||||
? "asst_gesture_constrain" : "");
|
? "asst_gesture_constrain" : "");
|
||||||
|
str.add((flags & SYSUI_STATE_BUBBLES_EXPANDED) != 0 ? "bubbles_expanded" : "");
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,7 @@ import com.android.systemui.Dumpable;
|
|||||||
import com.android.systemui.R;
|
import com.android.systemui.R;
|
||||||
import com.android.systemui.bubbles.dagger.BubbleModule;
|
import com.android.systemui.bubbles.dagger.BubbleModule;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
import com.android.systemui.shared.system.ActivityManagerWrapper;
|
||||||
import com.android.systemui.shared.system.PinnedStackListenerForwarder;
|
import com.android.systemui.shared.system.PinnedStackListenerForwarder;
|
||||||
@@ -174,6 +175,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
|
|
||||||
private final NotificationInterruptStateProvider mNotificationInterruptStateProvider;
|
private final NotificationInterruptStateProvider mNotificationInterruptStateProvider;
|
||||||
private IStatusBarService mBarService;
|
private IStatusBarService mBarService;
|
||||||
|
private SysUiState mSysUiState;
|
||||||
|
|
||||||
// Used for determining view rect for touch interaction
|
// Used for determining view rect for touch interaction
|
||||||
private Rect mTempRect = new Rect();
|
private Rect mTempRect = new Rect();
|
||||||
@@ -290,11 +292,12 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
FeatureFlags featureFlags,
|
FeatureFlags featureFlags,
|
||||||
DumpManager dumpManager,
|
DumpManager dumpManager,
|
||||||
FloatingContentCoordinator floatingContentCoordinator) {
|
FloatingContentCoordinator floatingContentCoordinator,
|
||||||
|
SysUiState sysUiState) {
|
||||||
this(context, notificationShadeWindowController, statusBarStateController, shadeController,
|
this(context, notificationShadeWindowController, statusBarStateController, shadeController,
|
||||||
data, null /* synchronizer */, configurationController, interruptionStateProvider,
|
data, null /* synchronizer */, configurationController, interruptionStateProvider,
|
||||||
zenModeController, notifUserManager, groupManager, entryManager,
|
zenModeController, notifUserManager, groupManager, entryManager,
|
||||||
notifPipeline, featureFlags, dumpManager, floatingContentCoordinator);
|
notifPipeline, featureFlags, dumpManager, floatingContentCoordinator, sysUiState);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -315,7 +318,8 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
FeatureFlags featureFlags,
|
FeatureFlags featureFlags,
|
||||||
DumpManager dumpManager,
|
DumpManager dumpManager,
|
||||||
FloatingContentCoordinator floatingContentCoordinator) {
|
FloatingContentCoordinator floatingContentCoordinator,
|
||||||
|
SysUiState sysUiState) {
|
||||||
dumpManager.registerDumpable(TAG, this);
|
dumpManager.registerDumpable(TAG, this);
|
||||||
mContext = context;
|
mContext = context;
|
||||||
mShadeController = shadeController;
|
mShadeController = shadeController;
|
||||||
@@ -340,6 +344,7 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
});
|
});
|
||||||
|
|
||||||
configurationController.addCallback(this /* configurationListener */);
|
configurationController.addCallback(this /* configurationListener */);
|
||||||
|
mSysUiState = sysUiState;
|
||||||
|
|
||||||
mBubbleData = data;
|
mBubbleData = data;
|
||||||
mBubbleData.setListener(mBubbleDataListener);
|
mBubbleData.setListener(mBubbleDataListener);
|
||||||
@@ -593,7 +598,8 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
private void ensureStackViewCreated() {
|
private void ensureStackViewCreated() {
|
||||||
if (mStackView == null) {
|
if (mStackView == null) {
|
||||||
mStackView = new BubbleStackView(
|
mStackView = new BubbleStackView(
|
||||||
mContext, mBubbleData, mSurfaceSynchronizer, mFloatingContentCoordinator);
|
mContext, mBubbleData, mSurfaceSynchronizer, mFloatingContentCoordinator,
|
||||||
|
mSysUiState);
|
||||||
ViewGroup nsv = mNotificationShadeWindowController.getNotificationShadeView();
|
ViewGroup nsv = mNotificationShadeWindowController.getNotificationShadeView();
|
||||||
int bubbleScrimIndex = nsv.indexOfChild(nsv.findViewById(R.id.scrim_for_bubble));
|
int bubbleScrimIndex = nsv.indexOfChild(nsv.findViewById(R.id.scrim_for_bubble));
|
||||||
int stackIndex = bubbleScrimIndex + 1; // Show stack above bubble scrim.
|
int stackIndex = bubbleScrimIndex + 1; // Show stack above bubble scrim.
|
||||||
|
|||||||
@@ -80,6 +80,8 @@ import com.android.systemui.R;
|
|||||||
import com.android.systemui.bubbles.animation.ExpandedAnimationController;
|
import com.android.systemui.bubbles.animation.ExpandedAnimationController;
|
||||||
import com.android.systemui.bubbles.animation.PhysicsAnimationLayout;
|
import com.android.systemui.bubbles.animation.PhysicsAnimationLayout;
|
||||||
import com.android.systemui.bubbles.animation.StackAnimationController;
|
import com.android.systemui.bubbles.animation.StackAnimationController;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
|
import com.android.systemui.shared.system.QuickStepContract;
|
||||||
import com.android.systemui.shared.system.SysUiStatsLog;
|
import com.android.systemui.shared.system.SysUiStatsLog;
|
||||||
import com.android.systemui.util.DismissCircleView;
|
import com.android.systemui.util.DismissCircleView;
|
||||||
import com.android.systemui.util.FloatingContentCoordinator;
|
import com.android.systemui.util.FloatingContentCoordinator;
|
||||||
@@ -241,6 +243,7 @@ public class BubbleStackView extends FrameLayout {
|
|||||||
|
|
||||||
private BubbleTouchHandler mTouchHandler;
|
private BubbleTouchHandler mTouchHandler;
|
||||||
private BubbleController.BubbleExpandListener mExpandListener;
|
private BubbleController.BubbleExpandListener mExpandListener;
|
||||||
|
private SysUiState mSysUiState;
|
||||||
|
|
||||||
private boolean mViewUpdatedRequested = false;
|
private boolean mViewUpdatedRequested = false;
|
||||||
private boolean mIsExpansionAnimating = false;
|
private boolean mIsExpansionAnimating = false;
|
||||||
@@ -437,7 +440,8 @@ public class BubbleStackView extends FrameLayout {
|
|||||||
|
|
||||||
public BubbleStackView(Context context, BubbleData data,
|
public BubbleStackView(Context context, BubbleData data,
|
||||||
@Nullable SurfaceSynchronizer synchronizer,
|
@Nullable SurfaceSynchronizer synchronizer,
|
||||||
FloatingContentCoordinator floatingContentCoordinator) {
|
FloatingContentCoordinator floatingContentCoordinator,
|
||||||
|
SysUiState sysUiState) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
mBubbleData = data;
|
mBubbleData = data;
|
||||||
@@ -445,6 +449,8 @@ public class BubbleStackView extends FrameLayout {
|
|||||||
mTouchHandler = new BubbleTouchHandler(this, data, context);
|
mTouchHandler = new BubbleTouchHandler(this, data, context);
|
||||||
setOnTouchListener(mTouchHandler);
|
setOnTouchListener(mTouchHandler);
|
||||||
|
|
||||||
|
mSysUiState = sysUiState;
|
||||||
|
|
||||||
Resources res = getResources();
|
Resources res = getResources();
|
||||||
mMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered);
|
mMaxBubbles = res.getInteger(R.integer.bubbles_max_rendered);
|
||||||
mBubbleSize = res.getDimensionPixelSize(R.dimen.individual_bubble_size);
|
mBubbleSize = res.getDimensionPixelSize(R.dimen.individual_bubble_size);
|
||||||
@@ -1055,6 +1061,11 @@ public class BubbleStackView extends FrameLayout {
|
|||||||
if (shouldExpand == mIsExpanded) {
|
if (shouldExpand == mIsExpanded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mSysUiState
|
||||||
|
.setFlag(QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED, shouldExpand)
|
||||||
|
.commitUpdate(mContext.getDisplayId());
|
||||||
|
|
||||||
if (mIsExpanded) {
|
if (mIsExpanded) {
|
||||||
animateCollapse();
|
animateCollapse();
|
||||||
logBubbleEvent(mExpandedBubble, SysUiStatsLog.BUBBLE_UICHANGED__ACTION__COLLAPSED);
|
logBubbleEvent(mExpandedBubble, SysUiStatsLog.BUBBLE_UICHANGED__ACTION__COLLAPSED);
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ import android.content.Context;
|
|||||||
import com.android.systemui.bubbles.BubbleController;
|
import com.android.systemui.bubbles.BubbleController;
|
||||||
import com.android.systemui.bubbles.BubbleData;
|
import com.android.systemui.bubbles.BubbleData;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.statusbar.FeatureFlags;
|
import com.android.systemui.statusbar.FeatureFlags;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
@@ -62,7 +63,8 @@ public interface BubbleModule {
|
|||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
FeatureFlags featureFlags,
|
FeatureFlags featureFlags,
|
||||||
DumpManager dumpManager,
|
DumpManager dumpManager,
|
||||||
FloatingContentCoordinator floatingContentCoordinator) {
|
FloatingContentCoordinator floatingContentCoordinator,
|
||||||
|
SysUiState sysUiState) {
|
||||||
return new BubbleController(
|
return new BubbleController(
|
||||||
context,
|
context,
|
||||||
notificationShadeWindowController,
|
notificationShadeWindowController,
|
||||||
@@ -79,6 +81,7 @@ public interface BubbleModule {
|
|||||||
notifPipeline,
|
notifPipeline,
|
||||||
featureFlags,
|
featureFlags,
|
||||||
dumpManager,
|
dumpManager,
|
||||||
floatingContentCoordinator);
|
floatingContentCoordinator,
|
||||||
|
sysUiState);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -62,7 +62,9 @@ import com.android.systemui.SystemUIFactory;
|
|||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
|
import com.android.systemui.shared.system.QuickStepContract;
|
||||||
import com.android.systemui.statusbar.FeatureFlags;
|
import com.android.systemui.statusbar.FeatureFlags;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
import com.android.systemui.statusbar.NotificationRemoveInterceptor;
|
import com.android.systemui.statusbar.NotificationRemoveInterceptor;
|
||||||
@@ -136,6 +138,9 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
@Mock
|
@Mock
|
||||||
private FloatingContentCoordinator mFloatingContentCoordinator;
|
private FloatingContentCoordinator mFloatingContentCoordinator;
|
||||||
|
|
||||||
|
private SysUiState mSysUiState;
|
||||||
|
private boolean mSysUiStateBubblesExpanded;
|
||||||
|
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<NotificationEntryListener> mEntryListenerCaptor;
|
private ArgumentCaptor<NotificationEntryListener> mEntryListenerCaptor;
|
||||||
@Captor
|
@Captor
|
||||||
@@ -229,6 +234,11 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
mZenModeConfig.suppressedVisualEffects = 0;
|
mZenModeConfig.suppressedVisualEffects = 0;
|
||||||
when(mZenModeController.getConfig()).thenReturn(mZenModeConfig);
|
when(mZenModeController.getConfig()).thenReturn(mZenModeConfig);
|
||||||
|
|
||||||
|
mSysUiState = new SysUiState();
|
||||||
|
mSysUiState.addCallback(sysUiFlags ->
|
||||||
|
mSysUiStateBubblesExpanded =
|
||||||
|
(sysUiFlags & QuickStepContract.SYSUI_STATE_BUBBLES_EXPANDED) != 0);
|
||||||
|
|
||||||
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
TestableNotificationInterruptStateProviderImpl interruptionStateProvider =
|
||||||
new TestableNotificationInterruptStateProviderImpl(mContext.getContentResolver(),
|
new TestableNotificationInterruptStateProviderImpl(mContext.getContentResolver(),
|
||||||
mock(PowerManager.class),
|
mock(PowerManager.class),
|
||||||
@@ -257,7 +267,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
mNotifPipeline,
|
mNotifPipeline,
|
||||||
mFeatureFlagsOldPipeline,
|
mFeatureFlagsOldPipeline,
|
||||||
mDumpManager,
|
mDumpManager,
|
||||||
mFloatingContentCoordinator);
|
mFloatingContentCoordinator,
|
||||||
|
mSysUiState);
|
||||||
mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener);
|
mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener);
|
||||||
mBubbleController.setExpandListener(mBubbleExpandListener);
|
mBubbleController.setExpandListener(mBubbleExpandListener);
|
||||||
|
|
||||||
@@ -277,6 +288,7 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertTrue(mBubbleController.hasBubbles());
|
assertTrue(mBubbleController.hasBubbles());
|
||||||
|
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(true);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(true);
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -284,6 +296,7 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertFalse(mBubbleController.hasBubbles());
|
assertFalse(mBubbleController.hasBubbles());
|
||||||
mBubbleController.updateBubble(mRow.getEntry());
|
mBubbleController.updateBubble(mRow.getEntry());
|
||||||
assertTrue(mBubbleController.hasBubbles());
|
assertTrue(mBubbleController.hasBubbles());
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -300,6 +313,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().getKey()));
|
assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().getKey()));
|
||||||
verify(mNotificationEntryManager, times(2)).updateNotifications(anyString());
|
verify(mNotificationEntryManager, times(2)).updateNotifications(anyString());
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(false);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(false);
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -323,6 +338,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
verify(mNotificationEntryManager, times(1)).performRemoveNotification(
|
verify(mNotificationEntryManager, times(1)).performRemoveNotification(
|
||||||
eq(mRow.getEntry().getSbn()), anyInt());
|
eq(mRow.getEntry().getSbn()), anyInt());
|
||||||
assertFalse(mBubbleController.hasBubbles());
|
assertFalse(mBubbleController.hasBubbles());
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -340,6 +357,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
verify(mNotificationEntryManager, times(3)).updateNotifications(any());
|
verify(mNotificationEntryManager, times(3)).updateNotifications(any());
|
||||||
assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().getKey()));
|
assertNull(mBubbleData.getBubbleWithKey(mRow.getEntry().getKey()));
|
||||||
assertNull(mBubbleData.getBubbleWithKey(mRow2.getEntry().getKey()));
|
assertNull(mBubbleData.getBubbleWithKey(mRow2.getEntry().getKey()));
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -363,6 +382,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
||||||
assertTrue(mNotificationShadeWindowController.getBubbleExpanded());
|
assertTrue(mNotificationShadeWindowController.getBubbleExpanded());
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
|
|
||||||
// Make sure the notif is suppressed
|
// Make sure the notif is suppressed
|
||||||
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
||||||
mRow.getEntry()));
|
mRow.getEntry()));
|
||||||
@@ -372,6 +393,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().getKey());
|
||||||
assertFalse(mBubbleController.isStackExpanded());
|
assertFalse(mBubbleController.isStackExpanded());
|
||||||
assertFalse(mNotificationShadeWindowController.getBubbleExpanded());
|
assertFalse(mNotificationShadeWindowController.getBubbleExpanded());
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -395,6 +418,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertTrue(mBubbleController.isStackExpanded());
|
assertTrue(mBubbleController.isStackExpanded());
|
||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow2.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow2.getEntry().getKey());
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
|
|
||||||
// Last added is the one that is expanded
|
// Last added is the one that is expanded
|
||||||
assertEquals(mRow2.getEntry(), mBubbleData.getSelectedBubble().getEntry());
|
assertEquals(mRow2.getEntry(), mBubbleData.getSelectedBubble().getEntry());
|
||||||
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
||||||
@@ -416,6 +441,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
// Collapse
|
// Collapse
|
||||||
mBubbleController.collapseStack();
|
mBubbleController.collapseStack();
|
||||||
assertFalse(mBubbleController.isStackExpanded());
|
assertFalse(mBubbleController.isStackExpanded());
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -437,6 +464,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertTrue(mBubbleController.isStackExpanded());
|
assertTrue(mBubbleController.isStackExpanded());
|
||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
|
|
||||||
// Notif is suppressed after expansion
|
// Notif is suppressed after expansion
|
||||||
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
||||||
mRow.getEntry()));
|
mRow.getEntry()));
|
||||||
@@ -463,6 +492,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
assertTrue(mBubbleController.isStackExpanded());
|
assertTrue(mBubbleController.isStackExpanded());
|
||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow.getEntry().getKey());
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
|
|
||||||
// Notif is suppressed after expansion
|
// Notif is suppressed after expansion
|
||||||
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
assertTrue(mBubbleController.isBubbleNotificationSuppressedFromShade(
|
||||||
mRow.getEntry()));
|
mRow.getEntry()));
|
||||||
@@ -493,6 +524,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
BubbleStackView stackView = mBubbleController.getStackView();
|
BubbleStackView stackView = mBubbleController.getStackView();
|
||||||
mBubbleController.expandStack();
|
mBubbleController.expandStack();
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
|
|
||||||
assertTrue(mBubbleController.isStackExpanded());
|
assertTrue(mBubbleController.isStackExpanded());
|
||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow2.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(true, mRow2.getEntry().getKey());
|
||||||
|
|
||||||
@@ -522,6 +555,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().getKey());
|
verify(mBubbleExpandListener).onBubbleExpandChanged(false, mRow.getEntry().getKey());
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(false);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(false);
|
||||||
assertFalse(mBubbleController.hasBubbles());
|
assertFalse(mBubbleController.hasBubbles());
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -541,6 +576,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// # of bubbles should change
|
// # of bubbles should change
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -559,6 +596,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// # of bubbles should change
|
// # of bubbles should change
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -579,6 +618,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// # of bubbles should change
|
// # of bubbles should change
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -605,6 +646,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
|
|
||||||
// # of bubbles should change
|
// # of bubbles should change
|
||||||
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
verify(mBubbleStateChangeListener).onHasBubblesChanged(true /* hasBubbles */);
|
||||||
|
|
||||||
|
assertFalse(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@@ -619,6 +662,8 @@ public class BubbleControllerTest extends SysuiTestCase {
|
|||||||
mRow.getEntry().getKey(), mRow.getEntry(), REASON_APP_CANCEL);
|
mRow.getEntry().getKey(), mRow.getEntry(), REASON_APP_CANCEL);
|
||||||
|
|
||||||
mBubbleController.expandStackAndSelectBubble(key);
|
mBubbleController.expandStackAndSelectBubble(key);
|
||||||
|
|
||||||
|
assertTrue(mSysUiStateBubblesExpanded);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ import com.android.systemui.SystemUIFactory;
|
|||||||
import com.android.systemui.SysuiTestCase;
|
import com.android.systemui.SysuiTestCase;
|
||||||
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
import com.android.systemui.colorextraction.SysuiColorExtractor;
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.statusbar.FeatureFlags;
|
import com.android.systemui.statusbar.FeatureFlags;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
@@ -132,6 +133,9 @@ public class NewNotifPipelineBubbleControllerTest extends SysuiTestCase {
|
|||||||
private KeyguardBypassController mKeyguardBypassController;
|
private KeyguardBypassController mKeyguardBypassController;
|
||||||
@Mock
|
@Mock
|
||||||
private FloatingContentCoordinator mFloatingContentCoordinator;
|
private FloatingContentCoordinator mFloatingContentCoordinator;
|
||||||
|
|
||||||
|
private SysUiState mSysUiState = new SysUiState();
|
||||||
|
|
||||||
@Captor
|
@Captor
|
||||||
private ArgumentCaptor<NotifCollectionListener> mNotifListenerCaptor;
|
private ArgumentCaptor<NotifCollectionListener> mNotifListenerCaptor;
|
||||||
private TestableBubbleController mBubbleController;
|
private TestableBubbleController mBubbleController;
|
||||||
@@ -242,7 +246,8 @@ public class NewNotifPipelineBubbleControllerTest extends SysuiTestCase {
|
|||||||
mNotifPipeline,
|
mNotifPipeline,
|
||||||
mFeatureFlagsNewPipeline,
|
mFeatureFlagsNewPipeline,
|
||||||
mDumpManager,
|
mDumpManager,
|
||||||
mFloatingContentCoordinator);
|
mFloatingContentCoordinator,
|
||||||
|
mSysUiState);
|
||||||
mBubbleController.addNotifCallback(mNotifCallback);
|
mBubbleController.addNotifCallback(mNotifCallback);
|
||||||
mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener);
|
mBubbleController.setBubbleStateChangeListener(mBubbleStateChangeListener);
|
||||||
mBubbleController.setExpandListener(mBubbleExpandListener);
|
mBubbleController.setExpandListener(mBubbleExpandListener);
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ package com.android.systemui.bubbles;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import com.android.systemui.dump.DumpManager;
|
import com.android.systemui.dump.DumpManager;
|
||||||
|
import com.android.systemui.model.SysUiState;
|
||||||
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
import com.android.systemui.plugins.statusbar.StatusBarStateController;
|
||||||
import com.android.systemui.statusbar.FeatureFlags;
|
import com.android.systemui.statusbar.FeatureFlags;
|
||||||
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
import com.android.systemui.statusbar.NotificationLockscreenUserManager;
|
||||||
@@ -52,12 +53,13 @@ public class TestableBubbleController extends BubbleController {
|
|||||||
NotifPipeline notifPipeline,
|
NotifPipeline notifPipeline,
|
||||||
FeatureFlags featureFlags,
|
FeatureFlags featureFlags,
|
||||||
DumpManager dumpManager,
|
DumpManager dumpManager,
|
||||||
FloatingContentCoordinator floatingContentCoordinator) {
|
FloatingContentCoordinator floatingContentCoordinator,
|
||||||
|
SysUiState sysUiState) {
|
||||||
super(context,
|
super(context,
|
||||||
notificationShadeWindowController, statusBarStateController, shadeController,
|
notificationShadeWindowController, statusBarStateController, shadeController,
|
||||||
data, Runnable::run, configurationController, interruptionStateProvider,
|
data, Runnable::run, configurationController, interruptionStateProvider,
|
||||||
zenModeController, lockscreenUserManager, groupManager, entryManager,
|
zenModeController, lockscreenUserManager, groupManager, entryManager,
|
||||||
notifPipeline, featureFlags, dumpManager, floatingContentCoordinator);
|
notifPipeline, featureFlags, dumpManager, floatingContentCoordinator, sysUiState);
|
||||||
setInflateSynchronously(true);
|
setInflateSynchronously(true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user