summaryrefslogtreecommitdiffstats
path: root/jni
diff options
context:
space:
mode:
authorCasper Bonde <c.bonde@samsung.com>2015-05-08 14:21:12 +0200
committerPavlin Radoslavov <pavlin@google.com>2015-06-09 14:06:10 -0700
commit244e9c62a85a4b94e21bf1a8dee456e22bc767c4 (patch)
tree73635ed3afac30ae0103195675385c264a5127e2 /jni
parentacc99899ec1c747365d7568a2fe53f53dfc3593f (diff)
downloadandroid_packages_apps_Bluetooth-244e9c62a85a4b94e21bf1a8dee456e22bc767c4.tar.gz
android_packages_apps_Bluetooth-244e9c62a85a4b94e21bf1a8dee456e22bc767c4.tar.bz2
android_packages_apps_Bluetooth-244e9c62a85a4b94e21bf1a8dee456e22bc767c4.zip
SAP: Make it possible to enforce a 16-digit pin code (3/5)
This change enable the posibility to enforce using a 16-digit pin or MITM for a RFCOMM or L2CAP connection. This is needed for the SIM access profile. Change-Id: I42ada9b36d24d43697a2010eccbc0103f15af77d Signed-off-by: Casper Bonde <c.bonde@samsung.com>
Diffstat (limited to 'jni')
-rwxr-xr-xjni/com_android_bluetooth_btservice_AdapterService.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index ce0c38d4b..f4defe031 100755
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -350,7 +350,8 @@ 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,
+ bool min_16_digits) {
jbyteArray addr, devname;
if (!checkCallbackThread()) {
ALOGE("Callback: '%s' is not called on the correct thread", __FUNCTION__);
@@ -370,7 +371,8 @@ 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,
+ min_16_digits);
checkAndClearExceptionFromCallback(callbackEnv, __FUNCTION__);
callbackEnv->DeleteLocalRef(addr);
@@ -619,7 +621,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");
@@ -1044,7 +1046,7 @@ Fail:
}
static int createSocketChannelNative(JNIEnv *env, jobject object, jint type,
- jstring name_str, jbyteArray uuidObj,
+ jstring name_str, jbyteArray uuidObj,
jint channel, jint flag) {
const char *service_name = NULL;
jbyte *uuid = NULL;