Loading libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleControllerTest.kt +6 −3 Original line number Diff line number Diff line Loading @@ -84,8 +84,6 @@ import com.android.wm.shell.transition.Transitions.TransitionHandler import com.android.wm.shell.unfold.ShellUnfoldProgressProvider import com.google.common.truth.Truth.assertThat import com.google.common.util.concurrent.MoreExecutors.directExecutor import java.util.Optional import java.util.concurrent.Executor import org.junit.After import org.junit.Assume.assumeTrue import org.junit.Before Loading @@ -103,6 +101,8 @@ import org.mockito.kotlin.never import org.mockito.kotlin.verify import platform.test.runner.parameterized.ParameterizedAndroidJunit4 import platform.test.runner.parameterized.Parameters import java.util.Optional import java.util.concurrent.Executor /** Tests for [BubbleController]. * Loading Loading @@ -456,12 +456,14 @@ class BubbleControllerTest(flags: FlagsParameterization) { fun expandStackAndSelectBubbleForExistingTransition_reusesExistingBubble() { assumeTrue(BubbleAnythingFlagHelper.enableCreateAnyBubble()) val bubbleStateListener = FakeBubblesStateListener() // switch to bubble bar mode because the transition currently requires bubble layer view bubblePositioner.update(deviceConfigUnfolded) bubblePositioner.isShowingInBubbleBar = true getInstrumentation().runOnMainSync { bubbleController.setLauncherHasBubbleBar(true) bubbleController.registerBubbleStateListener(FakeBubblesStateListener()) bubbleController.registerBubbleStateListener(bubbleStateListener) } val taskInfo = ActivityManager.RunningTaskInfo().apply { Loading @@ -484,6 +486,7 @@ class BubbleControllerTest(flags: FlagsParameterization) { ) {} } assertThat(bubbleStateListener.lastUpdate!!.bubbleBarLocation).isNull() assertThat(bubbleData.selectedBubble).isEqualTo(bubble) assertThat(bubbleController.isStackExpanded).isTrue() } Loading libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/FakeBubblesStateListener.kt +4 −1 Original line number Diff line number Diff line Loading @@ -21,8 +21,11 @@ import com.android.wm.shell.shared.bubbles.BubbleBarUpdate /** A fake implementation of [Bubbles.BubbleStateListener] */ class FakeBubblesStateListener : Bubbles.BubbleStateListener { var lastUpdate: BubbleBarUpdate? = null override fun onBubbleStateChange(update: BubbleBarUpdate?) {} override fun onBubbleStateChange(update: BubbleBarUpdate?) { lastUpdate = update } override fun animateBubbleBarLocation(location: BubbleBarLocation?) {} Loading libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1751,8 +1751,8 @@ public class BubbleController implements ConfigurationChangeListener, Bubble b = mBubbleData.getBubbleInStackWithTaskId(taskInfo.taskId); if (b != null) { // Reuse the existing bubble mBubbleData.setSelectedBubbleAndExpandStack(b, BubbleBarLocation.DEFAULT); // Reuse the existing bubble; pass null for location to use existing location. mBubbleData.setSelectedBubbleAndExpandStack(b, null /* bubbleBarLocation */); } else { // Create a new bubble and show it, remove from overflow b = mBubbleData.getOrCreateBubble(taskInfo); Loading Loading
libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/BubbleControllerTest.kt +6 −3 Original line number Diff line number Diff line Loading @@ -84,8 +84,6 @@ import com.android.wm.shell.transition.Transitions.TransitionHandler import com.android.wm.shell.unfold.ShellUnfoldProgressProvider import com.google.common.truth.Truth.assertThat import com.google.common.util.concurrent.MoreExecutors.directExecutor import java.util.Optional import java.util.concurrent.Executor import org.junit.After import org.junit.Assume.assumeTrue import org.junit.Before Loading @@ -103,6 +101,8 @@ import org.mockito.kotlin.never import org.mockito.kotlin.verify import platform.test.runner.parameterized.ParameterizedAndroidJunit4 import platform.test.runner.parameterized.Parameters import java.util.Optional import java.util.concurrent.Executor /** Tests for [BubbleController]. * Loading Loading @@ -456,12 +456,14 @@ class BubbleControllerTest(flags: FlagsParameterization) { fun expandStackAndSelectBubbleForExistingTransition_reusesExistingBubble() { assumeTrue(BubbleAnythingFlagHelper.enableCreateAnyBubble()) val bubbleStateListener = FakeBubblesStateListener() // switch to bubble bar mode because the transition currently requires bubble layer view bubblePositioner.update(deviceConfigUnfolded) bubblePositioner.isShowingInBubbleBar = true getInstrumentation().runOnMainSync { bubbleController.setLauncherHasBubbleBar(true) bubbleController.registerBubbleStateListener(FakeBubblesStateListener()) bubbleController.registerBubbleStateListener(bubbleStateListener) } val taskInfo = ActivityManager.RunningTaskInfo().apply { Loading @@ -484,6 +486,7 @@ class BubbleControllerTest(flags: FlagsParameterization) { ) {} } assertThat(bubbleStateListener.lastUpdate!!.bubbleBarLocation).isNull() assertThat(bubbleData.selectedBubble).isEqualTo(bubble) assertThat(bubbleController.isStackExpanded).isTrue() } Loading
libs/WindowManager/Shell/multivalentTests/src/com/android/wm/shell/bubbles/FakeBubblesStateListener.kt +4 −1 Original line number Diff line number Diff line Loading @@ -21,8 +21,11 @@ import com.android.wm.shell.shared.bubbles.BubbleBarUpdate /** A fake implementation of [Bubbles.BubbleStateListener] */ class FakeBubblesStateListener : Bubbles.BubbleStateListener { var lastUpdate: BubbleBarUpdate? = null override fun onBubbleStateChange(update: BubbleBarUpdate?) {} override fun onBubbleStateChange(update: BubbleBarUpdate?) { lastUpdate = update } override fun animateBubbleBarLocation(location: BubbleBarLocation?) {} Loading
libs/WindowManager/Shell/src/com/android/wm/shell/bubbles/BubbleController.java +2 −2 Original line number Diff line number Diff line Loading @@ -1751,8 +1751,8 @@ public class BubbleController implements ConfigurationChangeListener, Bubble b = mBubbleData.getBubbleInStackWithTaskId(taskInfo.taskId); if (b != null) { // Reuse the existing bubble mBubbleData.setSelectedBubbleAndExpandStack(b, BubbleBarLocation.DEFAULT); // Reuse the existing bubble; pass null for location to use existing location. mBubbleData.setSelectedBubbleAndExpandStack(b, null /* bubbleBarLocation */); } else { // Create a new bubble and show it, remove from overflow b = mBubbleData.getOrCreateBubble(taskInfo); Loading