Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f146ca64 authored by Mady Mellor's avatar Mady Mellor
Browse files

Don't keep app bubbles on top

Previously the code was attempting to set app bubbles as always the
most recently accessed. This caused some weird ordering behavior.

Checked with UX and this should be changed to work exactly the same
as chat bubbles (i.e. whatever is most recently accessed - selected
and expanded, should remain on top).

Test: atest BubbleDataTest
Bug: 311345996

Change-Id: I9c70d4c470e27bbb5254a32007452c27c0f649d9
parent 40623526
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -637,7 +637,7 @@ public class Bubble implements BubbleViewProvider {
     * @return the last time this bubble was updated or accessed, whichever is most recent.
     */
    long getLastActivity() {
        return isAppBubble() ? Long.MAX_VALUE : Math.max(mLastUpdated, mLastAccessed);
        return Math.max(mLastUpdated, mLastAccessed);
    }

    /**
+16 −0
Original line number Diff line number Diff line
@@ -220,6 +220,22 @@ public class BubbleDataTest extends ShellTestCase {
        assertSelectionChangedTo(mBubbleA1);
    }

    @Test
    public void testAddAppBubble_setsTime() {
        // Setup
        mBubbleData.setListener(mListener);

        // Test
        assertThat(mAppBubble.getLastActivity()).isEqualTo(0);
        setCurrentTime(1000);
        mBubbleData.notificationEntryUpdated(mAppBubble, true /* suppressFlyout*/,
                false /* showInShade */);

        // Verify
        assertThat(mBubbleData.getBubbleInStackWithKey(mAppBubble.getKey())).isEqualTo(mAppBubble);
        assertThat(mAppBubble.getLastActivity()).isEqualTo(1000);
    }

    @Test
    public void testRemoveBubble() {
        // Setup