summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorAjay Panicker <apanicke@google.com>2015-07-28 16:52:09 -0700
committerAjay Panicker <apanicke@google.com>2015-08-05 10:35:15 -0700
commitcda6e878cd1b11e10c0b9b4b903b14e11586a963 (patch)
treea100a94db4227fe1eef90aca164e1e1dddedaf1a /core
parente72377e17a837acbe1e537ac737731f6b869fe1e (diff)
downloadframeworks_base-cda6e878cd1b11e10c0b9b4b903b14e11586a963.zip
frameworks_base-cda6e878cd1b11e10c0b9b4b903b14e11586a963.tar.gz
frameworks_base-cda6e878cd1b11e10c0b9b4b903b14e11586a963.tar.bz2
Implement Bluetooth settings factory reset (2/5)
Implemented the factory reset function to be used to reset all bluetooth settings on device to factory default Bug: 16161518
Diffstat (limited to 'core')
-rw-r--r--core/java/android/bluetooth/BluetoothAdapter.java19
-rw-r--r--core/java/android/bluetooth/IBluetooth.aidl1
2 files changed, 20 insertions, 0 deletions
diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java
index 97afafa..1f3ff51 100644
--- a/core/java/android/bluetooth/BluetoothAdapter.java
+++ b/core/java/android/bluetooth/BluetoothAdapter.java
@@ -1002,6 +1002,25 @@ public final class BluetoothAdapter {
}
/**
+ * Factory reset bluetooth settings.
+ *
+ * <p>Requires the {@link android.Manifest.permission#BLUETOOTH_PRIVILEGED}
+ * permission
+ *
+ * @return true to indicate that the config file was successfully cleared
+ *
+ * @hide
+ */
+ public boolean factoryReset() {
+ try {
+ if (mService != null) {
+ return mService.factoryReset();
+ }
+ } catch (RemoteException e) {Log.e(TAG, "", e);}
+ return false;
+ }
+
+ /**
* Get the UUIDs supported by the local Bluetooth adapter.
*
* <p>Requires {@link android.Manifest.permission#BLUETOOTH}
diff --git a/core/java/android/bluetooth/IBluetooth.aidl b/core/java/android/bluetooth/IBluetooth.aidl
index 7a894ae..66f3418 100644
--- a/core/java/android/bluetooth/IBluetooth.aidl
+++ b/core/java/android/bluetooth/IBluetooth.aidl
@@ -92,6 +92,7 @@ interface IBluetooth
ParcelFileDescriptor createSocketChannel(int type, in String serviceName, in ParcelUuid uuid, int port, int flag);
boolean configHciSnoopLog(boolean enable);
+ boolean factoryReset();
boolean isMultiAdvertisementSupported();
boolean isPeripheralModeSupported();