diff options
author | Srinu Jella <sjella@codeaurora.org> | 2013-10-09 16:03:43 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2013-10-31 19:01:55 -0600 |
commit | 47bd93a84faa20fb730b9fea4795675a0b567e53 (patch) | |
tree | 8d41fa9f85d736200442eb4861caaf04a88d8878 | |
parent | c94c3cfcc1e3275b2404c99e615e66f29efad07f (diff) | |
download | android_packages_apps_Bluetooth-47bd93a84faa20fb730b9fea4795675a0b567e53.tar.gz android_packages_apps_Bluetooth-47bd93a84faa20fb730b9fea4795675a0b567e53.tar.bz2 android_packages_apps_Bluetooth-47bd93a84faa20fb730b9fea4795675a0b567e53.zip |
Bluetooth: SAP: Add SAP high security support to Bluetooth APP
This change consists of:
High security authentication changes
Change-Id: I08d4e411c31257794256a06447179229b0119e6a
(cherry picked from commit 22644ac957306510f281d062fef0a0edf4cf7eee)
(cherry picked from commit 9b8c9623f158073c2404d8e3e28fa1e01681a850)
-rw-r--r-- | jni/com_android_bluetooth_btservice_AdapterService.cpp | 6 | ||||
-rw-r--r-- | src/com/android/bluetooth/btservice/JniCallbacks.java | 4 | ||||
-rw-r--r-- | src/com/android/bluetooth/btservice/RemoteDevices.java | 5 |
3 files changed, 8 insertions, 7 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp index bd6365dd5..48e3eb399 100644 --- a/jni/com_android_bluetooth_btservice_AdapterService.cpp +++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp @@ -350,7 +350,7 @@ static void discovery_state_changed_callback(bt_discovery_state_t state) { checkAndClearExceptionFromCallback(callbackEnv, __FUNCTION__); } -static void pin_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod) { +static void pin_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint32_t cod, uint8_t secure) { jbyteArray addr, devname; if (!checkCallbackThread()) { ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__); @@ -370,7 +370,7 @@ static void pin_request_callback(bt_bdaddr_t *bd_addr, bt_bdname_t *bdname, uint callbackEnv->SetByteArrayRegion(devname, 0, sizeof(bt_bdname_t), (jbyte*)bdname); - callbackEnv->CallVoidMethod(sJniCallbacksObj, method_pinRequestCallback, addr, devname, cod); + callbackEnv->CallVoidMethod(sJniCallbacksObj, method_pinRequestCallback, addr, devname, cod, secure); checkAndClearExceptionFromCallback(callbackEnv, __FUNCTION__); callbackEnv->DeleteLocalRef(addr); @@ -555,7 +555,7 @@ static void classInitNative(JNIEnv* env, jclass clazz) { "([B[I[[B)V"); method_deviceFoundCallback = env->GetMethodID(jniCallbackClass, "deviceFoundCallback", "([B)V"); method_pinRequestCallback = env->GetMethodID(jniCallbackClass, "pinRequestCallback", - "([B[BI)V"); + "([B[BIZ)V"); method_sspRequestCallback = env->GetMethodID(jniCallbackClass, "sspRequestCallback", "([B[BIII)V"); diff --git a/src/com/android/bluetooth/btservice/JniCallbacks.java b/src/com/android/bluetooth/btservice/JniCallbacks.java index b1579b81a..a41e7cff5 100644 --- a/src/com/android/bluetooth/btservice/JniCallbacks.java +++ b/src/com/android/bluetooth/btservice/JniCallbacks.java @@ -59,8 +59,8 @@ final class JniCallbacks { mRemoteDevices.deviceFoundCallback(address); } - void pinRequestCallback(byte[] address, byte[] name, int cod) { - mRemoteDevices.pinRequestCallback(address, name, cod); + void pinRequestCallback(byte[] address, byte[] name, int cod, boolean secure) { + mRemoteDevices.pinRequestCallback(address, name, cod, secure); } void bondStateChangeCallback(int status, byte[] address, int newState) { diff --git a/src/com/android/bluetooth/btservice/RemoteDevices.java b/src/com/android/bluetooth/btservice/RemoteDevices.java index 4cde75070..c126f1bcd 100644 --- a/src/com/android/bluetooth/btservice/RemoteDevices.java +++ b/src/com/android/bluetooth/btservice/RemoteDevices.java @@ -393,7 +393,7 @@ final class RemoteDevices { mAdapterService.sendBroadcast(intent, mAdapterService.BLUETOOTH_PERM); } - void pinRequestCallback(byte[] address, byte[] name, int cod) { + void pinRequestCallback(byte[] address, byte[] name, int cod, boolean secure) { //TODO(BT): Get wakelock and update name and cod BluetoothDevice bdDevice = getDevice(address); if (bdDevice == null) { @@ -418,13 +418,14 @@ final class RemoteDevices { return; } infoLog("pinRequestCallback: " + address + " name:" + name + " cod:" + - cod); + cod + "secure" + secure ); // Acquire wakelock during PIN code request to bring up LCD display mWakeLock.acquire(); Intent intent = new Intent(BluetoothDevice.ACTION_PAIRING_REQUEST); intent.putExtra(BluetoothDevice.EXTRA_DEVICE, getDevice(address)); intent.putExtra(BluetoothDevice.EXTRA_PAIRING_VARIANT, BluetoothDevice.PAIRING_VARIANT_PIN); + intent.putExtra(BluetoothDevice.EXTRA_SECURE_PAIRING, secure); mAdapterService.sendBroadcast(intent, mAdapterService.BLUETOOTH_ADMIN_PERM); // Release wakelock to allow the LCD to go off after the PIN popup notification. mWakeLock.release(); |