Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit ab6c7531 authored by Roman Birg's avatar Roman Birg
Browse files

AudioService: fix crash when no music player found



Change-Id: I02a074a46a07384fef2ab6916663940214b62883
Signed-off-by: default avatarRoman Birg <roman@cyngn.com>
parent 030132cb
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.bluetooth.BluetoothClass;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothHeadset;
import android.bluetooth.BluetoothProfile;
import android.content.ActivityNotFoundException;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.ContentResolver;
@@ -4761,7 +4762,11 @@ public class AudioService extends IAudioService.Stub {
            Intent playerIntent = new Intent(Intent.ACTION_MAIN);
            playerIntent.addCategory(Intent.CATEGORY_APP_MUSIC);
            playerIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            try {
                mContext.startActivity(playerIntent);
            } catch(ActivityNotFoundException e) {
                Log.e(TAG, "error launching music player", e);
            }
        }
    }