Fixed
Status Update
Comments
ap...@google.com <ap...@google.com> #2
Project: platform/frameworks/support
Branch: androidx-main
commit 9905c64f5b25d9c0872472e0345c2474ff579f93
Author: Chris Craik <ccraik@google.com>
Date: Tue Mar 05 15:58:05 2024
Add newline to IDE warnings so it's on a separate line from results
Fixes: 328308833
Test: InstrumentationResultsTest
Relnote: "Fixes method tracing warning to be on separate line from
microbench output"
Change-Id: I0455c4edcdc592c56e60dd19bd32d9bd33f6af6a
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/InstrumentationResultsTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/InstrumentationResults.kt
https://android-review.googlesource.com/2989187
Branch: androidx-main
commit 9905c64f5b25d9c0872472e0345c2474ff579f93
Author: Chris Craik <ccraik@google.com>
Date: Tue Mar 05 15:58:05 2024
Add newline to IDE warnings so it's on a separate line from results
Fixes: 328308833
Test: InstrumentationResultsTest
Relnote: "Fixes method tracing warning to be on separate line from
microbench output"
Change-Id: I0455c4edcdc592c56e60dd19bd32d9bd33f6af6a
M benchmark/benchmark-common/src/androidTest/java/androidx/benchmark/InstrumentationResultsTest.kt
M benchmark/benchmark-common/src/main/java/androidx/benchmark/InstrumentationResults.kt
an...@mutualmobile.com <an...@mutualmobile.com> #3
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-common:1.3.0-alpha02
cc...@google.com <cc...@google.com> #4
To get this fix, you'll need to update benchmark dependencies to 1.2.0-alpha03
, just
As a workaround on older versions, you can copy the method with the fix into a new extension:
public fun MacrobenchmarkScope.startActivityAndWaitWorkaround(
block: (Intent) -> Unit = {}
) {
val intent = context.packageManager.getLaunchIntentForPackage(packageName)
?: context.packageManager.getLeanbackLaunchIntentForPackage(packageName)
?: throw IllegalStateException("Unable to acquire intent for package $packageName")
block(intent)
startActivityAndWait(intent)
}
na...@google.com <na...@google.com> #5
This bug was linked in a change in the following release(s):
androidx.benchmark:benchmark-macro:1.2.0-alpha03
Description
Component used: Macrobenchmark module Version used: benchmark-macro-junit4:1.2.0-alpha01 Devices/Android versions reproduced on: Android TV
Running macrobenchmark test on any AndroidTV application which doesn't have
<category android:name="android.intent.category.LAUNCHER" />
but instead has only<category android:name="android.intent.category.LEANBACK_LAUNCHER" />
for the launcher activity, will result in Unable to acquire intent for package becauseMacroBenchmarkScope.startActivityAndWait()
is relying only oncontext.packageManager.getLaunchIntentForPackage()
and not ongetLeanbackLaunchIntentForPackage()
Instead of throwing exception immediately, you could try to grab launch intent by calling
getLeanbackLaunchIntentForPackage()
if the first one fails.