Skip to content
Snippets Groups Projects
Commit cf4b5477 authored by Android Build Coastguard Worker's avatar Android Build Coastguard Worker
Browse files

Merge cherrypicks of [16778403] into sc-v2-release.

Change-Id: Ie5649ce77ccb6510d5677112b84c09e1e6429324
parents f08e0edb 6843c124
No related branches found
No related tags found
No related merge requests found
......@@ -1724,6 +1724,7 @@ public class BubbleStackView extends FrameLayout
/**
* Changes the expanded state of the stack.
* Don't call this directly, call mBubbleData#setExpanded.
*
* @param shouldExpand whether the bubble stack should appear expanded
*/
......@@ -1770,7 +1771,7 @@ public class BubbleStackView extends FrameLayout
} else if (mManageEduView != null && mManageEduView.getVisibility() == VISIBLE) {
mManageEduView.hide();
} else {
setExpanded(false);
mBubbleData.setExpanded(false);
}
}
}
......
......@@ -1275,6 +1275,22 @@ public class BubblesTest extends SysuiTestCase {
assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */);
}
@Test
public void testStackViewOnBackPressed_updatesBubbleDataExpandState() {
mBubbleController.updateBubble(mBubbleEntry);
// Expand the stack
mBubbleData.setExpanded(true);
assertStackExpanded();
// Hit back
BubbleStackView stackView = mBubbleController.getStackView();
stackView.onBackPressed();
// Make sure we're collapsed
assertStackCollapsed();
}
/** Creates a bubble using the userId and package. */
private Bubble createBubble(int userId, String pkg) {
final UserHandle userHandle = new UserHandle(userId);
......
......@@ -1091,6 +1091,22 @@ public class NewNotifPipelineBubblesTest extends SysuiTestCase {
assertSysuiStates(false /* stackExpanded */, false /* mangeMenuExpanded */);
}
@Test
public void testStackViewOnBackPressed_updatesBubbleDataExpandState() {
mBubbleController.updateBubble(mBubbleEntry);
// Expand the stack
mBubbleData.setExpanded(true);
assertStackExpanded();
// Hit back
BubbleStackView stackView = mBubbleController.getStackView();
stackView.onBackPressed();
// Make sure we're collapsed
assertStackCollapsed();
}
/**
* 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment