Example usage for android.media AudioManager startBluetoothSco

List of usage examples for android.media AudioManager startBluetoothSco

Introduction

In this page you can find the example usage for android.media AudioManager startBluetoothSco.

Prototype

public void startBluetoothSco() 

Source Link

Document

Start bluetooth SCO audio connection.

Usage

From source file:Main.java

public static void enableBluetoothRouting(Context context) {
    AudioManager am = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
    am.startBluetoothSco();
    am.setBluetoothScoOn(true);/*from w  w w.ja v  a 2 s  .c o m*/
}

From source file:com.ferdi2005.secondgram.voip.VoIPService.java

private void updateBluetoothHeadsetState(boolean connected) {
    if (connected == isBtHeadsetConnected)
        return;/*from   w w w  .j  av  a2 s .  co  m*/
    isBtHeadsetConnected = connected;
    AudioManager am = (AudioManager) getSystemService(AUDIO_SERVICE);
    if (connected)
        am.startBluetoothSco();
    else
        am.stopBluetoothSco();
    for (StateListener l : stateListeners)
        l.onAudioSettingsChanged();
}