diff options
author | Ajay Panicker <apanicke@google.com> | 2016-03-17 17:12:08 -0700 |
---|---|---|
committer | Ajay Panicker <apanicke@google.com> | 2016-04-20 00:45:04 +0000 |
commit | 3558402aae35c6b01c505be012d6736b0c758802 (patch) | |
tree | e925af111ad3c152a6f8ebfcd8fdd527896bdb3c /jni | |
parent | ee763f7526696a1c6eed92331397781d6eb7789c (diff) | |
download | android_packages_apps_Bluetooth-3558402aae35c6b01c505be012d6736b0c758802.tar.gz android_packages_apps_Bluetooth-3558402aae35c6b01c505be012d6736b0c758802.tar.bz2 android_packages_apps_Bluetooth-3558402aae35c6b01c505be012d6736b0c758802.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: If4a8855faf362d7f6de509d7ddc7197d1ac75cee
Diffstat (limited to 'jni')
-rwxr-xr-x | jni/com_android_bluetooth_btservice_AdapterService.cpp | 7 |
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}, |