Refactor BubbleUtils with Kotlin extensions.
To improve readability and adopt Kotlin idioms, this change refactors the static utility methods in BubbleUtils.kt into extension functions on ActivityManager.RunningTaskInfo. This provides a more ergonomic way to call these utilities, changing calls from isBubbleToFullscreen(task) to the more natural task.isBubbleToFullscreen(). This refactoring also centralizes the logic for determining if a bubble is moving into a split-screen stage. The new isBubbleToSplit() extension function is now shared between BubblesTransitionObserver and BubbleTaskStackListener, which eliminates duplicated code. For seamless Java interoperability and to prevent breaking existing callers, the new extension functions are annotated with @JvmStatic. They also operate on a nullable receiver (ActivityManager.RunningTaskInfo?) to ensure null safety. Bug: 387193964 Flag: EXEMPT PURE_REFACTOR Test: atest WMShellRobolectricTests:BubbleBarExpandedViewTest Test: atest WMShellRobolectricTests:BubbleControllerTest Test: atest WMShellRobolectricTests:BubbleTaskStackListenerTest Test: atest WMShellRobolectricTests:BubbleTaskViewTest Test: atest WMShellMultivalentTestsOnDevice:BubbleBarExpandedViewTest Test: atest WMShellMultivalentTestsOnDevice:BubbleControllerTest Test: atest WMShellMultivalentTestsOnDevice:BubbleTaskStackListenerTest Test: atest WMShellMultivalentTestsOnDevice:BubbleTaskViewTest Test: atest WMShellUnitTests:BubblesTransitionObserverTest Change-Id: I85661ef39f91374a7468b64a3ded4138e1945c57
Loading
Please register or sign in to comment