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

Commit 598415b0 authored by Eric Lin's avatar Eric Lin
Browse files

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
parent 42bdf1c4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment