microg / GmsCore

Free implementation of Play Services
https://microg.org
Apache License 2.0
8.73k stars 1.74k forks source link

com.pandora crashes on volume change #1407

Open zzzb123 opened 3 years ago

zzzb123 commented 3 years ago

Affected app Name: Pandora Package id: com.pandora

Describe the bug App crashes whenever the volume is changed.

To Reproduce Steps to reproduce the behavior:

  1. Open Pandora
  2. Change the volume level
  3. App crashes

Expected behavior Volume changes without a crash

Screenshots If applicable, add screenshots to help explain your problem.

System Android Version: 9 Custom ROM: LineageOS 16.0

microG microG Core version: 0.2.17.204714 microG Self-Check results: All ticked

Additional context adb says the culprit is an attempt to call CastDevice's getModelName() on a null pointer, but I was unable to figure out much beyond that.

parcelcat commented 3 years ago

Confirmed on Android 10 and 11. On Android 11, I was using Pandora 2102.1.1 and microG 0.2.18.204714.

Stack trace in device log:

FATAL EXCEPTION: main
Process: com.pandora.android, PID: 28018
java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String com.google.android.gms.cast.CastDevice.getModelName()' on a null object reference
    at com.pandora.ce.remotecontrol.googlecast.GoogleCastDevice.f(SourceFile:1)
    at com.pandora.ce.stats.CastStatsProcessor.a(SourceFile:11)
    at com.pandora.ce.stats.CastStatsHelper.a(SourceFile:8)
    at com.pandora.ce.remotecontrol.RemoteManagerImpl.onRouteVolumeChanged(SourceFile:2)
    at androidx.mediarouter.media.g$d$b.a(SourceFile:16)
    at androidx.mediarouter.media.g$d$b.handleMessage(SourceFile:13)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:223)
    at android.app.ActivityThread.main(ActivityThread.java:7660)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:592)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:947)
mjtalarczyk commented 3 years ago

Confirmed on Android 10, Pandora 2103.1, microG 0.2.18.204714.

Volume changes can be done normally after clearing Pandora app storage, but app will crash again after 2-3 uses.

parcelcat commented 3 years ago

The problem is that microG does not implement the CastDevice class found in Google Play Services.

The CastDevice class needs to be implemented and added to https://github.com/microg/GmsCore/tree/master/play-services-cast/src/main/java/com/google/android/gms/cast inside microG's com.google.android.gms.cast package.

parcelcat commented 3 years ago

This may have been fixed in ae8516a3397eb5d2c3edaef1330c0fec641ae142. Looking forward to testing this in the next release. Thanks, @mar-v-in!

parcelcat commented 2 years ago

I attempted to test this on microG 0.2.23.214816 with Pandora 2112.1. Pandora was stuck on the loading screen, which prevented me from testing out the Cast API issue. Pandora still works in a work profile with microG disabled.

sokol99 commented 2 years ago

I've had this issue for almost two years while using calyxos. Clearing the data will allow me one use of the app where adjusting the volume does not crash it. The second use will crash it with volume changes. 2203.1.

parcelcat commented 2 years ago

Pandora now fully works with microG on Android 12. It fails to go past the loading screen with microG on Android 11, unless microG is disabled (which can be done on the work profile only, if desired).

Edit: No, Pandora still crashes with microG on Android 12 when the volume is changed. I didn't test it thoroughly the first time.

sokol99 commented 2 years ago

Thanks @parcelcat. Is Pandora supported as of a specific version of microG? It's still not working for me so I want to check whether I have the update. Was it a microG fix?

parcelcat commented 2 years ago

@sokol99 I'm not sure. All I know is that microG 0.2.24.224826 0.2.24.214816 works for me with Pandora on Android 12 (Android 12L, to be precise), but that same version of microG does not work with Pandora on Android 11.

Edit: Doesn't work yet. See update.

sokol99 commented 2 years ago

Great, thanks @parcelcat. I will look for an update. My CalyxOS 3.5.1 is currently running Android 12L but is only on microG 0.2.24.214816-25 so it's a little behind what you have. What version of Pandora is working? Thanks.

parcelcat commented 2 years ago

@sokol99 Oops, that was a typo. We have the same version of microG. And Pandora just crashed when I tested it again, so I must not have tested it thoroughly. I'm going to switch Pandora to the work profile again with microG disabled. Sorry for the false hope.

sokol99 commented 2 years ago

Ok, darn. Thanks for the update...

parcelcat commented 1 year ago

@sokol99 I can confirm that Pandora 2303.1 is working with microG version 0.2.27.223616. No crashes on volume change.

sokol99 commented 1 year ago

Thanks @parcelcat , that's great!

sokol99 commented 7 months ago

Hi. I'm back on CalyxOS and having the same problem. Adjusting volume with Pandora crashes the app.

Pandora Version: 2401.1 microG Sevices version 0.3.1.240913-23