diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java | 3 | ||||
| -rw-r--r-- | packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java | 17 |
2 files changed, 6 insertions, 14 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java index 1c69594469c1..be9cd5f01c86 100644 --- a/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java +++ b/packages/SystemUI/src/com/android/systemui/bubbles/BubbleData.java @@ -549,6 +549,7 @@ public class BubbleData { Log.e(TAG, "Attempt to expand stack without selected bubble!"); return; } + mSelectedBubble.markUpdatedAt(mTimeSource.currentTimeMillis()); mSelectedBubble.markAsAccessedAt(mTimeSource.currentTimeMillis()); mStateChange.orderChanged |= repackAll(); } else if (!mBubbles.isEmpty()) { @@ -662,7 +663,7 @@ public class BubbleData { /** * This applies a full sort and group pass to all existing bubbles. The bubbles are grouped - * by groupId. Each group is then sorted by the max(lastUpdated) time of it's bubbles. Bubbles + * by groupId. Each group is then sorted by the max(lastUpdated) time of its bubbles. Bubbles * within each group are then sorted by lastUpdated descending. * * @return true if the position of any bubbles changed as a result diff --git a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java index c86b5f76fc05..7df39838b167 100644 --- a/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java +++ b/packages/SystemUI/tests/src/com/android/systemui/bubbles/BubbleDataTest.java @@ -599,13 +599,13 @@ public class BubbleDataTest extends SysuiTestCase { sendUpdatedEntryAtTime(mEntryA1, 1000); sendUpdatedEntryAtTime(mEntryA2, 2000); sendUpdatedEntryAtTime(mEntryB1, 3000); // [B1, A2, A1] - changeExpandedStateAtTime(true, 4000L); + changeExpandedStateAtTime(true, 4000L); // B1 marked updated at 4000L mBubbleData.setListener(mListener); // Test sendUpdatedEntryAtTime(mEntryC1, 4000); verifyUpdateReceived(); - assertOrderChangedTo(mBubbleC1, mBubbleB1, mBubbleA2, mBubbleA1); + assertOrderChangedTo(mBubbleB1, mBubbleC1, mBubbleA2, mBubbleA1); } /** @@ -789,8 +789,7 @@ public class BubbleDataTest extends SysuiTestCase { * When the stack transitions to the collapsed state, the selected bubble is brought to the top. * Bubbles within the same group should move up with it. * <p> - * When the stack transitions back to the expanded state, the previous ordering is restored, as - * long as no changes have been made (adds, removes or updates) while in the collapsed state. + * When the stack transitions back to the expanded state, this new order is kept as is. */ @Test public void test_expansionChanges() { @@ -813,20 +812,12 @@ public class BubbleDataTest extends SysuiTestCase { // stack is expanded. When next collapsed, sorting will be applied and saved, just prior // to moving the selected bubble to the top (first). // - // In this case, the expected re-expand state will be: [B1, B2, A2*, A1] - // - // That state is restored as long as no changes occur (add/remove/update) while in - // the collapsed state. + // In this case, the expected re-expand state will be: [A2, A1, B1, B2] // // collapse -> selected bubble (A2) moves first. changeExpandedStateAtTime(false, 8000L); verifyUpdateReceived(); assertOrderChangedTo(mBubbleA2, mBubbleA1, mBubbleB1, mBubbleB2); - - // expand -> "original" order/grouping restored - changeExpandedStateAtTime(true, 10000L); - verifyUpdateReceived(); - assertOrderChangedTo(mBubbleB1, mBubbleB2, mBubbleA2, mBubbleA1); } /** |