Status Update
Comments
su...@google.com <su...@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
su...@google.com <su...@google.com> #3
Banseok, do you know where to reroute this issue?
pu...@gmail.com <pu...@gmail.com> #4
Any news on this.
Now have seen this crash for 16 unique users. Not much in the grand scheme of things, but still would be useful to have a workaround in the library, catching that IllegalArgumentException somewhere in that stack trace and ignoring it (maybe dumping the stack trace in the log cat).
fe...@tv2.no <fe...@tv2.no> #5
The crash seems to be slightly increasing with Android 12. Could this error being handled on MediaRouter library?
pu...@gmail.com <pu...@gmail.com> #6
Still happening more and more. Here's an Android 11 stack trace. Please do something about it, even if it is a Samsung specific bug, as it cannot be worked-around at the app level:
java.lang.IllegalArgumentException: Bad stream type -1
at android.os.Parcel.createExceptionOrNull(Parcel.java:2441)
at android.os.Parcel.createException(Parcel.java:2421)
at android.os.Parcel.readException(Parcel.java:2404)
at android.os.Parcel.readException(Parcel.java:2346)
at android.media.IAudioService$Stub$Proxy.getDevicesForStream(IAudioService.java:6999)
at android.media.MediaRouter.isAudioPathA2DPStatic(MediaRouter.java:3310)
at android.media.MediaRouter.selectDefaultRouteStatic(MediaRouter.java:1172)
at android.media.MediaRouter.removeRouteStatic(MediaRouter.java:1288)
at android.media.MediaRouter.removeUserRoute(MediaRouter.java:1244)
at androidx.mediarouter.media.MediaRouterJellybean.removeUserRoute(MediaRouterJellybean.java:110)
at androidx.mediarouter.media.SystemMediaRouteProvider$JellybeanImpl.onSyncRouteRemoved(SystemMediaRouteProvider.java:493)
at androidx.mediarouter.media.MediaRouter$GlobalMediaRouter$CallbackHandler.syncWithSystemProvider(MediaRouter.java:3654)
at androidx.mediarouter.media.MediaRouter$GlobalMediaRouter$CallbackHandler.handleMessage(MediaRouter.java:3622)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:226)
at android.os.Looper.loop(Looper.java:313)
at android.app.ActivityThread.main(ActivityThread.java:8633)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:567)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1135)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.audio.AudioService.ensureValidStreamType(AudioService.java:6407)
at com.android.server.audio.AudioService.getDevicesForStream(AudioService.java:6740)
at android.media.IAudioService$Stub.onTransact(IAudioService.java:3157)
at android.os.Binder.execTransactInternal(Binder.java:1215)
at android.os.Binder.execTransact(Binder.java:1179)
android.os.RemoteException: Remote stack trace:
at com.android.server.audio.AudioService.ensureValidStreamType(AudioService.java:6407)
at com.android.server.audio.AudioService.getDevicesForStream(AudioService.java:6740)
at android.media.IAudioService$Stub.onTransact(IAudioService.java:3157)
at android.os.Binder.execTransactInternal(Binder.java:1215)
at android.os.Binder.execTransact(Binder.java:1179)
pu...@gmail.com <pu...@gmail.com> #7
Stack trace above is from a Samsung Android 12 device (not 11 as stated).
sz...@gmail.com <sz...@gmail.com> #8
Have same problem. For now 67 users affected, mostly android 12, 100% samsung
da...@bt.com <da...@bt.com> #9
It'd be great if it could be caught, but ultimately this looks like a Samsung bug.
ba...@google.com <ba...@google.com>
ma...@persgroep.net <ma...@persgroep.net> #10
- 100% Samsung, of which most are of the type Galaxy A52s 5G and Galaxy A51
- 100% Android 12
- 98% App in background
Unfortunately we don't seem to be the ones initiating some sort of action so we can't catch the exception in our application code.
pu...@gmail.com <pu...@gmail.com> #11
This is happening more and more... Apparently, there does not seem to be an incentive from Google to workaround it in this library probably because "not our problem" (it is a Samsung bug). The only thing we can do is to decompile mediarouter and catch the IllegalArguementException ourselves...
sz...@gmail.com <sz...@gmail.com> #12
Any chance to fix this in somehow? 200+ users in my app has this error. 100% Samsung 99% - android 12 1% - android 11
pu...@gmail.com <pu...@gmail.com> #13
I finally patched androidx.mediarouter:mediarouter:1.3.0
with IllegalArgumentException
:
in androidx.mediarouter.media.MediaRouterJellybean
, I changed:
public static void removeUserRoute(Object routerObj, Object routeObj) {
((MediaRouter)routerObj).removeUserRoute((MediaRouter.UserRouteInfo)routeObj);
}
to:
public static void removeUserRoute(Object routerObj, Object routeObj) {
try {
((MediaRouter)routerObj).removeUserRoute((MediaRouter.UserRouteInfo)routeObj);
}
catch (IllegalArgumentException ex) {
Log.w(TAG, "android.media.MediaRouter.removeUserRoute() failed with IllegalArgumentException (Samsung Android 12 bug work-around)", ex);
}
}
To use it:
- download
https://bubblesoftapps.com/mediarouter-samsung-fix/mediarouter-samsung-fix-1.3.0.zip - unzip in your .m2/repository folder so you end up having /path/to/.m2/repository/androidx/mediarouter/mediarouter-samsung-fix/
- update your build.gradle to use it: replace
implementation 'androidx.mediarouter:mediarouter:1.3.0'
withimplementation 'androidx.mediarouter:mediarouter-samsung-fix:1.3.0'
- if you have an AndroidX dependency pulling 'androidx.mediarouter:mediarouter', you will have to exclude it so it does not get in the way (duplicate classes). For example, the cast sdk needs it:
implementation('com.google.android.gms:play-services-cast:21.0.1') {
// replaced by mediarouter-samsung-fix
exclude group: 'androidx.mediarouter'
}
ol...@google.com <ol...@google.com> #14
We have made Samsung aware of this issue. It makes sense for us to catch the exception in the AndroidX MediaRouter library, as per #13, as well.
ap...@google.com <ap...@google.com> #15
Branch: androidx-main
commit c3805953951058b509f629980ffad858c7a531ee
Author: Oliver Woodman <olly@google.com>
Date: Fri May 20 13:35:47 2022
Workaround for crash removing user routes.
Test: N/A
Bug: 202931542
Change-Id: Ia25cd716cf2cd48ec298aff04e13751cbcb27d45
M mediarouter/mediarouter/src/main/java/androidx/mediarouter/media/MediaRouterJellybean.java
pu...@gmail.com <pu...@gmail.com> #16
Thanks for the fix (or rather, work-around) !
ol...@google.com <ol...@google.com> #17
Samsung have a fix for the underlying issue, and will roll it out to their devices in future maintenance releases.
pu...@gmail.com <pu...@gmail.com> #18
Glad to hear that ! Thanks for your report to Samsung, and for Samsung devs to fix it.
bl...@moshikids.com <bl...@moshikids.com> #19
Thanks!
ol...@google.com <ol...@google.com> #20
AndroidX MediaRouter 1.3.1 will pick up the fix, and is scheduled for release on July 27th.
bu...@google.com <bu...@google.com> #21
na...@google.com <na...@google.com> #22
The following release(s) address this bug.It is possible this bug has only been partially addressed:
androidx.mediarouter:mediarouter:1.4.0-alpha01
Description
Component used: androidx.mediarouter:mediarouter Version used: 1.2.5 Devices/Android versions reproduced on: Samsung / Android 11
I've seen crash below happening on Samsung Android 11 devices (various models). It is fairly rare, as it happened only for 5 users 1 or twice, in an app with lots of users. Maybe it can be worked-around catching IllegalArgumentException.