butterproject / butter-android

All the cool technical bits of what used to be Popcorn Time for Android
Other
315 stars 367 forks source link

Background updater seems to crash when working with high resolution files on TV version #286

Closed etodanik closed 6 years ago

etodanik commented 6 years ago

I'm playing around with backdrops, I noticed that if I start working with high res backdrops, this happens:

06-29 00:16:51.442 12897-12897/pct.droid.tv.dev W/Bitmap: Called getConfig() on a recycle()'d bitmap! This is undefined behavior!
06-29 00:16:51.442 12897-12897/pct.droid.tv.dev D/AndroidRuntime: Shutting down VM

    --------- beginning of crash
06-29 00:16:51.443 12897-12897/pct.droid.tv.dev E/AndroidRuntime: FATAL EXCEPTION: main
    Process: pct.droid.tv.dev, PID: 12897
    java.lang.IllegalArgumentException: Can't compare to a recycled bitmap!
        at android.graphics.Bitmap.sameAs(Bitmap.java:1888)
        at android.support.v17.leanback.app.BackgroundManager.sameDrawable(BackgroundManager.java:979)
        at android.support.v17.leanback.app.BackgroundManager$ChangeBackgroundRunnable.runTask(BackgroundManager.java:1015)
        at android.support.v17.leanback.app.BackgroundManager$ChangeBackgroundRunnable.run(BackgroundManager.java:1003)
        at android.os.Handler.handleCallback(Handler.java:790)
        at android.os.Handler.dispatchMessage(Handler.java:99)
        at android.os.Looper.loop(Looper.java:164)
        at android.app.ActivityThread.main(ActivityThread.java:6494)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)

    --------- beginning of system
06-29 00:16:51.446 12897-12897/pct.droid.tv.dev I/Process: Sending signal. PID: 12897 SIG: 9
blazsolar commented 6 years ago

There was an issue with Glide calling recycle() on Bitmap before BackgroundManager actually updated the image. There is a there is a temporary fix available in develop. I have also create new issue #288 to improve current functionality.