private void stopBluetooth ( ) { Log . d ( TAG , "stopBluetooth" ) ; if ( mIsCountDownOn ) { mIsCountDownOn = false ; mCountDown . cancel ( ) ; } // Need to stop Sco audio connection here when the app // change orientation or close with headset still turns on. mContext . unregisterReceiver ( mBroadcastReceiver ) ; mAudioManager . stopBluetoothSco ( ) ; mAudioManager . setMode ( AudioManager . MODE_NORMAL ) ; }
Unregister broadcast receivers and stop Sco audio connection and cancel count down .