summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothProfile.java
diff options
context:
space:
mode:
authorStanley Tng <stng@google.com>2019-03-14 16:18:29 -0700
committerStanley Tng <stng@google.com>2019-03-16 00:22:34 +0000
commita76ec8b43ba67a456f5112ab372f3e573761e4fe (patch)
treeec39d3e18c61281ed3c189819d1c92405cca4ce6 /framework/java/android/bluetooth/BluetoothProfile.java
parent4b7400c35ce4ff6d1c7fd4acf0ed4858c4b691ab (diff)
Cleanup annontations for Hearing Aids Profile API
Remove the @UnsupportedAppUsage and add the @IntDef for the Profile Connection States in the Hearing Aids Profile API. Also, the parent class BluetoothProfile has its Profile Connection States annontated. Bug: 128523382 Test: Compile only Change-Id: Ibd02516fa637ddb48d70a8dfacf607f047aec282
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothProfile.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothProfile.java15
1 files changed, 14 insertions, 1 deletions
diff --git a/framework/java/android/bluetooth/BluetoothProfile.java b/framework/java/android/bluetooth/BluetoothProfile.java
index b8670dbead..dabe0fdac3 100644
--- a/framework/java/android/bluetooth/BluetoothProfile.java
+++ b/framework/java/android/bluetooth/BluetoothProfile.java
@@ -18,11 +18,14 @@
package android.bluetooth;
import android.Manifest;
+import android.annotation.IntDef;
import android.annotation.RequiresPermission;
import android.annotation.SystemApi;
import android.annotation.UnsupportedAppUsage;
import android.os.Build;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
import java.util.List;
/**
@@ -60,6 +63,16 @@ public interface BluetoothProfile {
/** The profile is in disconnecting state */
int STATE_DISCONNECTING = 3;
+ /** @hide */
+ @IntDef({
+ STATE_DISCONNECTED,
+ STATE_CONNECTING,
+ STATE_CONNECTED,
+ STATE_DISCONNECTING,
+ })
+ @Retention(RetentionPolicy.SOURCE)
+ public @interface BtProfileState {}
+
/**
* Headset and Handsfree profile
*/
@@ -263,7 +276,7 @@ public interface BluetoothProfile {
* #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING}
*/
@RequiresPermission(Manifest.permission.BLUETOOTH)
- public int getConnectionState(BluetoothDevice device);
+ @BtProfileState int getConnectionState(BluetoothDevice device);
/**
* An interface for notifying BluetoothProfile IPC clients when they have