summaryrefslogtreecommitdiffstats
path: root/jni
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2016-03-17 17:12:08 -0700
committerAjay Panicker <apanicke@google.com>2016-03-28 18:33:37 +0000
commit6e2c4a130d93e448decc67991690fd8d1f83a343 (patch)
tree1b6ec5c49cc2eb7f902bfd3ad5897148045a34de /jni
parent31785275c1e2112a15cc1a966207bae0601ecd8a (diff)
downloadandroid_packages_apps_Bluetooth-6e2c4a130d93e448decc67991690fd8d1f83a343.tar.gz
android_packages_apps_Bluetooth-6e2c4a130d93e448decc67991690fd8d1f83a343.tar.bz2
android_packages_apps_Bluetooth-6e2c4a130d93e448decc67991690fd8d1f83a343.zip
Add guest mode functionality (1/5)
Add a flag to enable() to start Bluetooth in restricted mode. In restricted mode, all devices that are paired during restricted mode are deleted upon leaving restricted mode. Right now restricted mode is only entered while a guest user is active. Bug: 27410683 Change-Id: I561225652509b29ac6b0d194a3a50e29c5569365
Diffstat (limited to 'jni')
-rwxr-xr-xjni/com_android_bluetooth_btservice_AdapterService.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp
index 5ca96a47c..a8d11bbab 100755
--- a/jni/com_android_bluetooth_btservice_AdapterService.cpp
+++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp
@@ -744,13 +744,12 @@ static bool cleanupNative(JNIEnv *env, jobject obj) {
return JNI_TRUE;
}
-static jboolean enableNative(JNIEnv* env, jobject obj) {
+static jboolean enableNative(JNIEnv* env, jobject obj, jboolean isGuest) {
ALOGV("%s:",__FUNCTION__);
jboolean result = JNI_FALSE;
if (!sBluetoothInterface) return result;
-
- int ret = sBluetoothInterface->enable();
+ int ret = sBluetoothInterface->enable(isGuest == JNI_TRUE ? 1 : 0);
result = (ret == BT_STATUS_SUCCESS || ret == BT_STATUS_DONE) ? JNI_TRUE : JNI_FALSE;
return result;
}
@@ -1270,7 +1269,7 @@ static JNINativeMethod sMethods[] = {
{"classInitNative", "()V", (void *) classInitNative},
{"initNative", "()Z", (void *) initNative},
{"cleanupNative", "()V", (void*) cleanupNative},
- {"enableNative", "()Z", (void*) enableNative},
+ {"enableNative", "(Z)Z", (void*) enableNative},
{"disableNative", "()Z", (void*) disableNative},
{"setAdapterPropertyNative", "(I[B)Z", (void*) setAdapterPropertyNative},
{"getAdapterPropertiesNative", "()Z", (void*) getAdapterPropertiesNative},