summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothDevice.java
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2018-08-01 15:07:20 +0100
committerMathew Inwood <mathewi@google.com>2018-08-01 15:07:20 +0100
commit7d543894e0497651fc160728d659543483500f87 (patch)
tree2490c8017c7b1dfbf4839fb074e1c0f26b4f5fc8 /framework/java/android/bluetooth/BluetoothDevice.java
parentcd6875ef44dd3ddaf6ee2beaa8df31aafe9861be (diff)
Add @UnsupportedAppUsage annotations
For packages: android.bluetooth.le android.bluetooth This is an automatically generated CL. See go/UnsupportedAppUsage for more details. Exempted-From-Owner-Approval: Mechanical changes to the codebase which have been approved by Android API council and announced on android-eng@ Bug: 110868826 Test: m Change-Id: Ifcf24c0617acd7facc0e03f30a95c3a6b09b205c Merged-In: I88a1311e27c5f9a5f9d1035db76034f86f650efc
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothDevice.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothDevice.java34
1 files changed, 34 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothDevice.java b/framework/java/android/bluetooth/BluetoothDevice.java
index ac21395c2f..a429e701f7 100644
--- a/framework/java/android/bluetooth/BluetoothDevice.java
+++ b/framework/java/android/bluetooth/BluetoothDevice.java
@@ -21,6 +21,7 @@ import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
+import android.annotation.UnsupportedAppUsage;
import android.content.Context;
import android.os.Handler;
import android.os.Parcel;
@@ -115,6 +116,7 @@ public final class BluetoothDevice implements Parcelable {
* @hide
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @UnsupportedAppUsage
public static final String ACTION_DISAPPEARED =
"android.bluetooth.device.action.DISAPPEARED";
@@ -186,6 +188,7 @@ public final class BluetoothDevice implements Parcelable {
* @hide
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @UnsupportedAppUsage
public static final String ACTION_ALIAS_CHANGED =
"android.bluetooth.device.action.ALIAS_CHANGED";
@@ -306,6 +309,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final String EXTRA_REASON = "android.bluetooth.device.extra.REASON";
/**
@@ -346,6 +350,7 @@ public final class BluetoothDevice implements Parcelable {
/** @hide */
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @UnsupportedAppUsage
public static final String ACTION_SDP_RECORD =
"android.bluetooth.device.action.SDP_RECORD";
@@ -390,6 +395,7 @@ public final class BluetoothDevice implements Parcelable {
"android.bluetooth.device.action.PAIRING_REQUEST";
/** @hide */
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @UnsupportedAppUsage
public static final String ACTION_PAIRING_CANCEL =
"android.bluetooth.device.action.PAIRING_CANCEL";
@@ -481,6 +487,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_AUTH_FAILED = 1;
/**
@@ -489,6 +496,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_AUTH_REJECTED = 2;
/**
@@ -503,6 +511,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_REMOTE_DEVICE_DOWN = 4;
/**
@@ -510,6 +519,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_DISCOVERY_IN_PROGRESS = 5;
/**
@@ -517,6 +527,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_AUTH_TIMEOUT = 6;
/**
@@ -524,6 +535,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_REPEATED_ATTEMPTS = 7;
/**
@@ -532,6 +544,7 @@ public final class BluetoothDevice implements Parcelable {
*
* @hide
*/
+ @UnsupportedAppUsage
public static final int UNBOND_REASON_REMOTE_AUTH_CANCELED = 8;
/**
@@ -610,6 +623,7 @@ public final class BluetoothDevice implements Parcelable {
"android.bluetooth.device.extra.SDP_RECORD";
/** @hide */
+ @UnsupportedAppUsage
public static final String EXTRA_SDP_SEARCH_STATUS =
"android.bluetooth.device.extra.SDP_SEARCH_STATUS";
/**
@@ -720,6 +734,7 @@ public final class BluetoothDevice implements Parcelable {
private final String mAddress;
/*package*/
+ @UnsupportedAppUsage
static IBluetooth getService() {
synchronized (BluetoothDevice.class) {
if (sService == null) {
@@ -763,6 +778,7 @@ public final class BluetoothDevice implements Parcelable {
* @throws IllegalArgumentException address is invalid
* @hide
*/
+ @UnsupportedAppUsage
/*package*/ BluetoothDevice(String address) {
getService(); // ensures sService is initialized
if (!BluetoothAdapter.checkBluetoothAddress(address)) {
@@ -883,6 +899,7 @@ public final class BluetoothDevice implements Parcelable {
* @return the Bluetooth alias, or null if no alias or there was a problem
* @hide
*/
+ @UnsupportedAppUsage
public String getAlias() {
final IBluetooth service = sService;
if (service == null) {
@@ -907,6 +924,7 @@ public final class BluetoothDevice implements Parcelable {
* @return true on success, false on error
* @hide
*/
+ @UnsupportedAppUsage
public boolean setAlias(String alias) {
final IBluetooth service = sService;
if (service == null) {
@@ -930,6 +948,7 @@ public final class BluetoothDevice implements Parcelable {
* @see #getAlias()
* @see #getName()
*/
+ @UnsupportedAppUsage
public String getAliasName() {
String name = getAlias();
if (name == null) {
@@ -948,6 +967,7 @@ public final class BluetoothDevice implements Parcelable {
* @hide
*/
@RequiresPermission(Manifest.permission.BLUETOOTH)
+ @UnsupportedAppUsage
public int getBatteryLevel() {
final IBluetooth service = sService;
if (service == null) {
@@ -1006,6 +1026,7 @@ public final class BluetoothDevice implements Parcelable {
* @throws IllegalArgumentException if an invalid transport was specified
* @hide
*/
+ @UnsupportedAppUsage
public boolean createBond(int transport) {
final IBluetooth service = sService;
if (service == null) {
@@ -1059,6 +1080,7 @@ public final class BluetoothDevice implements Parcelable {
}
/** @hide */
+ @UnsupportedAppUsage
public boolean isBondingInitiatedLocally() {
final IBluetooth service = sService;
if (service == null) {
@@ -1351,6 +1373,7 @@ public final class BluetoothDevice implements Parcelable {
}
/** @hide */
+ @UnsupportedAppUsage
public boolean setPasskey(int passkey) {
//TODO(BT)
/*
@@ -1391,6 +1414,7 @@ public final class BluetoothDevice implements Parcelable {
}
/** @hide */
+ @UnsupportedAppUsage
public boolean cancelPairingUserInput() {
final IBluetooth service = sService;
if (service == null) {
@@ -1406,6 +1430,7 @@ public final class BluetoothDevice implements Parcelable {
}
/** @hide */
+ @UnsupportedAppUsage
public boolean isBluetoothDock() {
// TODO(BT)
/*
@@ -1431,6 +1456,7 @@ public final class BluetoothDevice implements Parcelable {
* #ACCESS_UNKNOWN}, {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}.
* @hide
*/
+ @UnsupportedAppUsage
public int getPhonebookAccessPermission() {
final IBluetooth service = sService;
if (service == null) {
@@ -1475,6 +1501,7 @@ public final class BluetoothDevice implements Parcelable {
* {@link #ACCESS_ALLOWED} or {@link #ACCESS_REJECTED}.
* @hide
*/
+ @UnsupportedAppUsage
public int getMessageAccessPermission() {
final IBluetooth service = sService;
if (service == null) {
@@ -1497,6 +1524,7 @@ public final class BluetoothDevice implements Parcelable {
* @return Whether the value has been successfully set.
* @hide
*/
+ @UnsupportedAppUsage
public boolean setMessageAccessPermission(int value) {
final IBluetooth service = sService;
if (service == null) {
@@ -1539,6 +1567,7 @@ public final class BluetoothDevice implements Parcelable {
* @return Whether the value has been successfully set.
* @hide
*/
+ @UnsupportedAppUsage
public boolean setSimAccessPermission(int value) {
final IBluetooth service = sService;
if (service == null) {
@@ -1577,6 +1606,7 @@ public final class BluetoothDevice implements Parcelable {
* permissions
* @hide
*/
+ @UnsupportedAppUsage
public BluetoothSocket createRfcommSocket(int channel) throws IOException {
if (!isBluetoothEnabled()) {
Log.e(TAG, "Bluetooth is not enabled");
@@ -1729,6 +1759,7 @@ public final class BluetoothDevice implements Parcelable {
* permissions.
* @hide
*/
+ @UnsupportedAppUsage
public BluetoothSocket createInsecureRfcommSocket(int port) throws IOException {
if (!isBluetoothEnabled()) {
Log.e(TAG, "Bluetooth is not enabled");
@@ -1748,6 +1779,7 @@ public final class BluetoothDevice implements Parcelable {
* permissions.
* @hide
*/
+ @UnsupportedAppUsage
public BluetoothSocket createScoSocket() throws IOException {
if (!isBluetoothEnabled()) {
Log.e(TAG, "Bluetooth is not enabled");
@@ -1765,6 +1797,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
*/
+ @UnsupportedAppUsage
public static byte[] convertPinToBytes(String pin) {
if (pin == null) {
return null;
@@ -1896,6 +1929,7 @@ public final class BluetoothDevice implements Parcelable {
* operations.
* @hide
*/
+ @UnsupportedAppUsage
public BluetoothGatt connectGatt(Context context, boolean autoConnect,
BluetoothGattCallback callback, int transport,
boolean opportunistic, int phy, Handler handler) {