Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 03b8386d authored by Ganesh Ganapathi Batta's avatar Ganesh Ganapathi Batta Committed by Matthew Xie
Browse files

Initial version of BLE support for Bluedroid

Change-Id: I9579b3074bc4bc59dd45f71c0937e8879196555e
parent 8eb70f8b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -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"
+2 −1
Original line number Diff line number Diff line
@@ -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) \
+2 −0
Original line number Diff line number Diff line
@@ -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 */
+15 −1
Original line number Diff line number Diff line
@@ -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,
@@ -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) {
@@ -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)
@@ -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;
}
+1276 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading