Status Update
Comments
cc...@google.com <cc...@google.com> #2
Can you attach the trace? There should be a line in logcat that mentions the last .perfetto-trace file
My assumption is that if you don't produce a frame since you're still waiting (like splashscreen avoids by returning false to the draw listener) am start
shouldn't return - we need to check that.
You should be able to workaround by using Thread.sleep(5000)
, or using UiAutomator to await a certain UI element showing up.
[Deleted User] <[Deleted User]> #3
Yeah trace in attachment.
cc...@google.com <cc...@google.com> #4
Thanks, that verifies that the trace and app behavior all looks fine (see attached). Unfortunately that means the workaround wouldn't help.
Can you:
- run "adb shell dumpsys gfxinfo com.stackin.android framestats"
- launch your app to this screen (manually is fine)
- run "adb shell dumpsys gfxinfo com.stackin.android framestats"
And attach the results from the two dumps?
It may be that we can't trust the launch bit to be set in the framestats output when using the frame cancellation like splashscreen uses. You could see if measurements work on an API 28 device, which would be one way to confirm thats the problem, and workaround.
[Deleted User] <[Deleted User]> #5
ap...@google.com <ap...@google.com> #6
Branch: androidx-main
commit 597e8b0ade2b28bd01657b806307c6838dea54e7
Author: Chris Craik <ccraik@google.com>
Date: Thu Sep 08 16:51:06 2022
Remove check for launch flag for launch confirmation
Fixes: 244594339
Fixes: 228946895
Test: ./gradlew bench:b-m:cC
Relnote: "Fix bug where startActivityAndWait would timeout trying to
wait forlaunch completion on emulators by reducing strictness of frame
detection."
Change-Id: Ibe2c6c5519973f5c3311f4abb02e21c66a77bd2e
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/FrameStatsResult.kt
M benchmark/benchmark-macro/src/main/java/androidx/benchmark/macro/MacrobenchmarkScope.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/FrameStatsResultTest.kt
M benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/MacrobenchmarkScopeTest.kt
na...@google.com <na...@google.com> #7
This bug was linked in a change in the following release(s):
androidx.benchmark:benchmark-macro:1.2.0-alpha04
Description
Version used:1.1.0
Devices/Android versions reproduced on: Pixel 2Xl Android 11(30)
* Project uses androidx.core:core-splashscreen:1.0.0 library and method setKeepOnScreenCondition(condition: KeepOnScreenCondition) -> it takes some time to remove splash screen
* on Android 29+ lastLaunchNs is null because splashscreen delays view drawing and
```
.any {
val lastFrameTimestampNs = if (Build.VERSION.SDK_INT >= 29) {
it.lastLaunchNs
} else {
it.lastFrameNs
} ?: Long.MIN_VALUE
```
returns Long.MIN_VALUE and I'm getting
```
throw IllegalStateException("Unable to confirm activity launch completion $lastFrameStats" +
" Please report a bug with the output of" +
" `adb shell dumpsys gfxinfo $packageName framestats`")
```
Could you help me?