Loading android/app/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,14 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver> <service android:process="@string/process" android:name = ".gatt.GattService" android:enabled="@bool/profile_supported_gatt"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt" /> </intent-filter> </service> <service android:process="@string/process" android:name = ".hfp.HeadsetService" Loading android/app/jni/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ LOCAL_SRC_FILES:= \ com_android_bluetooth_a2dp.cpp \ com_android_bluetooth_hid.cpp \ com_android_bluetooth_hdp.cpp \ com_android_bluetooth_pan.cpp com_android_bluetooth_pan.cpp \ com_android_bluetooth_gatt.cpp LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ Loading android/app/jni/com_android_bluetooth.h +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ int register_com_android_bluetooth_hdp(JNIEnv* env); int register_com_android_bluetooth_pan(JNIEnv* env); int register_com_android_bluetooth_gatt (JNIEnv* env); } #endif /* COM_ANDROID_BLUETOOTH_H */ android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp 100755 → 100644 +15 −1 Original line number Diff line number Diff line Loading @@ -443,6 +443,13 @@ static void callback_thread_event(bt_cb_thread_evt event) { } } static void dut_mode_recv_callback (uint16_t opcode, uint8_t *buf, uint8_t len) { } static void le_test_mode_recv_callback (bt_status_t status, uint16_t packet_count) { ALOGV("%s: status:%d packet_count:%d ", __FUNCTION__, status, packet_count); } bt_callbacks_t sBluetoothCallbacks = { sizeof(sBluetoothCallbacks), adapter_state_change_callback, Loading @@ -455,6 +462,9 @@ bt_callbacks_t sBluetoothCallbacks = { bond_state_changed_callback, acl_state_changed_callback, callback_thread_event, dut_mode_recv_callback, le_test_mode_recv_callback }; static void classInitNative(JNIEnv* env, jclass clazz) { Loading Loading @@ -924,7 +934,7 @@ static JNINativeMethod sMethods[] = { {"getRemoteServicesNative", "([B)Z", (void*) getRemoteServicesNative}, {"connectSocketNative", "([BI[BII)I", (void*) connectSocketNative}, {"createSocketChannelNative", "(ILjava/lang/String;[BII)I", (void*) createSocketChannelNative}, (void*) createSocketChannelNative} }; int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) Loading Loading @@ -982,5 +992,9 @@ jint JNI_OnLoad(JavaVM *jvm, void *reserved) return JNI_ERR; } if ((status = android::register_com_android_bluetooth_gatt(e)) < 0) { ALOGE("jni gatt registration failure: %d", status); return JNI_ERR; } return JNI_VERSION_1_6; } Loading
android/app/AndroidManifest.xml +8 −0 Original line number Diff line number Diff line Loading @@ -217,6 +217,14 @@ <category android:name="android.intent.category.DEFAULT" /> </intent-filter> </receiver> <service android:process="@string/process" android:name = ".gatt.GattService" android:enabled="@bool/profile_supported_gatt"> <intent-filter> <action android:name="android.bluetooth.IBluetoothGatt" /> </intent-filter> </service> <service android:process="@string/process" android:name = ".hfp.HeadsetService" Loading
android/app/jni/Android.mk +2 −1 Original line number Diff line number Diff line Loading @@ -8,7 +8,8 @@ LOCAL_SRC_FILES:= \ com_android_bluetooth_a2dp.cpp \ com_android_bluetooth_hid.cpp \ com_android_bluetooth_hdp.cpp \ com_android_bluetooth_pan.cpp com_android_bluetooth_pan.cpp \ com_android_bluetooth_gatt.cpp LOCAL_C_INCLUDES += \ $(JNI_H_INCLUDE) \ Loading
android/app/jni/com_android_bluetooth.h +2 −0 Original line number Diff line number Diff line Loading @@ -41,6 +41,8 @@ int register_com_android_bluetooth_hdp(JNIEnv* env); int register_com_android_bluetooth_pan(JNIEnv* env); int register_com_android_bluetooth_gatt (JNIEnv* env); } #endif /* COM_ANDROID_BLUETOOTH_H */
android/app/jni/com_android_bluetooth_btservice_AdapterService.cpp 100755 → 100644 +15 −1 Original line number Diff line number Diff line Loading @@ -443,6 +443,13 @@ static void callback_thread_event(bt_cb_thread_evt event) { } } static void dut_mode_recv_callback (uint16_t opcode, uint8_t *buf, uint8_t len) { } static void le_test_mode_recv_callback (bt_status_t status, uint16_t packet_count) { ALOGV("%s: status:%d packet_count:%d ", __FUNCTION__, status, packet_count); } bt_callbacks_t sBluetoothCallbacks = { sizeof(sBluetoothCallbacks), adapter_state_change_callback, Loading @@ -455,6 +462,9 @@ bt_callbacks_t sBluetoothCallbacks = { bond_state_changed_callback, acl_state_changed_callback, callback_thread_event, dut_mode_recv_callback, le_test_mode_recv_callback }; static void classInitNative(JNIEnv* env, jclass clazz) { Loading Loading @@ -924,7 +934,7 @@ static JNINativeMethod sMethods[] = { {"getRemoteServicesNative", "([B)Z", (void*) getRemoteServicesNative}, {"connectSocketNative", "([BI[BII)I", (void*) connectSocketNative}, {"createSocketChannelNative", "(ILjava/lang/String;[BII)I", (void*) createSocketChannelNative}, (void*) createSocketChannelNative} }; int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) Loading Loading @@ -982,5 +992,9 @@ jint JNI_OnLoad(JavaVM *jvm, void *reserved) return JNI_ERR; } if ((status = android::register_com_android_bluetooth_gatt(e)) < 0) { ALOGE("jni gatt registration failure: %d", status); return JNI_ERR; } return JNI_VERSION_1_6; }