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

Commit 56c02571 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge " Audio: SetForceUse config check in AudioService"

parents d7ff619f 0af88afe
Loading
Loading
Loading
Loading
+11 −2
Original line number Diff line number Diff line
@@ -1982,10 +1982,19 @@ public class AudioService extends IAudioService.Stub {
    /** @see AudioManager#setBluetoothA2dpOn(boolean) */
    public void setBluetoothA2dpOn(boolean on) {
        synchronized (mBluetoothA2dpEnabledLock) {
           int config = AudioSystem.FORCE_NONE;
           mBluetoothA2dpEnabled = on;
           config = AudioSystem.getForceUse(AudioSystem.FOR_MEDIA);
           if((config == AudioSystem.FORCE_BT_A2DP) && (!mBluetoothA2dpEnabled)) {
               config = AudioSystem.FORCE_NO_BT_A2DP;
           } else if(mBluetoothA2dpEnabled) {
               config = AudioSystem.FORCE_NONE;
           }
           Log.d(TAG, "BTEnabled "+mBluetoothA2dpEnabled+" config "+config);

            sendMsg(mAudioHandler, MSG_SET_FORCE_BT_A2DP_USE, SENDMSG_QUEUE,
                    AudioSystem.FOR_MEDIA,
                    mBluetoothA2dpEnabled ? AudioSystem.FORCE_NONE : AudioSystem.FORCE_NO_BT_A2DP,
                    config,
                    null, 0);
        }
    }