diff options
| author | Rahul Sabnis <rahulsabnis@google.com> | 2020-03-21 07:02:55 +0000 |
|---|---|---|
| committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2020-03-21 07:02:55 +0000 |
| commit | 115bebfea39c69706f7f7d0da361039c22faf7f3 (patch) | |
| tree | 32976ac2169570704f9945dcc2dc2648f8ab5d24 /core/java/android/bluetooth/BluetoothDevice.java | |
| parent | 80b953200c124883e2be27c059f332367e9e0579 (diff) | |
| parent | bd91b5360f23818e7f82594a35759ca8289cfdc7 (diff) | |
Merge "Add BLUETOOTH_PRIVILEGED permission as a requirement for all new Bluetooth SystemApis and for hidden connect/disconnect APIs." into rvc-dev am: bd91b5360f
Change-Id: I342a5b035d9ded41e1a850553148c7b184f8a46c
Diffstat (limited to 'core/java/android/bluetooth/BluetoothDevice.java')
| -rw-r--r-- | core/java/android/bluetooth/BluetoothDevice.java | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index aea9e6c93484..dc7d05300d45 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/java/android/bluetooth/BluetoothDevice.java @@ -36,8 +36,6 @@ import android.os.Process; import android.os.RemoteException; import android.util.Log; -import com.android.internal.annotations.VisibleForTesting; - import java.io.IOException; import java.io.UnsupportedEncodingException; import java.lang.annotation.Retention; @@ -1104,8 +1102,8 @@ public final class BluetoothDevice implements Parcelable { * @return true on success, false on error * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean setAlias(@NonNull String alias) { final IBluetooth service = sService; if (service == null) { @@ -1128,8 +1126,8 @@ public final class BluetoothDevice implements Parcelable { * not have any battery reporting service, or return value is invalid * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH) public int getBatteryLevel() { final IBluetooth service = sService; if (service == null) { @@ -1219,8 +1217,8 @@ public final class BluetoothDevice implements Parcelable { * * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH) public boolean isBondingInitiatedLocally() { final IBluetooth service = sService; if (service == null) { @@ -1543,7 +1541,7 @@ public final class BluetoothDevice implements Parcelable { * @return true pin has been set false for error * @hide */ - @SystemApi + @UnsupportedAppUsage @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean setPin(@NonNull String pin) { byte[] pinBytes = convertPinToBytes(pin); @@ -1580,8 +1578,8 @@ public final class BluetoothDevice implements Parcelable { * * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN) public boolean cancelPairing() { final IBluetooth service = sService; if (service == null) { @@ -1612,8 +1610,8 @@ public final class BluetoothDevice implements Parcelable { * #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}. * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH) public @AccessPermission int getPhonebookAccessPermission() { final IBluetooth service = sService; if (service == null) { @@ -1720,8 +1718,8 @@ public final class BluetoothDevice implements Parcelable { * @return Whether the message access is allowed to this device. * @hide */ - @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @UnsupportedAppUsage + @RequiresPermission(Manifest.permission.BLUETOOTH) public @AccessPermission int getMessageAccessPermission() { final IBluetooth service = sService; if (service == null) { @@ -1770,7 +1768,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @SystemApi - @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED) + @RequiresPermission(Manifest.permission.BLUETOOTH) public @AccessPermission int getSimAccessPermission() { final IBluetooth service = sService; if (service == null) { @@ -2025,7 +2023,7 @@ public final class BluetoothDevice implements Parcelable { * @return the pin code as a UTF-8 byte array, or null if it is an invalid Bluetooth pin. * @hide */ - @VisibleForTesting + @UnsupportedAppUsage public static byte[] convertPinToBytes(String pin) { if (pin == null) { return null; |
