Added toggle to play on Bluetooth device
This commit is contained in:
parent
d2284f410d
commit
27141c1bd2
4 changed files with 36 additions and 12 deletions
|
@ -282,9 +282,9 @@ public class MusicService extends Service implements
|
|||
@Override
|
||||
public void onReceive(final Context context, final Intent intent) {
|
||||
String action = intent.getAction();
|
||||
Log.i(TAG, "onReceive: " + action);
|
||||
if (action != null) {
|
||||
if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action)) {
|
||||
if (BluetoothDevice.ACTION_ACL_CONNECTED.equals(action) &&
|
||||
PreferenceUtil.getInstance(context).bluetoothSpeaker()) {
|
||||
if (VERSION.SDK_INT >= VERSION_CODES.M) {
|
||||
if (getAudioManager().getDevices(AudioManager.GET_DEVICES_OUTPUTS).length > 0) {
|
||||
play();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue