summaryrefslogtreecommitdiff
path: root/framework/java/android/bluetooth/BluetoothHeadset.java
diff options
context:
space:
mode:
authorMathew Inwood <mathewi@google.com>2018-08-06 03:59:41 -0700
committerandroid-build-merger <android-build-merger@google.com>2018-08-06 03:59:41 -0700
commitf51a804b44087d5ff89da821a0f4167cd21e3a39 (patch)
treee23dd771b9d8d3014cb64a3d5696fc34014a7f28 /framework/java/android/bluetooth/BluetoothHeadset.java
parent8188c5616e26a879f6436edfa5782ed358315418 (diff)
parent7d543894e0497651fc160728d659543483500f87 (diff)
Merge "Add @UnsupportedAppUsage annotations"
am: b40b37910d Change-Id: Ic3de9e4c6d17687d4a1f64c02026e5c0711e8fd1
Diffstat (limited to 'framework/java/android/bluetooth/BluetoothHeadset.java')
-rw-r--r--framework/java/android/bluetooth/BluetoothHeadset.java13
1 files changed, 13 insertions, 0 deletions
diff --git a/framework/java/android/bluetooth/BluetoothHeadset.java b/framework/java/android/bluetooth/BluetoothHeadset.java
index 0c91a2054b..636b1b9b13 100644
--- a/framework/java/android/bluetooth/BluetoothHeadset.java
+++ b/framework/java/android/bluetooth/BluetoothHeadset.java
@@ -22,6 +22,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.ComponentName;
import android.content.Context;
import android.os.Binder;
@@ -110,6 +111,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @hide
*/
@SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION)
+ @UnsupportedAppUsage
public static final String ACTION_ACTIVE_DEVICE_CHANGED =
"android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED";
@@ -401,6 +403,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* results once close() has been called. Multiple invocations of close()
* are ok.
*/
+ @UnsupportedAppUsage
/*package*/ void close() {
if (VDBG) log("close()");
@@ -602,6 +605,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return priority of the device
* @hide
*/
+ @UnsupportedAppUsage
public int getPriority(BluetoothDevice device) {
if (VDBG) log("getPriority(" + device + ")");
final IBluetoothHeadset service = mService;
@@ -719,6 +723,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
*
* @hide
*/
+ @UnsupportedAppUsage
public int getAudioState(BluetoothDevice device) {
if (VDBG) log("getAudioState");
final IBluetoothHeadset service = mService;
@@ -846,6 +851,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return false if there was some error such as there is no active headset
* @hide
*/
+ @UnsupportedAppUsage
public boolean connectAudio() {
final IBluetoothHeadset service = mService;
if (service != null && isEnabled()) {
@@ -872,6 +878,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return false if audio is not connected, or on error, true otherwise
* @hide
*/
+ @UnsupportedAppUsage
public boolean disconnectAudio() {
final IBluetoothHeadset service = mService;
if (service != null && isEnabled()) {
@@ -909,6 +916,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @hide
*/
@RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+ @UnsupportedAppUsage
public boolean startScoUsingVirtualVoiceCall() {
if (DBG) log("startScoUsingVirtualVoiceCall()");
final IBluetoothHeadset service = mService;
@@ -938,6 +946,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @hide
*/
@RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
+ @UnsupportedAppUsage
public boolean stopScoUsingVirtualVoiceCall() {
if (DBG) log("stopScoUsingVirtualVoiceCall()");
final IBluetoothHeadset service = mService;
@@ -962,6 +971,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
*
* @hide
*/
+ @UnsupportedAppUsage
public void phoneStateChanged(int numActive, int numHeld, int callState, String number,
int type) {
final IBluetoothHeadset service = mService;
@@ -1060,6 +1070,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @hide
*/
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
+ @UnsupportedAppUsage
public boolean setActiveDevice(@Nullable BluetoothDevice device) {
if (DBG) {
Log.d(TAG, "setActiveDevice: " + device);
@@ -1089,6 +1100,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @hide
*/
@RequiresPermission(android.Manifest.permission.BLUETOOTH)
+ @UnsupportedAppUsage
public BluetoothDevice getActiveDevice() {
if (VDBG) {
Log.d(TAG, "getActiveDevice");
@@ -1163,6 +1175,7 @@ public final class BluetoothHeadset implements BluetoothProfile {
}
};
+ @UnsupportedAppUsage
private boolean isEnabled() {
return mAdapter.getState() == BluetoothAdapter.STATE_ON;
}