From 0d12e935fbbac725622bb50ff2282c903c9f8aa1 Mon Sep 17 00:00:00 2001 From: William Escande Date: Wed, 16 Mar 2022 16:12:29 +0100 Subject: API Review: factoryReset->clearBluetooth MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit > Consider renaming the factoryReset method to “clearBluetooth”. Bug: 222725037 Test: TH Tag; #refactor Change-Id: Idb86dc5b57b2482401f563daf71eef37610d3f0a --- framework/java/android/bluetooth/BluetoothAdapter.java | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'framework/java/android/bluetooth/BluetoothAdapter.java') diff --git a/framework/java/android/bluetooth/BluetoothAdapter.java b/framework/java/android/bluetooth/BluetoothAdapter.java index 46d19217dd..e7ea35d07c 100644 --- a/framework/java/android/bluetooth/BluetoothAdapter.java +++ b/framework/java/android/bluetooth/BluetoothAdapter.java @@ -1405,7 +1405,7 @@ public final class BluetoothAdapter { android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, }) - public boolean factoryReset() { + public boolean clearBluetooth() { try { mServiceLock.readLock().lock(); if (mService != null) { @@ -1427,6 +1427,22 @@ public final class BluetoothAdapter { return false; } + /** + * See {@link #clearBluetooth()} + * + * @return true to indicate that the config file was successfully cleared + * @hide + */ + @UnsupportedAppUsage(maxTargetSdk = Build.VERSION_CODES.R, trackingBug = 170729553) + @RequiresBluetoothConnectPermission + @RequiresPermission(allOf = { + android.Manifest.permission.BLUETOOTH_CONNECT, + android.Manifest.permission.BLUETOOTH_PRIVILEGED, + }) + public boolean factoryReset() { + return clearBluetooth(); + } + /** * Get the UUIDs supported by the local Bluetooth adapter. * -- cgit v1.2.3