ANR MediaButtonReceiver.buildMediaButtonPendingIntent

时间:2019-05-26 10:00:58

标签: android notifications

我们的应用主要在Samsung设备上面临ANR(占92%),这可能是什么原因

"main" prio=5 tid=1 Native
  | group="main" sCount=1 dsCount=0 flags=1 obj=0x74127760 self=0xec103000
  | sysTid=13922 nice=0 cgrp=default sched=0/0 handle=0xf0af34bc
  | state=S schedstat=( 543076646889 26480982714 1128804 ) utm=31752 stm=22555 core=6 HZ=100
  | stack=0xff5bd000-0xff5bf000 stackSize=8MB
  | held mutexes=
  #00  pc 0000000000018e98  /system/lib/libc.so (syscall+28)
  #01  pc 00000000000b3555  /system/lib/libart.so (_ZN3art17ConditionVariable16WaitHoldingLocksEPNS_6ThreadE+88)
  #02  pc 00000000003bc383  /system/lib/libart.so (_ZN3artL12GoToRunnableEPNS_6ThreadE+306)
  #03  pc 00000000003bc221  /system/lib/libart.so (_ZN3art12JniMethodEndEjPNS_6ThreadE+8)
  #04  pc 000000000081b851  /system/framework/arm/boot-framework.oat (Java_android_os_BinderProxy_transactNative__ILandroid_os_Parcel_2Landroid_os_Parcel_2I+144)
  at android.os.BinderProxy.transactNative (BinderProxy.java)
  at android.os.BinderProxy.transact (BinderProxy.java:761)
  at android.content.pm.IPackageManager$Stub$Proxy.queryIntentReceivers (IPackageManager.java:4705)
  at android.app.ApplicationPackageManager.queryBroadcastReceiversAsUser (ApplicationPackageManager.java:1202)
  at android.app.ApplicationPackageManager.queryBroadcastReceivers (ApplicationPackageManager.java:1216)
  at android.support.v4.media.session.MediaButtonReceiver.getMediaButtonReceiverComponent (MediaButtonReceiver.java:285)
  at android.support.v4.media.session.MediaButtonReceiver.buildMediaButtonPendingIntent (MediaButtonReceiver.java:228)
  at NManager.generateAction (NManager.java:405) 

以下是第405行的代码

notificationBuilder.addAction(generateAction(R.drawable.pause,
                            R.string.label_pause, PlaybackStateCompat.ACTION_PAUSE));

我不确定是否可以通过同步代码来解决此问题,因为这主要发生在三星设备上。因此,任何见解都会有所帮助

0 个答案:

没有答案