Merge "When opening from locked shade, wait for the shade to unlock before expanding." into rvc-dev am: f1f28c8ec4 am: e6a7a0e18c
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11934834 Change-Id: If10f9614c98b31107c29f2b9148b1384dcafeae0
This commit is contained in:
@@ -183,6 +183,12 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
// Only load overflow data from disk once
|
// Only load overflow data from disk once
|
||||||
private boolean mOverflowDataLoaded = false;
|
private boolean mOverflowDataLoaded = false;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When the shade status changes to SHADE (from anything but SHADE, like LOCKED) we'll select
|
||||||
|
* this bubble and expand the stack.
|
||||||
|
*/
|
||||||
|
@Nullable private NotificationEntry mNotifEntryToExpandOnShadeUnlock;
|
||||||
|
|
||||||
private final NotificationInterruptStateProvider mNotificationInterruptStateProvider;
|
private final NotificationInterruptStateProvider mNotificationInterruptStateProvider;
|
||||||
private IStatusBarService mBarService;
|
private IStatusBarService mBarService;
|
||||||
private WindowManager mWindowManager;
|
private WindowManager mWindowManager;
|
||||||
@@ -295,6 +301,12 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
if (shouldCollapse) {
|
if (shouldCollapse) {
|
||||||
collapseStack();
|
collapseStack();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (mNotifEntryToExpandOnShadeUnlock != null) {
|
||||||
|
expandStackAndSelectBubble(mNotifEntryToExpandOnShadeUnlock);
|
||||||
|
mNotifEntryToExpandOnShadeUnlock = null;
|
||||||
|
}
|
||||||
|
|
||||||
updateStack();
|
updateStack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -935,20 +947,29 @@ public class BubbleController implements ConfigurationController.ConfigurationLi
|
|||||||
* @param entry the notification for the bubble to be selected
|
* @param entry the notification for the bubble to be selected
|
||||||
*/
|
*/
|
||||||
public void expandStackAndSelectBubble(NotificationEntry entry) {
|
public void expandStackAndSelectBubble(NotificationEntry entry) {
|
||||||
String key = entry.getKey();
|
if (mStatusBarStateListener.getCurrentState() == SHADE) {
|
||||||
Bubble bubble = mBubbleData.getBubbleInStackWithKey(key);
|
mNotifEntryToExpandOnShadeUnlock = null;
|
||||||
if (bubble != null) {
|
|
||||||
mBubbleData.setSelectedBubble(bubble);
|
String key = entry.getKey();
|
||||||
mBubbleData.setExpanded(true);
|
Bubble bubble = mBubbleData.getBubbleInStackWithKey(key);
|
||||||
} else {
|
|
||||||
bubble = mBubbleData.getOverflowBubbleWithKey(key);
|
|
||||||
if (bubble != null) {
|
if (bubble != null) {
|
||||||
promoteBubbleFromOverflow(bubble);
|
mBubbleData.setSelectedBubble(bubble);
|
||||||
} else if (entry.canBubble()) {
|
mBubbleData.setExpanded(true);
|
||||||
// It can bubble but it's not -- it got aged out of the overflow before it
|
} else {
|
||||||
// was dismissed or opened, make it a bubble again.
|
bubble = mBubbleData.getOverflowBubbleWithKey(key);
|
||||||
setIsBubble(entry, true /* isBubble */, true /* autoExpand */);
|
if (bubble != null) {
|
||||||
|
promoteBubbleFromOverflow(bubble);
|
||||||
|
} else if (entry.canBubble()) {
|
||||||
|
// It can bubble but it's not -- it got aged out of the overflow before it
|
||||||
|
// was dismissed or opened, make it a bubble again.
|
||||||
|
setIsBubble(entry, true /* isBubble */, true /* autoExpand */);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// Wait until we're unlocked to expand, so that the user can see the expand animation
|
||||||
|
// and also to work around bugs with expansion animation + shade unlock happening at the
|
||||||
|
// same time.
|
||||||
|
mNotifEntryToExpandOnShadeUnlock = entry;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user