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

Commit 578333c0 authored by Satya Krishna Pindiproli's avatar Satya Krishna Pindiproli Committed by Steve Kondik
Browse files

Revert " Audio: SetForceUse config check in AudioService"

This reverts commit 0af88afe.

- During playback over BT using the Google Play Music app,
  if BT is disconnected through the app and playback is resumed,
  it continues over BT and not the speaker.
- The original commit forces playback to continue over BT
  although it is disconnected.
- Reverting the commit fixes this issue and the issue
  addressed by the commit is also not observed after reversion.

CRs-Fixed: 679301
Change-Id: Ic4d0f13615c696a12401f7a8a58651b88f31e99b
parent 5b86072a
Loading
Loading
Loading
Loading
+2 −11
Original line number Diff line number Diff line
@@ -2066,19 +2066,10 @@ 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,
                    config,
                    mBluetoothA2dpEnabled ? AudioSystem.FORCE_NONE : AudioSystem.FORCE_NO_BT_A2DP,
                    null, 0);
        }
    }