AppRTCBluetoothManager.java 文件源码

java
阅读 39 收藏 0 点赞 0 评论 0

项目:AppRTC-Android 作者:
/** Stops and closes all components related to Bluetooth audio. */
public void stop() {
  ThreadUtils.checkIsOnMainThread();
  Log.d(TAG, "stop: BT state=" + bluetoothState);
  if (bluetoothAdapter == null) {
    return;
  }
  // Stop BT SCO connection with remote device if needed.
  stopScoAudio();
  // Close down remaining BT resources.
  if (bluetoothState == State.UNINITIALIZED) {
    return;
  }
  unregisterReceiver(bluetoothHeadsetReceiver);
  cancelTimer();
  if (bluetoothHeadset != null) {
    bluetoothAdapter.closeProfileProxy(BluetoothProfile.HEADSET, bluetoothHeadset);
    bluetoothHeadset = null;
  }
  bluetoothAdapter = null;
  bluetoothDevice = null;
  bluetoothState = State.UNINITIALIZED;
  Log.d(TAG, "stop done: BT state=" + bluetoothState);
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号