Status Update
Comments
[Deleted User] <[Deleted User]> #2
Any updates on this? It's been a month already since I reported it, and it seems this crash is occurring quite frequently for my users.
al...@google.com <al...@google.com> #3
I am still regularly receiving reports about this issue, and it seems it has not been addressed in the latest 1.4.0-rc01 release.
ju...@google.com <ju...@google.com> #4
Seems like a fairly easy fix on our end. I'll see to that it is fixed in 1.5.
ju...@google.com <ju...@google.com>
[Deleted User] <[Deleted User]> #5
As the issue cannot be reproduced locally, it is difficult to obtain a bug report. However, can we analyze the available stack trace to identify any potential issues?
[Deleted User] <[Deleted User]> #6
Any update on this issue?
[Deleted User] <[Deleted User]> #7
Actually this issue reports the problem at two different points. Stack-traces for both instances are being shared.
The first one occurs when an application attempts to send a notification by calling the NotificationManager.notify method on the Android NotificationManager (). The second occurs when an app attempts to use the MediaControllerCompat.getMetadata() function to obtain information from a media session controller. Both fall on the same binder transaction, which appears to be the primary cause of such an ANR.
Note: It should be noted that the ANR related to retrieving metadata occurs only with the MediaControllerImplApi21 class, and not with the other two classes, MediaControllerImplApi29 and MediaControllerImplBase. Which is mentioned in Android Media Framework class - MediaControllerCompat.java.
Query: Could this be a device-specific problem? It appears that the majority of devices employing the Mali/MediaTek chipset are affected. I recall that this chipset has had issues with its HardwareRenderer.nSyncAndDrawFrame function. Could this be relevant?
~/android/support/v4/media/session/MediaControllerCompat.java
public MediaControllerCompat(Context context, @NonNull MediaSessionCompat.Token sessionToken) {
if (sessionToken == null) {
throw new IllegalArgumentException("sessionToken must not be null");
}
mRegisteredCallbacks = Collections.synchronizedSet(new HashSet<>());
mToken = sessionToken;
if (Build.VERSION.SDK_INT >= 29) {
mImpl = new MediaControllerImplApi29(context, sessionToken);
} else if (Build.VERSION.SDK_INT >= 21) {
mImpl = new MediaControllerImplApi21(context, sessionToken);
} else {
mImpl = new MediaControllerImplBase(sessionToken);
}
}
ANR Stack-traces:
NotificationManager.notify()
main (native):tid=1 systid=12813
#00 pc 0x86f8c libc.so (syscall + 28)
#01 pc 0x1b089c libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 148)
#02 pc 0x674698 libart.so (art::GoToRunnable(art::Thread*) + 480)
#03 pc 0x674474 libart.so (art::JniMethodEnd(unsigned int, art::Thread*) + 28)
at android.os.BinderProxy.transactNative(BinderProxy.java)
at android.os.BinderProxy.transact(BinderProxy.java:565)
at android.app.INotificationManager$Stub$Proxy.enqueueNotificationWithTag(INotificationManager.java:3355)
at android.app.NotificationManager.notifyAsUser(NotificationManager.java:610)
at android.app.NotificationManager.notify(NotificationManager.java:560)
at androidx.core.app.NotificationManagerCompat.notify(NotificationManagerCompat.java:227)
at androidx.core.app.NotificationManagerCompat.notify(NotificationManagerCompat.java:208)
at com.audiomack.playback.MusicService$MediaControllerCallback.updateNotification(MusicService.kt:934)
at com.audiomack.playback.MusicService$MediaControllerCallback.onPlaybackStateChanged(MusicService.kt:907)
at android.support.v4.media.session.MediaControllerCompat$Callback$MessageHandler.handleMessage(MediaControllerCompat.java:1088)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:257)
at android.app.ActivityThread.main(ActivityThread.java:8192)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:626)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1015)
MediaControllerCompat.getMetadata()
main (native):tid=1 systid=1646
#00 pc 0x5ddec libc.so (syscall + 28)
#01 pc 0x130dc9 libart.so (art::ConditionVariable::WaitHoldingLocks(art::Thread*) + 88)
#02 pc 0x4d8c83 libart.so (art::GoToRunnable(art::Thread*) + 342)
#03 pc 0x4d8b05 libart.so (art::JniMethodEnd(unsigned int, art::Thread*) + 8)
at android.os.BinderProxy.transactNative(BinderProxy.java)
at android.os.BinderProxy.transact(BinderProxy.java:540)
at android.media.session.ISessionController$Stub$Proxy.getMetadata(ISessionController.java:1589)
at android.media.session.MediaController.getMetadata(MediaController.java:162)
at android.support.v4.media.session.MediaControllerCompat$MediaControllerImplApi21.getMetadata(MediaControllerCompat.java:2111)
at android.support.v4.media.session.MediaControllerCompat.getMetadata(MediaControllerCompat.java:301)
at com.audiomack.playback.MusicService$MediaControllerCallback.updateNotification(MusicService.kt:702)
at com.audiomack.playback.MusicService$MediaControllerCallback.onPlaybackStateChanged(MusicService.kt:695)
at android.support.v4.media.session.MediaControllerCompat$Callback$MessageHandler.handleMessage(MediaControllerCompat.java:1088)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:223)
at android.app.ActivityThread.main(ActivityThread.java:7740)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:612)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:997)
[Deleted User] <[Deleted User]> #8
Please provide an acknowledgment in this space to confirm that you have received the shared information and that the issue is being tracked. Currently, there are no assigned Googlers or CCs for this issue.
Description
Component used: androidx.core.app.NotificationManagerCompat.java
Devices/Android versions reproduced on: Techno mobile(40%), Samsung(19%), rest & Android 11, 12, 13
Describe the bug
This ANR has been reported by the notification component for a while. The stack indicates that the binder proxy call that resulted in the ANR was stuck. It seems relevant to Google to the quick look.
Stack-trace
Additional context
It's a simple call, so I'm not sure why it got stopped on the native call. Perhaps the device may not in its most ideal state, or there may be another factor. Down the line, the framework call uses getServices, which could be a blocking call.