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

Commit bd1da71a authored by Nataniel Borges's avatar Nataniel Borges
Browse files

Reuse cached flicker objects

to mitigate memory usage

Test: atest FlickerTests
Change-Id: I21e2da395e804d86eefeb6c908c63ff585e2157b
parent f3e41e9a
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -49,7 +49,10 @@ abstract class BaseTest @JvmOverloads constructor(
) {
    init {
        testSpec.setIsTablet(
            WindowManagerStateHelper(instrumentation).currentState.wmState.isTablet
            WindowManagerStateHelper(
                instrumentation,
                clearCacheAfterParsing = false
            ).currentState.wmState.isTablet
        )
    }

+4 −1
Original line number Diff line number Diff line
@@ -38,7 +38,10 @@ abstract class BaseTest @JvmOverloads constructor(
) {
    init {
        testSpec.setIsTablet(
            WindowManagerStateHelper(instrumentation).currentState.wmState.isTablet
            WindowManagerStateHelper(
                instrumentation,
                clearCacheAfterParsing = false
            ).currentState.wmState.isTablet
        )
        tapl.setExpectedRotationCheckEnabled(true)
    }
+6 −1
Original line number Diff line number Diff line
@@ -26,4 +26,9 @@ import com.android.server.wm.flicker.rules.ChangeDisplayOrientationRule
 * @param rotation New device rotation
 */
fun Flicker.setRotation(rotation: Int) =
    ChangeDisplayOrientationRule.setRotation(rotation, instrumentation, wmHelper)
    ChangeDisplayOrientationRule.setRotation(
        rotation,
        instrumentation,
        clearCacheAfterParsing = false,
        wmHelper = wmHelper
)