fixup! Add placeholder when media control title is blank
This is a squash of a revert of c332fc52 and the version of that "Add placeholder when media control title is blank" commit from Google's android-platform-12.1.0_r20 tag. The original commit contains a huge error. On the first condition checking for if 'song' is null, the following line of code under it: song = metadata?.getString(MediaMetadata.METADATA_KEY_TITLE) is changed to: song = metadata.getString(MediaMetadata.METADATA_KEY_TITLE) That change causes crashes within SystemUI with the following null pointer exception whenever an app tries to restore a previous media playback session: AndroidRuntime: FATAL EXCEPTION: SysUiBg AndroidRuntime: Process: com.android.systemui, PID: 3016 AndroidRuntime: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String android.media.MediaMetadata.getString(java.lang.String)' on a null object reference AndroidRuntime: at com.android.systemui.media.MediaDataManager.loadMediaDataInBg(MediaDataManager.kt:584) AndroidRuntime: at com.android.systemui.media.MediaDataManager.access$loadMediaDataInBg(MediaDataManager.kt:96) AndroidRuntime: at com.android.systemui.media.MediaDataManager$loadMediaData$1.run(MediaDataManager.kt:354) AndroidRuntime: at android.os.Handler.handleCallback(Handler.java:938) AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:99) AndroidRuntime: at android.os.Looper.loopOnce(Looper.java:201) AndroidRuntime: at android.os.Looper.loop(Looper.java:288) AndroidRuntime: at android.os.HandlerThread.run(HandlerThread.java:67 The commit from the android-platform-12.1.0_r20 tag correctly keeps the former variant of the line, and, while the original commit has incorrect changes to 'MediaDataManagerTest', it also has correct changes. So, this commit reverts that line to that former variant and corrects changes to MediaDataManagerTest. Change-Id: I293a046814de67419fd97dbf6dc98dc3bcd5618c
Loading
Please register or sign in to comment