Status Update
Comments
cc...@google.com <cc...@google.com> #2
Branch: androidx-master-dev
commit c60f33e229e31ab328ef6b59dab63b264954831c
Author: Alexandre Elias <aelias@google.com>
Date: Fri Jul 10 16:23:09 2020
Semantics no-op cleanups
Partly in response to lmr's broad code review, I did a pass of
superficial API/implementation cleanup. The main changes are:
- I changed each Boolean SemanticsProperty where false is equivalent to
not being present to take "Unit" instead. This is conceptually
clearer: it avoids questions like "can I cancel out a semantics from a
merged child by setting it to false?" Because "property = Unit" looks
weird, I also changed the style of these to "property()".
- I moved the Semantics id generator closer to where it's used, in
SemanticsModifierCore. I made it internal and an AtomicInt.
(Note that integer ids are heavily used in the Android
AccessibilityNodeInfo APIs so I can't simply remove them entirely.)
- I deleted dead code. Some examples include SemanticsHintOverrides,
a public API not connected to anything, and SemanticsPropertyKey
merge() open method which is never called. (In both cases I have
a different plan in mind for accessibility.)
Fixes: 145951226
Fixes: 145955412
Test: existing tests
Relnote: "Single-value semantics properties now use a calling style.
For example, 'semantics { hidden = true }' is now written as:
'semantics { hidden() }'."
Change-Id: Ic1afd12ea22c926babc9662f1804d80b33aa0cfc
M ui/integration-tests/benchmark/src/androidTest/java/androidx/ui/benchmark/test/LayoutNodeModifierBenchmark.kt
M ui/ui-core/api/0.1.0-dev15.txt
M ui/ui-core/api/current.txt
M ui/ui-core/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-core/api/public_plus_experimental_current.txt
M ui/ui-core/api/restricted_0.1.0-dev15.txt
M ui/ui-core/api/restricted_current.txt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/graphics/vector/VectorTest.kt
M ui/ui-core/src/androidAndroidTest/kotlin/androidx/ui/semantics/SemanticsTests.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidActuals.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeView.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidComposeViewAccessibilityDelegateCompat.kt
M ui/ui-core/src/androidMain/kotlin/androidx/ui/core/AndroidPopup.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/Expect.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsConfiguration.kt
D ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsHintOverrides.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsModifier.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsNode.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsOwner.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/core/semantics/SemanticsWrapper.kt
M ui/ui-core/src/commonMain/kotlin/androidx/ui/semantics/SemanticsProperties.kt
M ui/ui-foundation/api/0.1.0-dev15.txt
M ui/ui-foundation/api/current.txt
M ui/ui-foundation/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-foundation/api/public_plus_experimental_current.txt
M ui/ui-foundation/api/restricted_0.1.0-dev15.txt
M ui/ui-foundation/api/restricted_current.txt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Clickable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Dialog.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/Scroller.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Selectable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/selection/Toggleable.kt
M ui/ui-foundation/src/main/java/androidx/ui/foundation/semantics/FoundationSemanticsProperties.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ButtonTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CardTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/CheckboxScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/RadioButtonScreenshotTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ScaffoldTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SnackbarTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/SurfaceTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/ripple/RippleIndicationTest.kt
M ui/ui-material/src/androidTest/java/androidx/ui/material/textfield/TextFieldScreenshotTest.kt
M ui/ui-material/src/main/java/androidx/ui/material/AppBar.kt
M ui/ui-material/src/main/java/androidx/ui/material/TextFieldImpl.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/AssertsTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/CallSemanticsActionTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ErrorMessagesTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/FindersTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/PrintToStringTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/ScrollToTest.kt
M ui/ui-test/src/androidTest/java/androidx/ui/test/TextActionsTest.kt
M ui/ui-test/src/main/java/androidx/ui/test/Actions.kt
M ui/ui-test/src/main/java/androidx/ui/test/Filters.kt
M ui/ui-text/api/0.1.0-dev15.txt
M ui/ui-text/api/current.txt
M ui/ui-text/api/public_plus_experimental_0.1.0-dev15.txt
M ui/ui-text/api/public_plus_experimental_current.txt
M ui/ui-text/api/restricted_0.1.0-dev15.txt
M ui/ui-text/api/restricted_current.txt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/CoreTextField.kt
M ui/ui-text/src/commonMain/kotlin/androidx/ui/text/TextSemanticsProperties.kt
cc...@google.com <cc...@google.com> #3
Able to repro locally with a user build, looking into it.
cc...@google.com <cc...@google.com> #4
Issue is missing manifest tag in profileinstaller. Tests failed to catch it, due to userdebug builds bypassing this check.
Fix out for review here:
Workaround is to add the following in the target app manifest (not benchmark module), within application tag:
<receiver
android:name="androidx.profileinstaller.ProfileInstallReceiver"
android:permission="android.permission.DUMP"
android:exported="true">
<intent-filter>
<action
android:name="androidx.profileinstaller.action.BENCHMARK_OPERATION" />
</intent-filter>
</receiver>
ap...@google.com <ap...@google.com> #5
Branch: androidx-main
commit 483b47a4eb0273d3703f10bfe0018fb530fd611f
Author: Chris Craik <ccraik@google.com>
Date: Thu Nov 10 15:11:44 2022
Fix failed broadcast in ProfileInstaller
Fixes: 258619948
Test: ProfileInstallerBroadcastTest on a user build
Relnote: "Fix MacrobenchmarkScope.dropShaderCache() to no longer crash by fixing broadcast registry in profileinstaller manifest"
This wasn't captured in tests since manifest check is bypassed by rooted devices :|
Change-Id: I5c728449d99419a7599451414fe09f82c5970d3d
A benchmark/benchmark-macro/src/androidTest/java/androidx/benchmark/macro/ProfileInstallBroadcastTest.kt
M profileinstaller/profileinstaller/src/main/AndroidManifest.xml
ju...@google.com <ju...@google.com> #6
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.benchmark:benchmark-macro:1.2.0-alpha08
na...@google.com <na...@google.com> #7
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.profileinstaller:profileinstaller:1.3.0-alpha03
ge...@gmail.com <ge...@gmail.com> #8
### dependencies ###
implementation("androidx.test.ext:junit:1.1.5")
implementation("androidx.test.espresso:espresso-core:3.5.1")
implementation("androidx.test.uiautomator:uiautomator:2.2.0")
implementation("androidx.benchmark:benchmark-macro-junit4:1.2.0-alpha09")
### Error ###
java.lang.IllegalStateException: The DROP_SHADER_CACHE broadcast was not received. This most likely means that the `androidx.profileinstaller` library used by the target apk is old. Please use `1.3.0-alpha02` or newer. For more information refer to the release notes at
at androidx.benchmark.macro.MacrobenchmarkScope.dropShaderCache(MacrobenchmarkScope.kt:251)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmarkWithStartupMode$1.invoke(Macrobenchmark.kt:383)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmarkWithStartupMode$1.invoke(Macrobenchmark.kt:365)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmark$measurements$1.invoke(Macrobenchmark.kt:208)
at androidx.benchmark.macro.MacrobenchmarkKt$macrobenchmark$measurements$1.invoke(Macrobenchmark.kt:199)
at androidx.benchmark.macro.perfetto.PerfettoTraceProcessor$Companion.runServer(PerfettoTraceProcessor.kt:70)
at androidx.benchmark.macro.perfetto.PerfettoTraceProcessor$Companion.runServer$default(PerfettoTraceProcessor.kt:53)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmark(Macrobenchmark.kt:199)
at androidx.benchmark.macro.MacrobenchmarkKt.macrobenchmarkWithStartupMode(Macrobenchmark.kt:365)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated(MacrobenchmarkRule.kt:107)
at androidx.benchmark.macro.junit4.MacrobenchmarkRule.measureRepeated$default(MacrobenchmarkRule.kt:97)
at com.kata.mobile.macrobenchmark.ExampleStartupBenchmark.startup(ExampleStartupBenchmark.kt:34)
Getting this exception after commenting removing pressHome() as the work around tried in
### Android studio info ###
Android Studio Electric Eel | 2022.1.1
Build #AI-221.6008.13.2211.9477386, built on January 11, 2023
Runtime version: 11.0.15+0-b2043.56-8887301 aarch64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o.
macOS 13.1
GC: G1 Young Generation, G1 Old Generation
Memory: 3072M
Cores: 10
Registry:
external.system.auto.import.disabled=true
ide.text.editor.with.preview.show.floating.toolbar=false
Non-Bundled Plugins:
net.codestats.plugin.atom.intellij (1.0.9)
com.github.copilot (1.1.38.2229)
com.microsoft.vso.idea (1.162.1)
da...@emirates.com <da...@emirates.com> #10
di...@okcredit.in <di...@okcredit.in> #11
cc...@google.com <cc...@google.com> #12
Note that we added extra debugging logging here in benchmark 1.3 though that doesn't change behavior, just added clarification and debugging steps:
If you still see this problem with profileinstaller 1.3.1, please try the following steps:
-
open your target (app) apk in studio and look for the
androidx.profileinstaller.ProfileInstallReceiver
to be present and unobfuscated in both your application manifest as a receiver, and in your dex -
when your target app is installed, try running
adb shell am broadcast -a androidx.profileinstaller.action.BENCHMARK_OPERATION -e DROP_SHADER_CACHE <yourapppackage>/androidx.profileinstaller.ProfileInstallReceiver
- it should print '14' as a response code if it's in your app and working correctly.
ke...@netflix.com <ke...@netflix.com> #13
I've verified that ProfileInstallReceiver is in the app's -benchmark.apk as well as the manifest. See screenshots.
Running the adb command also returns this:
% adb shell am broadcast -a androidx.profileinstaller.action.BENCHMARK_OPERATION -e EXTRA_BENCHMARK_OPERATION DROP_SHADER_CACHE com.netflix.mediaclient/androidx.profileinstaller.ProfileInstallReceiver
Broadcasting: Intent { act=androidx.profileinstaller.action.BENCHMARK_OPERATION flg=0x400000 cmp=com.netflix.mediaclient/androidx.profileinstaller.ProfileInstallReceiver (has extras) }
Broadcast completed: result=0
cc...@google.com <cc...@google.com> #14
Would also appreciate if you can try on different devices/emulators, and see if it works on some of them - I'm wondering if there's a device-specific issue you're hitting
On my Pixel6 Pro running Android 15 (API 35), running production Netflix (versionName=8.141.0 build 10 51376
), I see the command works as expected:
adb shell am broadcast -a androidx.profileinstaller.action.BENCHMARK_OPERATION -e EXTRA_BENCHMARK_OPERATION DROP_SHADER_CACHE com.netflix.mediaclient/androidx.profileinstaller.ProfileInstallReceiver
Broadcasting: Intent { act=androidx.profileinstaller.action.BENCHMARK_OPERATION flg=0x400000 cmp=com.netflix.mediaclient/androidx.profileinstaller.ProfileInstallReceiver (has extras) }
Broadcast completed: result=14
Description
Component used: Macrobench 1.2.0-alpha06, profileInstaller 1.3.0-alpha02
Devices/Android versions reproduced on: Pixel 7 API 33 user build
Running macrobenchmarks with the latest alpha versions is not possible on user builds due to (reproduced in Now In Android and Macrobenchmark samples)