AcDisplay
AcDisplay copied to clipboard
Lollipop Media controller blocks the Main thread causing an ANR
trafficstars
I'm getting a lot of similar ANR dumps.
DALVIK THREADS (34):
"main" prio=5 tid=1 Native
| group="main" sCount=1 dsCount=0 obj=0x88d85f20 self=0xb4e08000
| sysTid=8556 nice=0 cgrp=apps sched=0/0 handle=0xb6f40ec8
| state=S schedstat=( 725466118652 293085389794 1001898 ) utm=53116 stm=19430 core=1 HZ=100
| stack=0xbe004000-0xbe006000 stackSize=8MB
| held mutexes=
kernel: (couldn't read /proc/self/task/8556/stack)
native: #00 pc 00010110 /system/lib/libc.so (syscall+28)
native: #01 pc 000aa11f /system/lib/libart.so (art::ConditionVariable::Wait(art::Thread*)+82)
native: #02 pc 00281d95 /system/lib/libart.so (art::GoToRunnable(art::Thread*)+772)
native: #03 pc 000872f9 /system/lib/libart.so (art::JniMethodEnd(unsigned int, art::Thread*)+8)
native: #04 pc 0153719d /system/framework/arm/boot.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+156)
at android.os.BinderProxy.transactNative(Native method)
at android.os.BinderProxy.transact(Binder.java:496)
at android.media.session.ISessionController$Stub$Proxy.getMetadata(ISessionController.java:938)
at android.media.session.MediaController.getMetadata(MediaController.java:168)
at com.achep.acdisplay.services.media.MediaController2Lollipop.access$200(MediaController2Lollipop.java:46)
at com.achep.acdisplay.services.media.MediaController2Lollipop$2.onActiveSessionsChanged(MediaController2Lollipop.java:91)
at android.media.session.MediaSessionManager$SessionsChangedWrapper$1$1.run(MediaSessionManager.java:355)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:145)
at android.app.ActivityThread.main(ActivityThread.java:5972)
at java.lang.reflect.Method.invoke!(Native method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1388)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1183)
Hi, have you done any major update on this?, I'm currently facing the same issue I don't find a solution even using background threads.
What I have found is that this happens with specific Media Sessions, for example a Media session for Spotify when trying to recover the Album Art in the worst cases takes 5 seconds to obtain it causing an ANR, Idk if this is your case though, but, in other Music player, such as Deezer it does not happen and the Metadata is recovered quick.
Nah, I did not do much of a research on this problem.