diff options
author | Ajay Panicker <apanicke@google.com> | 2015-07-28 16:47:54 -0700 |
---|---|---|
committer | Ajay Panicker <apanicke@google.com> | 2015-08-05 10:30:20 -0700 |
commit | 6eb32d5f7c30f04da45c3da0974bbb63725a0978 (patch) | |
tree | ba80caf93b930363ec1518a7c07c41b27fc7eaf8 /jni | |
parent | 1dd20863cde3b61cea48d2e06d1814f5f9651691 (diff) | |
download | android_packages_apps_Bluetooth-6eb32d5f7c30f04da45c3da0974bbb63725a0978.tar.gz android_packages_apps_Bluetooth-6eb32d5f7c30f04da45c3da0974bbb63725a0978.tar.bz2 android_packages_apps_Bluetooth-6eb32d5f7c30f04da45c3da0974bbb63725a0978.zip |
Implement Bluetooth settings factory reset (1/5)
Implemented the factory reset function to be used to reset all bluetooth
settings on device to factory default
Bug: 16161518
Diffstat (limited to 'jni')
-rwxr-xr-x | jni/com_android_bluetooth_btservice_AdapterService.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/jni/com_android_bluetooth_btservice_AdapterService.cpp b/jni/com_android_bluetooth_btservice_AdapterService.cpp index f4defe031..9223157de 100755 --- a/jni/com_android_bluetooth_btservice_AdapterService.cpp +++ b/jni/com_android_bluetooth_btservice_AdapterService.cpp @@ -1123,6 +1123,13 @@ static void dumpNative(JNIEnv *env, jobject obj, jobject fdObj) sBluetoothInterface->dump(fd); } +static jboolean factoryResetNative(JNIEnv *env, jobject obj) { + ALOGV("%s:", __FUNCTION__); + if (!sBluetoothInterface) return JNI_FALSE; + int ret = sBluetoothInterface->config_clear(); + return (ret == BT_STATUS_SUCCESS) ? JNI_TRUE : JNI_FALSE; +} + static JNINativeMethod sMethods[] = { /* name, signature, funcPtr */ {"classInitNative", "()V", (void *) classInitNative}, @@ -1151,6 +1158,7 @@ static JNINativeMethod sMethods[] = { {"alarmFiredNative", "()V", (void *) alarmFiredNative}, {"readEnergyInfo", "()I", (void*) readEnergyInfo}, {"dumpNative", "(Ljava/io/FileDescriptor;)V", (void*) dumpNative}, + {"factoryResetNative", "()Z", (void*)factoryResetNative} }; int register_com_android_bluetooth_btservice_AdapterService(JNIEnv* env) |