1
0
mirror of https://github.com/ultrasonic/ultrasonic synced 2025-02-16 11:41:16 +01:00

Fix null reference on A2DP broadcast

This commit is contained in:
Joshua Bahnsen 2013-07-18 10:05:02 -07:00
parent 1f6fa55bbb
commit 47d23aa474
2 changed files with 8 additions and 6 deletions

View File

@ -2,8 +2,8 @@
<manifest xmlns:a="http://schemas.android.com/apk/res/android"
package="com.thejoshwa.ultrasonic.androidapp"
a:installLocation="auto"
a:versionCode="32"
a:versionName="1.2.0.5" >
a:versionCode="33"
a:versionName="1.2.0.6" >
<uses-permission a:name="android.permission.INTERNET" />
<uses-permission a:name="android.permission.READ_PHONE_STATE" />

View File

@ -914,14 +914,16 @@ public class Util extends DownloadActivity {
}
public static void broadcastA2dpPlayStatusChange(Context context, PlayerState state, DownloadService downloadService) {
if (!Util.getShouldSendBluetoothNotifications(context)) {
if (!Util.getShouldSendBluetoothNotifications(context) || downloadService == null) {
return;
}
if (downloadService.getCurrentPlaying() != null) {
DownloadFile currentPlaying = downloadService.getCurrentPlaying();
if (currentPlaying != null) {
Intent avrcpIntent = new Intent(CM_AVRCP_PLAYSTATE_CHANGED);
Entry song = downloadService.getCurrentPlaying().getSong();
Entry song = currentPlaying.getSong();
if (song == null) {
return;