Loading src/com/android/bluetooth/hfp/HeadsetStateMachine.java +20 −1 Original line number Diff line number Diff line Loading @@ -1218,6 +1218,12 @@ final class HeadsetStateMachine extends StateMachine { switch (state) { case HeadsetHalConstants.AUDIO_STATE_CONNECTED: if (!isScoAcceptable()) { Log.e(TAG,"Audio Connected without any listener"); disconnectAudioNative(getByteAddress(device)); break; } // TODO(BT) should I save the state for next broadcast as the prevState? mAudioState = BluetoothHeadset.STATE_AUDIO_CONNECTED; setAudioParameters(device); /*Set proper Audio Paramters.*/ Loading Loading @@ -2191,6 +2197,11 @@ final class HeadsetStateMachine extends StateMachine { switch (state) { case HeadsetHalConstants.AUDIO_STATE_CONNECTED: if (!isScoAcceptable()) { Log.e(TAG,"Audio Connected without any listener"); disconnectAudioNative(getByteAddress(device)); break; } mAudioState = BluetoothHeadset.STATE_AUDIO_CONNECTED; setAudioParameters(device); /* Set proper Audio Parameters. */ mAudioManager.setBluetoothScoOn(true); Loading Loading @@ -3657,6 +3668,14 @@ final class HeadsetStateMachine extends StateMachine { (mPhoneState.getCallState() != HeadsetHalConstants.CALL_STATE_IDLE)); } // Accept incoming SCO only when there is active call, VR activated, // active VOIP call and Incoming call with inband ringtone supported private boolean isScoAcceptable() { return (((mPhoneState.getCallState() == HeadsetHalConstants.CALL_STATE_INCOMING) && ((mLocalBrsf & BRSF_AG_IN_BAND_RING) != 0)) || mVoiceRecognitionStarted || isInCall()); } boolean isConnected() { IState currentState = getCurrentState(); return (currentState == mConnected || currentState == mAudioOn); Loading Loading
src/com/android/bluetooth/hfp/HeadsetStateMachine.java +20 −1 Original line number Diff line number Diff line Loading @@ -1218,6 +1218,12 @@ final class HeadsetStateMachine extends StateMachine { switch (state) { case HeadsetHalConstants.AUDIO_STATE_CONNECTED: if (!isScoAcceptable()) { Log.e(TAG,"Audio Connected without any listener"); disconnectAudioNative(getByteAddress(device)); break; } // TODO(BT) should I save the state for next broadcast as the prevState? mAudioState = BluetoothHeadset.STATE_AUDIO_CONNECTED; setAudioParameters(device); /*Set proper Audio Paramters.*/ Loading Loading @@ -2191,6 +2197,11 @@ final class HeadsetStateMachine extends StateMachine { switch (state) { case HeadsetHalConstants.AUDIO_STATE_CONNECTED: if (!isScoAcceptable()) { Log.e(TAG,"Audio Connected without any listener"); disconnectAudioNative(getByteAddress(device)); break; } mAudioState = BluetoothHeadset.STATE_AUDIO_CONNECTED; setAudioParameters(device); /* Set proper Audio Parameters. */ mAudioManager.setBluetoothScoOn(true); Loading Loading @@ -3657,6 +3668,14 @@ final class HeadsetStateMachine extends StateMachine { (mPhoneState.getCallState() != HeadsetHalConstants.CALL_STATE_IDLE)); } // Accept incoming SCO only when there is active call, VR activated, // active VOIP call and Incoming call with inband ringtone supported private boolean isScoAcceptable() { return (((mPhoneState.getCallState() == HeadsetHalConstants.CALL_STATE_INCOMING) && ((mLocalBrsf & BRSF_AG_IN_BAND_RING) != 0)) || mVoiceRecognitionStarted || isInCall()); } boolean isConnected() { IState currentState = getCurrentState(); return (currentState == mConnected || currentState == mAudioOn); Loading