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

Commit a877427e authored by Android (Google) Code Review's avatar Android (Google) Code Review Committed by The Android Open Source Project
Browse files

am 0e3d77af: Merge change 4324 into donut

Merge commit '0e3d77af'

* commit '0e3d77af':
  AudioService: Fix routing problem recently introduced in setRouting().
parents 79423590 0e3d77af
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -668,7 +668,7 @@ public class AudioService extends IAudioService.Stub {
                        mSpeakerIsOn = true;
                        mSpeakerIsOn = true;
                        mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_SPEAKER;
                        mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_SPEAKER;
                        incallMask = AudioSystem.ROUTE_ALL;
                        incallMask = AudioSystem.ROUTE_ALL;
                    } else if (mSpeakerIsOn) {
                    } else if (routes == 0 && mSpeakerIsOn) {
                        mSpeakerIsOn = false;
                        mSpeakerIsOn = false;
                        if (mBluetoothScoIsConnected) {
                        if (mBluetoothScoIsConnected) {
                            mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_BLUETOOTH_SCO;
                            mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_BLUETOOTH_SCO;
@@ -695,7 +695,7 @@ public class AudioService extends IAudioService.Stub {
                        // should not affect A2DP routing
                        // should not affect A2DP routing
                        ringtoneMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        ringtoneMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        normalMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        normalMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                    } else if (mBluetoothScoIsConnected) {
                    } else if (routes == 0 && mBluetoothScoIsConnected) {
                        mBluetoothScoIsConnected = false;
                        mBluetoothScoIsConnected = false;
                        if (mHeadsetIsConnected) {
                        if (mHeadsetIsConnected) {
                            mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_HEADSET;
                            mRoutes[AudioSystem.MODE_IN_CALL] = AudioSystem.ROUTE_HEADSET;
@@ -739,7 +739,7 @@ public class AudioService extends IAudioService.Stub {
                            ringtoneMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                            ringtoneMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                            normalMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                            normalMask = AudioSystem.ROUTE_ALL & ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        }
                        }
                    } else if (mHeadsetIsConnected) {
                    } else if (routes == 0 && mHeadsetIsConnected) {
                        mHeadsetIsConnected = false;
                        mHeadsetIsConnected = false;
                        // do not act upon headset disconnection if bluetooth SCO is connected to match phone app behavior
                        // do not act upon headset disconnection if bluetooth SCO is connected to match phone app behavior
                        if (!mBluetoothScoIsConnected) {
                        if (!mBluetoothScoIsConnected) {
@@ -772,7 +772,7 @@ public class AudioService extends IAudioService.Stub {
                        // so there is no need to disable other routes.
                        // so there is no need to disable other routes.
                        ringtoneMask = AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        ringtoneMask = AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        normalMask = AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        normalMask = AudioSystem.ROUTE_BLUETOOTH_A2DP;
                    } else if (mBluetoothA2dpIsConnected) {
                    } else if (routes == 0 && mBluetoothA2dpIsConnected) {
                        mBluetoothA2dpIsConnected = false;
                        mBluetoothA2dpIsConnected = false;
                        mRoutes[AudioSystem.MODE_RINGTONE] &= ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        mRoutes[AudioSystem.MODE_RINGTONE] &= ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        mRoutes[AudioSystem.MODE_NORMAL] &= ~AudioSystem.ROUTE_BLUETOOTH_A2DP;
                        mRoutes[AudioSystem.MODE_NORMAL] &= ~AudioSystem.ROUTE_BLUETOOTH_A2DP;