Android 蓝牙学习 @# Android 蓝牙
目录
1.1 sBluetoothA2dpInterface 定义
2. btav_source_interface_t->connect
4.1 btif_av_query_mandatory_codec_priority
前面讲到JNI调用Bluedroid协议栈connect进行A2DP连接
继续 !!!
1.connectA2dpNative
android-12.0.0_r2/packages/apps/Bluetooth/jni/com_android_bluetooth_a2dp.cpp
375static jboolean connectA2dpNative(JNIEnv* env, jobject object,
376 jbyteArray address) {
377 ALOGI("%s: sBluetoothA2dpInterface: %p", __func__, sBluetoothA2dpInterface);
378 std::shared_lock<std::shared_timed_mutex> lock(interface_mutex);
379 if (!sBluetoothA2dpInterface) {
380 ALOGE("%s: Failed to get the Bluetooth A2DP Interface", __func__);
381 return JNI_FALSE;
382 }
383
384 j