Merge "Cleanup annontations for Hearing Aids Profile API"
am: f6b3f6a8d8
Change-Id: I33778cde1415fefe985031dd637ab97d620bf284
This commit is contained in:
@@ -22,7 +22,6 @@ import android.annotation.Nullable;
|
|||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SdkConstant;
|
import android.annotation.SdkConstant;
|
||||||
import android.annotation.SdkConstant.SdkConstantType;
|
import android.annotation.SdkConstant.SdkConstantType;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
|
||||||
import android.content.ComponentName;
|
import android.content.ComponentName;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
@@ -91,7 +90,6 @@ public final class BluetoothHearingAid implements BluetoothProfile {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
|
||||||
@UnsupportedAppUsage
|
|
||||||
public static final String ACTION_ACTIVE_DEVICE_CHANGED =
|
public static final String ACTION_ACTIVE_DEVICE_CHANGED =
|
||||||
"android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED";
|
"android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED";
|
||||||
|
|
||||||
@@ -323,7 +321,8 @@ public final class BluetoothHearingAid implements BluetoothProfile {
|
|||||||
/**
|
/**
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override public @NonNull List<BluetoothDevice> getDevicesMatchingConnectionStates(
|
@Override
|
||||||
|
public @NonNull List<BluetoothDevice> getDevicesMatchingConnectionStates(
|
||||||
@NonNull int[] states) {
|
@NonNull int[] states) {
|
||||||
if (VDBG) log("getDevicesMatchingStates()");
|
if (VDBG) log("getDevicesMatchingStates()");
|
||||||
try {
|
try {
|
||||||
@@ -345,7 +344,8 @@ public final class BluetoothHearingAid implements BluetoothProfile {
|
|||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public int getConnectionState(@NonNull BluetoothDevice device) {
|
public @BluetoothProfile.BtProfileState int getConnectionState(
|
||||||
|
@NonNull BluetoothDevice device) {
|
||||||
if (VDBG) log("getState(" + device + ")");
|
if (VDBG) log("getState(" + device + ")");
|
||||||
try {
|
try {
|
||||||
mServiceLock.readLock().lock();
|
mServiceLock.readLock().lock();
|
||||||
@@ -385,7 +385,6 @@ public final class BluetoothHearingAid implements BluetoothProfile {
|
|||||||
* @return false on immediate error, true otherwise
|
* @return false on immediate error, true otherwise
|
||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@UnsupportedAppUsage
|
|
||||||
public boolean setActiveDevice(@Nullable BluetoothDevice device) {
|
public boolean setActiveDevice(@Nullable BluetoothDevice device) {
|
||||||
if (DBG) log("setActiveDevice(" + device + ")");
|
if (DBG) log("setActiveDevice(" + device + ")");
|
||||||
try {
|
try {
|
||||||
@@ -417,7 +416,6 @@ public final class BluetoothHearingAid implements BluetoothProfile {
|
|||||||
* @hide
|
* @hide
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(Manifest.permission.BLUETOOTH)
|
@RequiresPermission(Manifest.permission.BLUETOOTH)
|
||||||
@UnsupportedAppUsage
|
|
||||||
public List<BluetoothDevice> getActiveDevices() {
|
public List<BluetoothDevice> getActiveDevices() {
|
||||||
if (VDBG) log("getActiveDevices()");
|
if (VDBG) log("getActiveDevices()");
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -18,11 +18,14 @@
|
|||||||
package android.bluetooth;
|
package android.bluetooth;
|
||||||
|
|
||||||
import android.Manifest;
|
import android.Manifest;
|
||||||
|
import android.annotation.IntDef;
|
||||||
import android.annotation.RequiresPermission;
|
import android.annotation.RequiresPermission;
|
||||||
import android.annotation.SystemApi;
|
import android.annotation.SystemApi;
|
||||||
import android.annotation.UnsupportedAppUsage;
|
import android.annotation.UnsupportedAppUsage;
|
||||||
import android.os.Build;
|
import android.os.Build;
|
||||||
|
|
||||||
|
import java.lang.annotation.Retention;
|
||||||
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -60,6 +63,16 @@ public interface BluetoothProfile {
|
|||||||
/** The profile is in disconnecting state */
|
/** The profile is in disconnecting state */
|
||||||
int STATE_DISCONNECTING = 3;
|
int STATE_DISCONNECTING = 3;
|
||||||
|
|
||||||
|
/** @hide */
|
||||||
|
@IntDef({
|
||||||
|
STATE_DISCONNECTED,
|
||||||
|
STATE_CONNECTING,
|
||||||
|
STATE_CONNECTED,
|
||||||
|
STATE_DISCONNECTING,
|
||||||
|
})
|
||||||
|
@Retention(RetentionPolicy.SOURCE)
|
||||||
|
public @interface BtProfileState {}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Headset and Handsfree profile
|
* Headset and Handsfree profile
|
||||||
*/
|
*/
|
||||||
@@ -263,7 +276,7 @@ public interface BluetoothProfile {
|
|||||||
* #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING}
|
* #STATE_CONNECTING}, {@link #STATE_DISCONNECTED}, {@link #STATE_DISCONNECTING}
|
||||||
*/
|
*/
|
||||||
@RequiresPermission(Manifest.permission.BLUETOOTH)
|
@RequiresPermission(Manifest.permission.BLUETOOTH)
|
||||||
public int getConnectionState(BluetoothDevice device);
|
@BtProfileState int getConnectionState(BluetoothDevice device);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An interface for notifying BluetoothProfile IPC clients when they have
|
* An interface for notifying BluetoothProfile IPC clients when they have
|
||||||
|
|||||||
Reference in New Issue
Block a user