Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −4 Original line number Diff line number Diff line Loading @@ -1440,9 +1440,9 @@ public class BubbleController implements ConfigurationChangeListener, * * @param intent the intent for the bubble. */ public void expandStackAndSelectBubble(Intent intent) { public void expandStackAndSelectBubble(Intent intent, UserHandle user) { if (!Flags.enableBubbleAnything()) return; Bubble b = mBubbleData.getOrCreateBubble(intent); // Removes from overflow Bubble b = mBubbleData.getOrCreateBubble(intent, user); // Removes from overflow ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - intent=%s", intent); if (b.isInflated()) { mBubbleData.setSelectedBubbleAndExpandStack(b); Loading Loading @@ -2649,8 +2649,8 @@ public class BubbleController implements ConfigurationChangeListener, } @Override public void showAppBubble(Intent intent) { mMainExecutor.execute(() -> mController.expandStackAndSelectBubble(intent)); public void showAppBubble(Intent intent, UserHandle user) { mMainExecutor.execute(() -> mController.expandStackAndSelectBubble(intent, user)); } @Override Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +2 −4 Original line number Diff line number Diff line Loading @@ -461,10 +461,8 @@ public class BubbleData { return bubbleToReturn; } Bubble getOrCreateBubble(Intent intent) { UserHandle user = UserHandle.of(mCurrentUserId); String bubbleKey = Bubble.getAppBubbleKeyForApp(intent.getPackage(), user); Bubble getOrCreateBubble(Intent intent, UserHandle user) { String bubbleKey = Bubble.getAppBubbleKeyForApp(intent.getPackage(), user); Bubble bubbleToReturn = findAndRemoveBubbleFromOverflow(bubbleKey); if (bubbleToReturn == null) { bubbleToReturn = Bubble.createAppBubble(intent, user, null, mMainExecutor, mBgExecutor); Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -17,8 +17,9 @@ package com.android.wm.shell.bubbles; import android.content.Intent; import android.graphics.Rect; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.UserHandle; import com.android.wm.shell.bubbles.IBubblesListener; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; Loading Loading @@ -52,7 +53,7 @@ interface IBubbles { oneway void showShortcutBubble(in ShortcutInfo info) = 12; oneway void showAppBubble(in Intent intent) = 13; oneway void showAppBubble(in Intent intent, in UserHandle user) = 13; oneway void showExpandedView() = 14; } No newline at end of file libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -445,6 +445,15 @@ public class BubbleDataTest extends ShellTestCase { assertThat(update.updatedBubble.showFlyout()).isFalse(); } @Test public void getOrCreateBubble_withIntent_usesCorrectUser() { Intent intent = new Intent(); intent.setPackage(mContext.getPackageName()); Bubble b = mBubbleData.getOrCreateBubble(intent, UserHandle.of(/* userId= */ 10)); assertThat(b.getUser().getIdentifier()).isEqualTo(10); } // // Overflow // Loading Loading @@ -1441,12 +1450,6 @@ public class BubbleDataTest extends ShellTestCase { assertWithMessage("selectedBubble").that(update.selectedBubble).isEqualTo(bubble); } private void assertSelectionCleared() { BubbleData.Update update = mUpdateCaptor.getValue(); assertWithMessage("selectionChanged").that(update.selectionChanged).isTrue(); assertWithMessage("selectedBubble").that(update.selectedBubble).isNull(); } private void assertExpandedChangedTo(boolean expected) { BubbleData.Update update = mUpdateCaptor.getValue(); assertWithMessage("expandedChanged").that(update.expandedChanged).isTrue(); Loading Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +4 −4 Original line number Diff line number Diff line Loading @@ -1440,9 +1440,9 @@ public class BubbleController implements ConfigurationChangeListener, * * @param intent the intent for the bubble. */ public void expandStackAndSelectBubble(Intent intent) { public void expandStackAndSelectBubble(Intent intent, UserHandle user) { if (!Flags.enableBubbleAnything()) return; Bubble b = mBubbleData.getOrCreateBubble(intent); // Removes from overflow Bubble b = mBubbleData.getOrCreateBubble(intent, user); // Removes from overflow ProtoLog.v(WM_SHELL_BUBBLES, "expandStackAndSelectBubble - intent=%s", intent); if (b.isInflated()) { mBubbleData.setSelectedBubbleAndExpandStack(b); Loading Loading @@ -2649,8 +2649,8 @@ public class BubbleController implements ConfigurationChangeListener, } @Override public void showAppBubble(Intent intent) { mMainExecutor.execute(() -> mController.expandStackAndSelectBubble(intent)); public void showAppBubble(Intent intent, UserHandle user) { mMainExecutor.execute(() -> mController.expandStackAndSelectBubble(intent, user)); } @Override Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleData.java +2 −4 Original line number Diff line number Diff line Loading @@ -461,10 +461,8 @@ public class BubbleData { return bubbleToReturn; } Bubble getOrCreateBubble(Intent intent) { UserHandle user = UserHandle.of(mCurrentUserId); String bubbleKey = Bubble.getAppBubbleKeyForApp(intent.getPackage(), user); Bubble getOrCreateBubble(Intent intent, UserHandle user) { String bubbleKey = Bubble.getAppBubbleKeyForApp(intent.getPackage(), user); Bubble bubbleToReturn = findAndRemoveBubbleFromOverflow(bubbleKey); if (bubbleToReturn == null) { bubbleToReturn = Bubble.createAppBubble(intent, user, null, mMainExecutor, mBgExecutor); Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/IBubbles.aidl +3 −2 Original line number Diff line number Diff line Loading @@ -17,8 +17,9 @@ package com.android.wm.shell.bubbles; import android.content.Intent; import android.graphics.Rect; import android.content.pm.ShortcutInfo; import android.graphics.Rect; import android.os.UserHandle; import com.android.wm.shell.bubbles.IBubblesListener; import com.android.wm.shell.shared.bubbles.BubbleBarLocation; Loading Loading @@ -52,7 +53,7 @@ interface IBubbles { oneway void showShortcutBubble(in ShortcutInfo info) = 12; oneway void showAppBubble(in Intent intent) = 13; oneway void showAppBubble(in Intent intent, in UserHandle user) = 13; oneway void showExpandedView() = 14; } No newline at end of file
libs/WindowManager/Shell/tests/unittest/src/com/android/wm/shell/bubbles/BubbleDataTest.java +9 −6 Original line number Diff line number Diff line Loading @@ -445,6 +445,15 @@ public class BubbleDataTest extends ShellTestCase { assertThat(update.updatedBubble.showFlyout()).isFalse(); } @Test public void getOrCreateBubble_withIntent_usesCorrectUser() { Intent intent = new Intent(); intent.setPackage(mContext.getPackageName()); Bubble b = mBubbleData.getOrCreateBubble(intent, UserHandle.of(/* userId= */ 10)); assertThat(b.getUser().getIdentifier()).isEqualTo(10); } // // Overflow // Loading Loading @@ -1441,12 +1450,6 @@ public class BubbleDataTest extends ShellTestCase { assertWithMessage("selectedBubble").that(update.selectedBubble).isEqualTo(bubble); } private void assertSelectionCleared() { BubbleData.Update update = mUpdateCaptor.getValue(); assertWithMessage("selectionChanged").that(update.selectionChanged).isTrue(); assertWithMessage("selectedBubble").that(update.selectedBubble).isNull(); } private void assertExpandedChangedTo(boolean expected) { BubbleData.Update update = mUpdateCaptor.getValue(); assertWithMessage("expandedChanged").that(update.expandedChanged).isTrue(); Loading