This commit is contained in:
ponzischeme89
2026-08-21 10:38:41 +12:00
parent 5467fba0eb
commit af1ca4370c
9 changed files with 107 additions and 15 deletions
@@ -64,14 +64,32 @@ class HomeBenchmark {
)
private fun MacrobenchmarkScope.exerciseHome() {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_DOWN)
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
// Do not wait between presses: a real performance problem is most visible while a
// viewer holds the remote and focus animations, lazy composition and image decode
// overlap. Travelling both ways also covers cached artwork and item reuse rather
// than measuring only the first decode of each card.
repeat(HORIZONTAL_PRESSES) {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
}
repeat(VERTICAL_PRESSES) {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_DOWN)
repeat(HORIZONTAL_PRESSES_PER_ROW) {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_RIGHT)
}
}
repeat(VERTICAL_PRESSES) {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_UP)
repeat(HORIZONTAL_PRESSES_PER_ROW) {
device.pressKeyCode(android.view.KeyEvent.KEYCODE_DPAD_LEFT)
}
}
device.waitForIdle()
}
private companion object {
const val PACKAGE_NAME = "com.ponzischeme89.memby"
const val HORIZONTAL_PRESSES = 12
const val HORIZONTAL_PRESSES_PER_ROW = 6
const val VERTICAL_PRESSES = 4
}
}