jroal / a2dpvolume

Automatically exported from code.google.com/p/a2dpvolume
http://jimroal.com/slist.htm
95 stars 33 forks source link

Crash when headset plug used and responding to headset #223

Closed jroal closed 5 years ago

jroal commented 8 years ago

Crash report from Play Store. Missing small icon for headset plug.

ava.lang.RuntimeException: Error receiving broadcast Intent { act=android.intent.action.HEADSET_PLUG flg=0x40000010 bqHint=4 (has extras) } in a2dp.Vol.service$4@8c124de at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:1003) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:158) at android.app.ActivityThread.main(ActivityThread.java:7229) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1230) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1120) Caused by: java.lang.IllegalArgumentException: Invalid notification (no valid small icon): Notification(pri=-2 contentView=a2dp.Vol/0x10900b3 vibrate=null sound=null defaults=0x0 flags=0x0 color=0x00000000 vis=PRIVATE secFlags=0x0 secPriority=0) at android.app.NotificationManager.notify(NotificationManager.java:255) at android.app.NotificationManager.notify(NotificationManager.java:211) at a2dp.Vol.service.updateNot(service.java:1135) at a2dp.Vol.service.DoDisconnected(service.java:958) at a2dp.Vol.service$4.onReceive(service.java:486) at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:993)

jroal commented 5 years ago

I actually found many icon issues and fixed them in 2.12.10. The problem is the device database was storing the integer that referenced the icons but the icon resource integers can changes by release making the stored icon integer no longer reference a real resource. I now added a few checks but the most important one in the database itself where it makes sure only valid icon resources are returned. If an invalid one is stored, it will be replaced by the car icon.