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

Commit a92cca96 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge changes I306e8c61,I271da857 into tm-qpr-dev am: c92032e4

parents 3641cde4 c92032e4
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -902,6 +902,8 @@ public class HeadsetClientService extends ProfileService {

    public void setAudioRouteAllowed(BluetoothDevice device, boolean allowed) {
        enforceCallingOrSelfPermission(BLUETOOTH_PERM, "Need BLUETOOTH permission");
        Log.i(TAG, "setAudioRouteAllowed: device=" + device + ", allowed=" + allowed + ", "
                + Utils.getUidPidString());
        HeadsetClientStateMachine sm = mStateMachineMap.get(device);
        if (sm != null) {
            sm.setAudioRouteAllowed(allowed);
@@ -918,6 +920,7 @@ public class HeadsetClientService extends ProfileService {
    }

    public boolean connectAudio(BluetoothDevice device) {
        Log.i(TAG, "connectAudio: device=" + device + ", " + Utils.getUidPidString());
        HeadsetClientStateMachine sm = getStateMachine(device);
        if (sm == null) {
            Log.e(TAG, "SM does not exist for device " + device);
+7 −5
Original line number Diff line number Diff line
@@ -985,8 +985,8 @@ public class HeadsetClientStateMachine extends StateMachine {
                broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED,
                        BluetoothProfile.STATE_CONNECTED);
            } else if (mPrevState != null) { // null is the default state before Disconnected
                Log.e(TAG, "Connected: Illegal state transition from " + mPrevState.getName()
                        + " to Connecting, mCurrentDevice=" + mCurrentDevice);
                Log.e(TAG, "Disconnected: Illegal state transition from " + mPrevState.getName()
                        + " to Disconnected, mCurrentDevice=" + mCurrentDevice);
            }
            mCurrentDevice = null;
        }
@@ -1087,7 +1087,7 @@ public class HeadsetClientStateMachine extends StateMachine {
                        BluetoothProfile.STATE_DISCONNECTED);
            } else {
                String prevStateName = mPrevState == null ? "null" : mPrevState.getName();
                Log.e(TAG, "Connected: Illegal state transition from " + prevStateName
                Log.e(TAG, "Connecting: Illegal state transition from " + prevStateName
                        + " to Connecting, mCurrentDevice=" + mCurrentDevice);
            }
        }
@@ -1242,7 +1242,7 @@ public class HeadsetClientStateMachine extends StateMachine {
            } else if (mPrevState != mAudioOn) {
                String prevStateName = mPrevState == null ? "null" : mPrevState.getName();
                Log.e(TAG, "Connected: Illegal state transition from " + prevStateName
                        + " to Connecting, mCurrentDevice=" + mCurrentDevice);
                        + " to Connected, mCurrentDevice=" + mCurrentDevice);
            }
            mService.updateBatteryLevel();
        }
@@ -1667,8 +1667,10 @@ public class HeadsetClientStateMachine extends StateMachine {
                        Log.d(TAG, "mAudioRouteAllowed=" + mAudioRouteAllowed);
                    }
                    if (!mAudioRouteAllowed) {
                        Log.i(TAG, "Audio is not allowed! Disconnect SCO.");
                        sendMessage(HeadsetClientStateMachine.DISCONNECT_AUDIO);
                        break;
                        // Don't continue connecting!
                        return;
                    }

                    // Audio state is split in two parts, the audio focus is maintained by the