diff options
author | Mathew Inwood <mathewi@google.com> | 2018-08-06 03:59:41 -0700 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-08-06 03:59:41 -0700 |
commit | 4a8c67bbe8569bdda41d4aa6143749f650549dc0 (patch) | |
tree | a0aa94f83b0970672db19794ba00aaf946713662 | |
parent | a1c24bf8af7c069c4a93c082716ab4422fe19a11 (diff) | |
parent | b40b37910d76a0ce9670c95da75d9a8d9f26db06 (diff) |
Merge "Add @UnsupportedAppUsage annotations"
am: b40b37910d
Change-Id: Ic3de9e4c6d17687d4a1f64c02026e5c0711e8fd1
27 files changed, 225 insertions, 200 deletions
diff --git a/config/hiddenapi-light-greylist.txt b/config/hiddenapi-light-greylist.txt index 0c886e9b6343..ade0a68ec0be 100644 --- a/config/hiddenapi-light-greylist.txt +++ b/config/hiddenapi-light-greylist.txt @@ -1028,206 +1028,8 @@ Landroid/appwidget/AppWidgetManager;->getInstalledProviders(I)Ljava/util/List; Landroid/appwidget/AppWidgetManager;->getInstalledProvidersForProfile(ILandroid/os/UserHandle;Ljava/lang/String;)Ljava/util/List; Landroid/appwidget/AppWidgetManager;->mService:Lcom/android/internal/appwidget/IAppWidgetService; Landroid/appwidget/AppWidgetProviderInfo;->providerInfo:Landroid/content/pm/ActivityInfo; -Landroid/bluetooth/BluetoothA2dp;->ACTION_ACTIVE_DEVICE_CHANGED:Ljava/lang/String; -Landroid/bluetooth/BluetoothA2dp;->ACTION_CODEC_CONFIG_CHANGED:Ljava/lang/String; -Landroid/bluetooth/BluetoothA2dp;->close()V -Landroid/bluetooth/BluetoothA2dp;->connect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothA2dp;->disableOptionalCodecs(Landroid/bluetooth/BluetoothDevice;)V -Landroid/bluetooth/BluetoothA2dp;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothA2dp;->enableOptionalCodecs(Landroid/bluetooth/BluetoothDevice;)V -Landroid/bluetooth/BluetoothA2dp;->getActiveDevice()Landroid/bluetooth/BluetoothDevice; -Landroid/bluetooth/BluetoothA2dp;->getCodecStatus(Landroid/bluetooth/BluetoothDevice;)Landroid/bluetooth/BluetoothCodecStatus; -Landroid/bluetooth/BluetoothA2dp;->getOptionalCodecsEnabled(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothA2dp;->getPriority(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_NOT_SUPPORTED:I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_PREF_DISABLED:I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_PREF_ENABLED:I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_PREF_UNKNOWN:I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_SUPPORTED:I -Landroid/bluetooth/BluetoothA2dp;->OPTIONAL_CODECS_SUPPORT_UNKNOWN:I -Landroid/bluetooth/BluetoothA2dp;->setActiveDevice(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothA2dp;->setCodecConfigPreference(Landroid/bluetooth/BluetoothDevice;Landroid/bluetooth/BluetoothCodecConfig;)V -Landroid/bluetooth/BluetoothA2dp;->setOptionalCodecsEnabled(Landroid/bluetooth/BluetoothDevice;I)V -Landroid/bluetooth/BluetoothA2dp;->stateToString(I)Ljava/lang/String; -Landroid/bluetooth/BluetoothA2dp;->supportsOptionalCodecs(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothA2dpSink;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothAdapter;->disable(Z)Z -Landroid/bluetooth/BluetoothAdapter;->factoryReset()Z -Landroid/bluetooth/BluetoothAdapter;->getBluetoothManager()Landroid/bluetooth/IBluetoothManager; -Landroid/bluetooth/BluetoothAdapter;->getBluetoothService(Landroid/bluetooth/IBluetoothManagerCallback;)Landroid/bluetooth/IBluetooth; -Landroid/bluetooth/BluetoothAdapter;->getConnectionState()I -Landroid/bluetooth/BluetoothAdapter;->getDiscoverableTimeout()I -Landroid/bluetooth/BluetoothAdapter;->getLeState()I -Landroid/bluetooth/BluetoothAdapter;->getUuids()[Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothAdapter;->listenUsingEncryptedRfcommWithServiceRecord(Ljava/lang/String;Ljava/util/UUID;)Landroid/bluetooth/BluetoothServerSocket; -Landroid/bluetooth/BluetoothAdapter;->listenUsingRfcommOn(IZZ)Landroid/bluetooth/BluetoothServerSocket; -Landroid/bluetooth/BluetoothAdapter;->mService:Landroid/bluetooth/IBluetooth; -Landroid/bluetooth/BluetoothAdapter;->setDiscoverableTimeout(I)V -Landroid/bluetooth/BluetoothAdapter;->setScanMode(I)Z -Landroid/bluetooth/BluetoothAdapter;->setScanMode(II)Z -Landroid/bluetooth/BluetoothClass;-><init>(I)V -Landroid/bluetooth/BluetoothClass;->doesClassMatch(I)Z -Landroid/bluetooth/BluetoothClass;->PROFILE_A2DP:I -Landroid/bluetooth/BluetoothClass;->PROFILE_HEADSET:I Landroid/bluetooth/BluetoothCodecConfig; -Landroid/bluetooth/BluetoothCodecConfig;-><init>(IIIIIJJJJ)V -Landroid/bluetooth/BluetoothCodecConfig;->BITS_PER_SAMPLE_16:I -Landroid/bluetooth/BluetoothCodecConfig;->BITS_PER_SAMPLE_24:I -Landroid/bluetooth/BluetoothCodecConfig;->BITS_PER_SAMPLE_32:I -Landroid/bluetooth/BluetoothCodecConfig;->BITS_PER_SAMPLE_NONE:I -Landroid/bluetooth/BluetoothCodecConfig;->CHANNEL_MODE_MONO:I -Landroid/bluetooth/BluetoothCodecConfig;->CHANNEL_MODE_NONE:I -Landroid/bluetooth/BluetoothCodecConfig;->CHANNEL_MODE_STEREO:I -Landroid/bluetooth/BluetoothCodecConfig;->CODEC_PRIORITY_DEFAULT:I -Landroid/bluetooth/BluetoothCodecConfig;->CODEC_PRIORITY_DISABLED:I -Landroid/bluetooth/BluetoothCodecConfig;->CODEC_PRIORITY_HIGHEST:I -Landroid/bluetooth/BluetoothCodecConfig;->getBitsPerSample()I -Landroid/bluetooth/BluetoothCodecConfig;->getChannelMode()I -Landroid/bluetooth/BluetoothCodecConfig;->getCodecPriority()I -Landroid/bluetooth/BluetoothCodecConfig;->getCodecSpecific1()J -Landroid/bluetooth/BluetoothCodecConfig;->getCodecSpecific2()J -Landroid/bluetooth/BluetoothCodecConfig;->getCodecSpecific3()J -Landroid/bluetooth/BluetoothCodecConfig;->getCodecSpecific4()J -Landroid/bluetooth/BluetoothCodecConfig;->getCodecType()I -Landroid/bluetooth/BluetoothCodecConfig;->getSampleRate()I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_176400:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_192000:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_44100:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_48000:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_88200:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_96000:I -Landroid/bluetooth/BluetoothCodecConfig;->SAMPLE_RATE_NONE:I -Landroid/bluetooth/BluetoothCodecConfig;->setCodecPriority(I)V -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_AAC:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_APTX:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_APTX_HD:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_INVALID:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_LDAC:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_MAX:I -Landroid/bluetooth/BluetoothCodecConfig;->SOURCE_CODEC_TYPE_SBC:I Landroid/bluetooth/BluetoothCodecStatus; -Landroid/bluetooth/BluetoothCodecStatus;->EXTRA_CODEC_STATUS:Ljava/lang/String; -Landroid/bluetooth/BluetoothCodecStatus;->getCodecConfig()Landroid/bluetooth/BluetoothCodecConfig; -Landroid/bluetooth/BluetoothCodecStatus;->getCodecsLocalCapabilities()[Landroid/bluetooth/BluetoothCodecConfig; -Landroid/bluetooth/BluetoothCodecStatus;->getCodecsSelectableCapabilities()[Landroid/bluetooth/BluetoothCodecConfig; -Landroid/bluetooth/BluetoothDevice;-><init>(Ljava/lang/String;)V -Landroid/bluetooth/BluetoothDevice;->ACTION_ALIAS_CHANGED:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->ACTION_DISAPPEARED:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->ACTION_PAIRING_CANCEL:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->ACTION_SDP_RECORD:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->cancelPairingUserInput()Z -Landroid/bluetooth/BluetoothDevice;->connectGatt(Landroid/content/Context;ZLandroid/bluetooth/BluetoothGattCallback;IZILandroid/os/Handler;)Landroid/bluetooth/BluetoothGatt; -Landroid/bluetooth/BluetoothDevice;->convertPinToBytes(Ljava/lang/String;)[B -Landroid/bluetooth/BluetoothDevice;->createBond(I)Z -Landroid/bluetooth/BluetoothDevice;->createInsecureRfcommSocket(I)Landroid/bluetooth/BluetoothSocket; -Landroid/bluetooth/BluetoothDevice;->createRfcommSocket(I)Landroid/bluetooth/BluetoothSocket; -Landroid/bluetooth/BluetoothDevice;->createScoSocket()Landroid/bluetooth/BluetoothSocket; -Landroid/bluetooth/BluetoothDevice;->EXTRA_REASON:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->EXTRA_SDP_SEARCH_STATUS:Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->getAlias()Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->getAliasName()Ljava/lang/String; -Landroid/bluetooth/BluetoothDevice;->getBatteryLevel()I -Landroid/bluetooth/BluetoothDevice;->getMessageAccessPermission()I -Landroid/bluetooth/BluetoothDevice;->getPhonebookAccessPermission()I -Landroid/bluetooth/BluetoothDevice;->getService()Landroid/bluetooth/IBluetooth; -Landroid/bluetooth/BluetoothDevice;->isBluetoothDock()Z -Landroid/bluetooth/BluetoothDevice;->isBondingInitiatedLocally()Z -Landroid/bluetooth/BluetoothDevice;->setAlias(Ljava/lang/String;)Z -Landroid/bluetooth/BluetoothDevice;->setMessageAccessPermission(I)Z -Landroid/bluetooth/BluetoothDevice;->setPasskey(I)Z -Landroid/bluetooth/BluetoothDevice;->setSimAccessPermission(I)Z -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_AUTH_FAILED:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_AUTH_REJECTED:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_AUTH_TIMEOUT:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_DISCOVERY_IN_PROGRESS:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_REMOTE_AUTH_CANCELED:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_REMOTE_DEVICE_DOWN:I -Landroid/bluetooth/BluetoothDevice;->UNBOND_REASON_REPEATED_ATTEMPTS:I -Landroid/bluetooth/BluetoothGatt;->connect(Ljava/lang/Boolean;Landroid/bluetooth/BluetoothGattCallback;Landroid/os/Handler;)Z -Landroid/bluetooth/BluetoothGatt;->mAuthRetryState:I -Landroid/bluetooth/BluetoothGatt;->mAutoConnect:Z -Landroid/bluetooth/BluetoothGatt;->mCallback:Landroid/bluetooth/BluetoothGattCallback; -Landroid/bluetooth/BluetoothGatt;->mClientIf:I -Landroid/bluetooth/BluetoothGatt;->mDeviceBusy:Ljava/lang/Boolean; -Landroid/bluetooth/BluetoothGatt;->mService:Landroid/bluetooth/IBluetoothGatt; -Landroid/bluetooth/BluetoothGatt;->mTransport:I -Landroid/bluetooth/BluetoothGatt;->refresh()Z -Landroid/bluetooth/BluetoothGatt;->unregisterApp()V -Landroid/bluetooth/BluetoothGattCharacteristic;->mInstance:I -Landroid/bluetooth/BluetoothGattCharacteristic;->mService:Landroid/bluetooth/BluetoothGattService; -Landroid/bluetooth/BluetoothGattCharacteristic;->setKeySize(I)V -Landroid/bluetooth/BluetoothGattCharacteristic;->setService(Landroid/bluetooth/BluetoothGattService;)V -Landroid/bluetooth/BluetoothGattDescriptor;->mCharacteristic:Landroid/bluetooth/BluetoothGattCharacteristic; -Landroid/bluetooth/BluetoothGattDescriptor;->mInstance:I -Landroid/bluetooth/BluetoothGattDescriptor;->setCharacteristic(Landroid/bluetooth/BluetoothGattCharacteristic;)V -Landroid/bluetooth/BluetoothGattService;->mDevice:Landroid/bluetooth/BluetoothDevice; -Landroid/bluetooth/BluetoothGattService;->setAdvertisePreferred(Z)V -Landroid/bluetooth/BluetoothGattService;->setInstanceId(I)V -Landroid/bluetooth/BluetoothHeadset;->ACTION_ACTIVE_DEVICE_CHANGED:Ljava/lang/String; -Landroid/bluetooth/BluetoothHeadset;->close()V -Landroid/bluetooth/BluetoothHeadset;->connectAudio()Z -Landroid/bluetooth/BluetoothHeadset;->disconnectAudio()Z -Landroid/bluetooth/BluetoothHeadset;->getActiveDevice()Landroid/bluetooth/BluetoothDevice; -Landroid/bluetooth/BluetoothHeadset;->getAudioState(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothHeadset;->getPriority(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothHeadset;->isEnabled()Z -Landroid/bluetooth/BluetoothHeadset;->setActiveDevice(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothHeadset;->startScoUsingVirtualVoiceCall()Z -Landroid/bluetooth/BluetoothHeadset;->stopScoUsingVirtualVoiceCall()Z -Landroid/bluetooth/BluetoothHeadsetClient;->acceptCall(Landroid/bluetooth/BluetoothDevice;I)Z -Landroid/bluetooth/BluetoothHeadsetClient;->connect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothHeadsetClient;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothHeadsetClient;->getAudioState(Landroid/bluetooth/BluetoothDevice;)I -Landroid/bluetooth/BluetoothHeadsetClient;->rejectCall(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothHeadsetClientCall;->getId()I -Landroid/bluetooth/BluetoothHeadsetClientCall;->getNumber()Ljava/lang/String; -Landroid/bluetooth/BluetoothHeadsetClientCall;->getState()I -Landroid/bluetooth/BluetoothHeadsetClientCall;->isMultiParty()Z -Landroid/bluetooth/BluetoothHeadsetClientCall;->isOutgoing()Z -Landroid/bluetooth/BluetoothHearingAid;->ACTION_ACTIVE_DEVICE_CHANGED:Ljava/lang/String; -Landroid/bluetooth/BluetoothHearingAid;->getActiveDevices()Ljava/util/List; -Landroid/bluetooth/BluetoothHearingAid;->setActiveDevice(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothMap;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothMapClient;->sendMessage(Landroid/bluetooth/BluetoothDevice;[Landroid/net/Uri;Ljava/lang/String;Landroid/app/PendingIntent;Landroid/app/PendingIntent;)Z -Landroid/bluetooth/BluetoothPan;-><init>(Landroid/content/Context;Landroid/bluetooth/BluetoothProfile$ServiceListener;)V -Landroid/bluetooth/BluetoothPan;->close()V -Landroid/bluetooth/BluetoothPan;->connect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothPan;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothPan;->doBind()Z -Landroid/bluetooth/BluetoothPan;->isEnabled()Z -Landroid/bluetooth/BluetoothPan;->isTetheringOn()Z -Landroid/bluetooth/BluetoothPan;->isValidDevice(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothPan;->log(Ljava/lang/String;)V -Landroid/bluetooth/BluetoothPan;->setBluetoothTethering(Z)V -Landroid/bluetooth/BluetoothPbap;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothProfile;->A2DP_SINK:I -Landroid/bluetooth/BluetoothProfile;->AVRCP_CONTROLLER:I -Landroid/bluetooth/BluetoothProfile;->PAN:I -Landroid/bluetooth/BluetoothProfile;->PRIORITY_AUTO_CONNECT:I -Landroid/bluetooth/BluetoothProfile;->PRIORITY_UNDEFINED:I -Landroid/bluetooth/BluetoothSap;->disconnect(Landroid/bluetooth/BluetoothDevice;)Z -Landroid/bluetooth/BluetoothServerSocket;->mSocket:Landroid/bluetooth/BluetoothSocket; -Landroid/bluetooth/BluetoothSocket;->EADDRINUSE:I -Landroid/bluetooth/BluetoothSocket;->flush()V -Landroid/bluetooth/BluetoothSocket;->mPfd:Landroid/os/ParcelFileDescriptor; -Landroid/bluetooth/BluetoothSocket;->mPort:I -Landroid/bluetooth/BluetoothSocket;->mSocket:Landroid/net/LocalSocket; -Landroid/bluetooth/BluetoothUuid;->AdvAudioDist:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->AudioSink:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->containsAnyUuid([Landroid/os/ParcelUuid;[Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->Handsfree:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->Hogp:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->HSP:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->is16BitUuid(Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->is32BitUuid(Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->isAdvAudioDist(Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->isAudioSource(Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->isAvrcpTarget(Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->isUuidPresent([Landroid/os/ParcelUuid;Landroid/os/ParcelUuid;)Z -Landroid/bluetooth/BluetoothUuid;->NAP:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->ObexObjectPush:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->PBAP_PSE:Landroid/os/ParcelUuid; -Landroid/bluetooth/BluetoothUuid;->RESERVED_UUIDS:[Landroid/os/ParcelUuid; Landroid/bluetooth/IBluetooth$Stub$Proxy;->getAddress()Ljava/lang/String; Landroid/bluetooth/IBluetooth$Stub$Proxy;->getConnectionState(Landroid/bluetooth/BluetoothDevice;)I Landroid/bluetooth/IBluetooth$Stub;-><init>()V @@ -1266,7 +1068,6 @@ Landroid/bluetooth/IBluetoothManager;->unregisterStateChangeCallback(Landroid/bl Landroid/bluetooth/IBluetoothManagerCallback$Stub;-><init>()V Landroid/bluetooth/IBluetoothPbap$Stub;->asInterface(Landroid/os/IBinder;)Landroid/bluetooth/IBluetoothPbap; Landroid/bluetooth/IBluetoothStateChangeCallback$Stub;-><init>()V -Landroid/bluetooth/le/ScanRecord;->parseFromBytes([B)Landroid/bluetooth/le/ScanRecord; Landroid/content/AsyncTaskLoader;->mExecutor:Ljava/util/concurrent/Executor; Landroid/content/AsyncTaskLoader;->waitForLoader()V Landroid/content/BroadcastReceiver$PendingResult;-><init>(ILjava/lang/String;Landroid/os/Bundle;IZZLandroid/os/IBinder;II)V diff --git a/config/hiddenapi-vendor-list.txt b/config/hiddenapi-vendor-list.txt index c3886f792d24..6307854e1e2d 100644 --- a/config/hiddenapi-vendor-list.txt +++ b/config/hiddenapi-vendor-list.txt @@ -61,7 +61,6 @@ Landroid/app/TaskStackListener;->onTaskStackChanged()V Landroid/app/VrStateCallback;-><init>()V Landroid/app/VrStateCallback;->onPersistentVrStateChanged(Z)V Landroid/app/WallpaperColors;-><init>(Landroid/graphics/Color;Landroid/graphics/Color;Landroid/graphics/Color;I)V -Landroid/bluetooth/BluetoothHeadset;->phoneStateChanged(IIILjava/lang/String;I)V Landroid/bluetooth/IBluetooth;->sendConnectionStateChange(Landroid/bluetooth/BluetoothDevice;III)V Landroid/companion/AssociationRequest;->getDeviceFilters()Ljava/util/List; Landroid/companion/AssociationRequest;->isSingleDevice()Z diff --git a/core/java/android/bluetooth/BluetoothA2dp.java b/core/java/android/bluetooth/BluetoothA2dp.java index 94fd138ca6e8..966f9025e8a3 100644 --- a/core/java/android/bluetooth/BluetoothA2dp.java +++ b/core/java/android/bluetooth/BluetoothA2dp.java @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -117,6 +118,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @hide */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @UnsupportedAppUsage public static final String ACTION_ACTIVE_DEVICE_CHANGED = "android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED"; @@ -137,6 +139,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @hide */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @UnsupportedAppUsage public static final String ACTION_CODEC_CONFIG_CHANGED = "android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED"; @@ -160,6 +163,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; /** @@ -167,6 +171,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; /** @@ -174,6 +179,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_SUPPORTED = 1; /** @@ -182,6 +188,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; /** @@ -189,6 +196,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; /** @@ -196,6 +204,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; private Context mContext; @@ -268,6 +277,7 @@ public final class BluetoothA2dp implements BluetoothProfile { return true; } + @UnsupportedAppUsage /*package*/ void close() { mServiceListener = null; IBluetoothManager mgr = mAdapter.getBluetoothManager(); @@ -315,6 +325,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); try { @@ -357,6 +368,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); try { @@ -460,6 +472,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean setActiveDevice(@Nullable BluetoothDevice device) { if (DBG) log("setActiveDevice(" + device + ")"); try { @@ -490,6 +503,7 @@ public final class BluetoothA2dp implements BluetoothProfile { */ @RequiresPermission(Manifest.permission.BLUETOOTH) @Nullable + @UnsupportedAppUsage public BluetoothDevice getActiveDevice() { if (VDBG) log("getActiveDevice()"); try { @@ -556,6 +570,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH) + @UnsupportedAppUsage public int getPriority(BluetoothDevice device) { if (VDBG) log("getPriority(" + device + ")"); try { @@ -671,6 +686,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @return the current codec status * @hide */ + @UnsupportedAppUsage public BluetoothCodecStatus getCodecStatus(BluetoothDevice device) { if (DBG) Log.d(TAG, "getCodecStatus(" + device + ")"); try { @@ -698,6 +714,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * @param codecConfig the codec configuration preference * @hide */ + @UnsupportedAppUsage public void setCodecConfigPreference(BluetoothDevice device, BluetoothCodecConfig codecConfig) { if (DBG) Log.d(TAG, "setCodecConfigPreference(" + device + ")"); @@ -723,6 +740,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * active A2DP Bluetooth device. * @hide */ + @UnsupportedAppUsage public void enableOptionalCodecs(BluetoothDevice device) { if (DBG) Log.d(TAG, "enableOptionalCodecs(" + device + ")"); enableDisableOptionalCodecs(device, true); @@ -735,6 +753,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * active A2DP Bluetooth device. * @hide */ + @UnsupportedAppUsage public void disableOptionalCodecs(BluetoothDevice device) { if (DBG) Log.d(TAG, "disableOptionalCodecs(" + device + ")"); enableDisableOptionalCodecs(device, false); @@ -775,6 +794,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * OPTIONAL_CODECS_SUPPORTED. * @hide */ + @UnsupportedAppUsage public int supportsOptionalCodecs(BluetoothDevice device) { try { mServiceLock.readLock().lock(); @@ -799,6 +819,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * OPTIONAL_CODECS_PREF_DISABLED. * @hide */ + @UnsupportedAppUsage public int getOptionalCodecsEnabled(BluetoothDevice device) { try { mServiceLock.readLock().lock(); @@ -824,6 +845,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * OPTIONAL_CODECS_PREF_DISABLED. * @hide */ + @UnsupportedAppUsage public void setOptionalCodecsEnabled(BluetoothDevice device, int value) { try { if (value != BluetoothA2dp.OPTIONAL_CODECS_PREF_UNKNOWN @@ -854,6 +876,7 @@ public final class BluetoothA2dp implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public static String stateToString(int state) { switch (state) { case STATE_DISCONNECTED: diff --git a/core/java/android/bluetooth/BluetoothA2dpSink.java b/core/java/android/bluetooth/BluetoothA2dpSink.java index 13f0aaf47f0c..fda2f8927535 100755 --- a/core/java/android/bluetooth/BluetoothA2dpSink.java +++ b/core/java/android/bluetooth/BluetoothA2dpSink.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -278,6 +279,7 @@ public final class BluetoothA2dpSink implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothA2dpSink service = mService; diff --git a/core/java/android/bluetooth/BluetoothAdapter.java b/core/java/android/bluetooth/BluetoothAdapter.java index 1b9e27ca7070..3c22905550ca 100644 --- a/core/java/android/bluetooth/BluetoothAdapter.java +++ b/core/java/android/bluetooth/BluetoothAdapter.java @@ -23,6 +23,7 @@ import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import android.app.ActivityThread; import android.bluetooth.le.BluetoothLeAdvertiser; import android.bluetooth.le.BluetoothLeScanner; @@ -633,6 +634,7 @@ public final class BluetoothAdapter { private static PeriodicAdvertisingManager sPeriodicAdvertisingManager; private final IBluetoothManager mManagerService; + @UnsupportedAppUsage private IBluetooth mService; private final ReentrantReadWriteLock mServiceLock = new ReentrantReadWriteLock(); @@ -988,6 +990,7 @@ public final class BluetoothAdapter { */ @RequiresPermission(Manifest.permission.BLUETOOTH) @AdapterState + @UnsupportedAppUsage public int getLeState() { int state = BluetoothAdapter.STATE_OFF; @@ -1098,6 +1101,7 @@ public final class BluetoothAdapter { * @return true to indicate adapter shutdown has begun, or false on immediate error * @hide */ + @UnsupportedAppUsage public boolean disable(boolean persist) { try { @@ -1149,6 +1153,7 @@ public final class BluetoothAdapter { * @return true to indicate that the config file was successfully cleared * @hide */ + @UnsupportedAppUsage public boolean factoryReset() { try { mServiceLock.readLock().lock(); @@ -1172,6 +1177,7 @@ public final class BluetoothAdapter { * @return the UUIDs supported by the local Bluetooth Adapter. * @hide */ + @UnsupportedAppUsage public ParcelUuid[] getUuids() { if (getState() != STATE_ON) { return null; @@ -1438,6 +1444,7 @@ public final class BluetoothAdapter { * @return true if the scan mode was set, false otherwise * @hide */ + @UnsupportedAppUsage public boolean setScanMode(@ScanMode int mode, int duration) { if (getState() != STATE_ON) { return false; @@ -1456,6 +1463,7 @@ public final class BluetoothAdapter { } /** @hide */ + @UnsupportedAppUsage public boolean setScanMode(int mode) { if (getState() != STATE_ON) { return false; @@ -1465,6 +1473,7 @@ public final class BluetoothAdapter { } /** @hide */ + @UnsupportedAppUsage public int getDiscoverableTimeout() { if (getState() != STATE_ON) { return -1; @@ -1483,6 +1492,7 @@ public final class BluetoothAdapter { } /** @hide */ + @UnsupportedAppUsage public void setDiscoverableTimeout(int timeout) { if (getState() != STATE_ON) { return; @@ -2007,6 +2017,7 @@ public final class BluetoothAdapter { * #STATE_CONNECTING} or {@link #STATE_DISCONNECTED} * @hide */ + @UnsupportedAppUsage public int getConnectionState() { if (getState() != STATE_ON) { return BluetoothAdapter.STATE_DISCONNECTED; @@ -2094,6 +2105,7 @@ public final class BluetoothAdapter { * permissions, or channel in use. * @hide */ + @UnsupportedAppUsage public BluetoothServerSocket listenUsingRfcommOn(int channel, boolean mitm, boolean min16DigitPin) throws IOException { BluetoothServerSocket socket = @@ -2206,6 +2218,7 @@ public final class BluetoothAdapter { * permissions, or channel in use. * @hide */ + @UnsupportedAppUsage public BluetoothServerSocket listenUsingEncryptedRfcommWithServiceRecord(String name, UUID uuid) throws IOException { return createNewRfcommSocketAndRecord(name, uuid, false, true); @@ -2749,6 +2762,7 @@ public final class BluetoothAdapter { return true; } + @UnsupportedAppUsage /*package*/ IBluetoothManager getBluetoothManager() { return mManagerService; } @@ -2756,6 +2770,7 @@ public final class BluetoothAdapter { private final ArrayList<IBluetoothManagerCallback> mProxyServiceStateCallbacks = new ArrayList<IBluetoothManagerCallback>(); + @UnsupportedAppUsage /*package*/ IBluetooth getBluetoothService(IBluetoothManagerCallback cb) { synchronized (mProxyServiceStateCallbacks) { if (cb == null) { diff --git a/core/java/android/bluetooth/BluetoothClass.java b/core/java/android/bluetooth/BluetoothClass.java index f22ea6e88e04..8557f389d913 100755 --- a/core/java/android/bluetooth/BluetoothClass.java +++ b/core/java/android/bluetooth/BluetoothClass.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -63,6 +64,7 @@ public final class BluetoothClass implements Parcelable { private final int mClass; /** @hide */ + @UnsupportedAppUsage public BluetoothClass(int classInt) { mClass = classInt; } @@ -322,8 +324,10 @@ public final class BluetoothClass implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public static final int PROFILE_HEADSET = 0; /** @hide */ + @UnsupportedAppUsage public static final int PROFILE_A2DP = 1; /** @hide */ public static final int PROFILE_OPP = 2; @@ -346,6 +350,7 @@ public final class BluetoothClass implements Parcelable { * @return True if this device might support specified profile. * @hide */ + @UnsupportedAppUsage public boolean doesClassMatch(int profile) { if (profile == PROFILE_A2DP) { if (hasService(Service.RENDER)) { diff --git a/core/java/android/bluetooth/BluetoothCodecConfig.java b/core/java/android/bluetooth/BluetoothCodecConfig.java index e3a6e064725e..79c0a3a207c4 100644 --- a/core/java/android/bluetooth/BluetoothCodecConfig.java +++ b/core/java/android/bluetooth/BluetoothCodecConfig.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -32,34 +33,58 @@ public final class BluetoothCodecConfig implements Parcelable { // Add an entry for each source codec here. // NOTE: The values should be same as those listed in the following file: // hardware/libhardware/include/hardware/bt_av.h + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_SBC = 0; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_AAC = 1; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX = 2; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_APTX_HD = 3; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_LDAC = 4; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_MAX = 5; + @UnsupportedAppUsage public static final int SOURCE_CODEC_TYPE_INVALID = 1000 * 1000; + @UnsupportedAppUsage public static final int CODEC_PRIORITY_DISABLED = -1; + @UnsupportedAppUsage public static final int CODEC_PRIORITY_DEFAULT = 0; + @UnsupportedAppUsage public static final int CODEC_PRIORITY_HIGHEST = 1000 * 1000; + @UnsupportedAppUsage public static final int SAMPLE_RATE_NONE = 0; + @UnsupportedAppUsage public static final int SAMPLE_RATE_44100 = 0x1 << 0; + @UnsupportedAppUsage public static final int SAMPLE_RATE_48000 = 0x1 << 1; + @UnsupportedAppUsage public static final int SAMPLE_RATE_88200 = 0x1 << 2; + @UnsupportedAppUsage public static final int SAMPLE_RATE_96000 = 0x1 << 3; + @UnsupportedAppUsage public static final int SAMPLE_RATE_176400 = 0x1 << 4; + @UnsupportedAppUsage public static final int SAMPLE_RATE_192000 = 0x1 << 5; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_NONE = 0; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_16 = 0x1 << 0; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_24 = 0x1 << 1; + @UnsupportedAppUsage public static final int BITS_PER_SAMPLE_32 = 0x1 << 2; + @UnsupportedAppUsage public static final int CHANNEL_MODE_NONE = 0; + @UnsupportedAppUsage public static final int CHANNEL_MODE_MONO = 0x1 << 0; + @UnsupportedAppUsage public static final int CHANNEL_MODE_STEREO = 0x1 << 1; private final int mCodecType; @@ -72,6 +97,7 @@ public final class BluetoothCodecConfig implements Parcelable { private final long mCodecSpecific3; private final long mCodecSpecific4; + @UnsupportedAppUsage public BluetoothCodecConfig(int codecType, int codecPriority, int sampleRate, int bitsPerSample, int channelMode, long codecSpecific1, @@ -276,6 +302,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec type */ + @UnsupportedAppUsage public int getCodecType() { return mCodecType; } @@ -296,6 +323,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec priority */ + @UnsupportedAppUsage public int getCodecPriority() { return mCodecPriority; } @@ -307,6 +335,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @param codecPriority the codec priority */ + @UnsupportedAppUsage public void setCodecPriority(int codecPriority) { mCodecPriority = codecPriority; } @@ -324,6 +353,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec sample rate */ + @UnsupportedAppUsage public int getSampleRate() { return mSampleRate; } @@ -338,6 +368,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec bits per sample */ + @UnsupportedAppUsage public int getBitsPerSample() { return mBitsPerSample; } @@ -351,6 +382,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return the codec channel mode */ + @UnsupportedAppUsage public int getChannelMode() { return mChannelMode; } @@ -360,6 +392,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value1. */ + @UnsupportedAppUsage public long getCodecSpecific1() { return mCodecSpecific1; } @@ -369,6 +402,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value2 */ + @UnsupportedAppUsage public long getCodecSpecific2() { return mCodecSpecific2; } @@ -378,6 +412,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value3 */ + @UnsupportedAppUsage public long getCodecSpecific3() { return mCodecSpecific3; } @@ -387,6 +422,7 @@ public final class BluetoothCodecConfig implements Parcelable { * * @return a codec specific value4 */ + @UnsupportedAppUsage public long getCodecSpecific4() { return mCodecSpecific4; } diff --git a/core/java/android/bluetooth/BluetoothCodecStatus.java b/core/java/android/bluetooth/BluetoothCodecStatus.java index 3a05e7093d40..78560d2de420 100644 --- a/core/java/android/bluetooth/BluetoothCodecStatus.java +++ b/core/java/android/bluetooth/BluetoothCodecStatus.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; @@ -37,6 +38,7 @@ public final class BluetoothCodecStatus implements Parcelable { * This extra represents the current codec status of the A2DP * profile. */ + @UnsupportedAppUsage public static final String EXTRA_CODEC_STATUS = "android.bluetooth.codec.extra.CODEC_STATUS"; @@ -137,6 +139,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return the current codec configuration */ + @UnsupportedAppUsage public BluetoothCodecConfig getCodecConfig() { return mCodecConfig; } @@ -146,6 +149,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs local capabilities */ + @UnsupportedAppUsage public BluetoothCodecConfig[] getCodecsLocalCapabilities() { return mCodecsLocalCapabilities; } @@ -155,6 +159,7 @@ public final class BluetoothCodecStatus implements Parcelable { * * @return an array with the codecs selectable capabilities */ + @UnsupportedAppUsage public BluetoothCodecConfig[] getCodecsSelectableCapabilities() { return mCodecsSelectableCapabilities; } diff --git a/core/java/android/bluetooth/BluetoothDevice.java b/core/java/android/bluetooth/BluetoothDevice.java index 7a6b72e980f5..818a749842f7 100644 --- a/core/java/android/bluetooth/BluetoothDevice.java +++ b/core/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)) { @@ -887,6 +903,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) { @@ -911,6 +928,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) { @@ -934,6 +952,7 @@ public final class BluetoothDevice implements Parcelable { * @see #getAlias() * @see #getName() */ + @UnsupportedAppUsage public String getAliasName() { String name = getAlias(); if (name == null) { @@ -952,6 +971,7 @@ public final class BluetoothDevice implements Parcelable { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH) + @UnsupportedAppUsage public int getBatteryLevel() { final IBluetooth service = sService; if (service == null) { @@ -1010,6 +1030,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) { @@ -1063,6 +1084,7 @@ public final class BluetoothDevice implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public boolean isBondingInitiatedLocally() { final IBluetooth service = sService; if (service == null) { @@ -1355,6 +1377,7 @@ public final class BluetoothDevice implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public boolean setPasskey(int passkey) { //TODO(BT) /* @@ -1395,6 +1418,7 @@ public final class BluetoothDevice implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public boolean cancelPairingUserInput() { final IBluetooth service = sService; if (service == null) { @@ -1410,6 +1434,7 @@ public final class BluetoothDevice implements Parcelable { } /** @hide */ + @UnsupportedAppUsage public boolean isBluetoothDock() { // TODO(BT) /* @@ -1435,6 +1460,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) { @@ -1479,6 +1505,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) { @@ -1501,6 +1528,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) { @@ -1543,6 +1571,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) { @@ -1581,6 +1610,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"); @@ -1733,6 +1763,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"); @@ -1752,6 +1783,7 @@ public final class BluetoothDevice implements Parcelable { * permissions. * @hide */ + @UnsupportedAppUsage public BluetoothSocket createScoSocket() throws IOException { if (!isBluetoothEnabled()) { Log.e(TAG, "Bluetooth is not enabled"); @@ -1769,6 +1801,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; @@ -1900,6 +1933,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) { diff --git a/core/java/android/bluetooth/BluetoothGatt.java b/core/java/android/bluetooth/BluetoothGatt.java index 457119dc5bfe..78248efdd048 100644 --- a/core/java/android/bluetooth/BluetoothGatt.java +++ b/core/java/android/bluetooth/BluetoothGatt.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Handler; import android.os.ParcelUuid; import android.os.RemoteException; @@ -41,16 +42,23 @@ public final class BluetoothGatt implements BluetoothProfile { private static final boolean DBG = true; private static final boolean VDBG = false; + @UnsupportedAppUsage private IBluetoothGatt mService; + @UnsupportedAppUsage private volatile BluetoothGattCallback mCallback; private Handler mHandler; + @UnsupportedAppUsage private int mClientIf; private BluetoothDevice mDevice; + @UnsupportedAppUsage private boolean mAutoConnect; + @UnsupportedAppUsage private int mAuthRetryState; private int mConnState; private final Object mStateLock = new Object(); + @UnsupportedAppUsage private Boolean mDeviceBusy = false; + @UnsupportedAppUsage private int mTransport; private int mPhy; private boolean mOpportunistic; @@ -810,6 +818,7 @@ public final class BluetoothGatt implements BluetoothProfile { /** * Unregister the current application and callbacks. */ + @UnsupportedAppUsage private void unregisterApp() { if (DBG) Log.d(TAG, "unregisterApp() - mClientIf=" + mClientIf); if (mService == null || mClientIf == 0) return; @@ -845,6 +854,7 @@ public final class BluetoothGatt implements BluetoothProfile { * automatically connect as soon as the remote device becomes available (true). * @return true, if the connection attempt was initiated successfully */ + @UnsupportedAppUsage /*package*/ boolean connect(Boolean autoConnect, BluetoothGattCallback callback, Handler handler) { if (DBG) { @@ -1407,6 +1417,7 @@ public final class BluetoothGatt implements BluetoothProfile { * * @hide */ + @UnsupportedAppUsage public boolean refresh() { if (DBG) Log.d(TAG, "refresh() - device: " + mDevice.getAddress()); if (mService == null || mClientIf == 0) return false; diff --git a/core/java/android/bluetooth/BluetoothGattCharacteristic.java b/core/java/android/bluetooth/BluetoothGattCharacteristic.java index 243ad359a48f..6d46b3a41867 100644 --- a/core/java/android/bluetooth/BluetoothGattCharacteristic.java +++ b/core/java/android/bluetooth/BluetoothGattCharacteristic.java @@ -15,6 +15,7 @@ */ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.ParcelUuid; import android.os.Parcelable; @@ -182,6 +183,7 @@ public class BluetoothGattCharacteristic implements Parcelable { * * @hide */ + @UnsupportedAppUsage protected int mInstance; /** @@ -218,6 +220,7 @@ public class BluetoothGattCharacteristic implements Parcelable { * * @hide */ + @UnsupportedAppUsage protected BluetoothGattService mService; /** @@ -381,6 +384,7 @@ public class BluetoothGattCharacteristic implements Parcelable { * * @hide */ + @UnsupportedAppUsage /*package*/ void setService(BluetoothGattService service) { mService = service; } @@ -464,6 +468,7 @@ public class BluetoothGattCharacteristic implements Parcelable { * * @hide */ + @UnsupportedAppUsage public void setKeySize(int keySize) { mKeySize = keySize; } diff --git a/core/java/android/bluetooth/BluetoothGattDescriptor.java b/core/java/android/bluetooth/BluetoothGattDescriptor.java index 217a5abf1fe5..3ffbb9e0c052 100644 --- a/core/java/android/bluetooth/BluetoothGattDescriptor.java +++ b/core/java/android/bluetooth/BluetoothGattDescriptor.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.ParcelUuid; import android.os.Parcelable; @@ -100,6 +101,7 @@ public class BluetoothGattDescriptor implements Parcelable { * * @hide */ + @UnsupportedAppUsage protected int mInstance; /** @@ -114,6 +116,7 @@ public class BluetoothGattDescriptor implements Parcelable { * * @hide */ + @UnsupportedAppUsage protected BluetoothGattCharacteristic mCharacteristic; /** @@ -205,6 +208,7 @@ public class BluetoothGattDescriptor implements Parcelable { * * @hide */ + @UnsupportedAppUsage /*package*/ void setCharacteristic(BluetoothGattCharacteristic characteristic) { mCharacteristic = characteristic; } diff --git a/core/java/android/bluetooth/BluetoothGattService.java b/core/java/android/bluetooth/BluetoothGattService.java index ce1dc1ce6311..8e740ee387d6 100644 --- a/core/java/android/bluetooth/BluetoothGattService.java +++ b/core/java/android/bluetooth/BluetoothGattService.java @@ -15,6 +15,7 @@ */ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.ParcelUuid; import android.os.Parcelable; @@ -48,6 +49,7 @@ public class BluetoothGattService implements Parcelable { * * @hide */ + @UnsupportedAppUsage protected BluetoothDevice mDevice; /** @@ -265,6 +267,7 @@ public class BluetoothGattService implements Parcelable { * * @hide */ + @UnsupportedAppUsage public void setInstanceId(int instanceId) { mInstanceId = instanceId; } @@ -382,6 +385,7 @@ public class BluetoothGattService implements Parcelable { * * @hide */ + @UnsupportedAppUsage public void setAdvertisePreferred(boolean advertisePreferred) { mAdvertisePreferred = advertisePreferred; } diff --git a/core/java/android/bluetooth/BluetoothHeadset.java b/core/java/android/bluetooth/BluetoothHeadset.java index 0c91a2054b8b..636b1b9b13ca 100644 --- a/core/java/android/bluetooth/BluetoothHeadset.java +++ b/core/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; } diff --git a/core/java/android/bluetooth/BluetoothHeadsetClient.java b/core/java/android/bluetooth/BluetoothHeadsetClient.java index 397b90656f3e..ec18d42698c1 100644 --- a/core/java/android/bluetooth/BluetoothHeadsetClient.java +++ b/core/java/android/bluetooth/BluetoothHeadsetClient.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -476,6 +477,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * @return <code>true</code> if command has been issued successfully; <code>false</code> * otherwise; upon completion HFP sends {@link #ACTION_CONNECTION_STATE_CHANGED} intent. */ + @UnsupportedAppUsage public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); final IBluetoothHeadsetClient service = mService; @@ -498,6 +500,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * @return <code>true</code> if command has been issued successfully; <code>false</code> * otherwise; upon completion HFP sends {@link #ACTION_CONNECTION_STATE_CHANGED} intent. */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothHeadsetClient service = mService; @@ -720,6 +723,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * @return <code>true</code> if command has been issued successfully; <code>false</code> * otherwise; upon completion HFP sends {@link #ACTION_CALL_CHANGED} intent. */ + @UnsupportedAppUsage public boolean acceptCall(BluetoothDevice device, int flag) { if (DBG) log("acceptCall()"); final IBluetoothHeadsetClient service = mService; @@ -766,6 +770,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * #EXTRA_AG_FEATURE_REJECT_CALL}. This method invocation will fail silently when feature is not * supported.</p> */ + @UnsupportedAppUsage public boolean rejectCall(BluetoothDevice device) { if (DBG) log("rejectCall()"); final IBluetoothHeadsetClient service = mService; @@ -943,6 +948,7 @@ public final class BluetoothHeadsetClient implements BluetoothProfile { * * Note: This is an internal function and shouldn't be exposed */ + @UnsupportedAppUsage public int getAudioState(BluetoothDevice device) { if (VDBG) log("getAudioState"); final IBluetoothHeadsetClient service = mService; diff --git a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java index d46b2e37467b..e02a2f4ae5d3 100644 --- a/core/java/android/bluetooth/BluetoothHeadsetClientCall.java +++ b/core/java/android/bluetooth/BluetoothHeadsetClientCall.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcelable; import android.os.SystemClock; @@ -143,6 +144,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { * * @return call id. */ + @UnsupportedAppUsage public int getId() { return mId; } @@ -162,6 +164,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { * * @return state of this particular phone call. */ + @UnsupportedAppUsage public int getState() { return mState; } @@ -171,6 +174,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { * * @return string representing phone number. */ + @UnsupportedAppUsage public String getNumber() { return mNumber; } @@ -189,6 +193,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { * * @return <code>true</code> if call is a multi party call, <code>false</code> otherwise. */ + @UnsupportedAppUsage public boolean isMultiParty() { return mMultiParty; } @@ -198,6 +203,7 @@ public final class BluetoothHeadsetClientCall implements Parcelable { * * @return <code>true</code> if its outgoing call, <code>false</code> otherwise. */ + @UnsupportedAppUsage public boolean isOutgoing() { return mOutgoing; } diff --git a/core/java/android/bluetooth/BluetoothHearingAid.java b/core/java/android/bluetooth/BluetoothHearingAid.java index 159e165d594f..606f00a8239d 100644 --- a/core/java/android/bluetooth/BluetoothHearingAid.java +++ b/core/java/android/bluetooth/BluetoothHearingAid.java @@ -21,6 +21,7 @@ import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -108,6 +109,7 @@ public final class BluetoothHearingAid implements BluetoothProfile { * receive. */ @SdkConstant(SdkConstantType.BROADCAST_INTENT_ACTION) + @UnsupportedAppUsage public static final String ACTION_ACTIVE_DEVICE_CHANGED = "android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED"; @@ -401,6 +403,7 @@ public final class BluetoothHearingAid implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean setActiveDevice(@Nullable BluetoothDevice device) { if (DBG) log("setActiveDevice(" + device + ")"); try { @@ -432,6 +435,7 @@ public final class BluetoothHearingAid implements BluetoothProfile { * @hide */ @RequiresPermission(Manifest.permission.BLUETOOTH) + @UnsupportedAppUsage public List<BluetoothDevice> getActiveDevices() { if (VDBG) log("getActiveDevices()"); try { diff --git a/core/java/android/bluetooth/BluetoothMap.java b/core/java/android/bluetooth/BluetoothMap.java index 0fa1d5d6295f..98c23c600f14 100644 --- a/core/java/android/bluetooth/BluetoothMap.java +++ b/core/java/android/bluetooth/BluetoothMap.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -233,6 +234,7 @@ public final class BluetoothMap implements BluetoothProfile { * @param device Remote Bluetooth Device * @return false on error, true otherwise */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothMap service = mService; diff --git a/core/java/android/bluetooth/BluetoothMapClient.java b/core/java/android/bluetooth/BluetoothMapClient.java index 4f21d936e562..183be5f38bd1 100644 --- a/core/java/android/bluetooth/BluetoothMapClient.java +++ b/core/java/android/bluetooth/BluetoothMapClient.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.app.PendingIntent; import android.content.ComponentName; import android.content.Context; @@ -358,6 +359,7 @@ public final class BluetoothMapClient implements BluetoothProfile { * @param deliveredIntent intent issued when message is delivered * @return true if the message is enqueued, false on error */ + @UnsupportedAppUsage public boolean sendMessage(BluetoothDevice device, Uri[] contacts, String message, PendingIntent sentIntent, PendingIntent deliveredIntent) { if (DBG) Log.d(TAG, "sendMessage(" + device + ", " + contacts + ", " + message); diff --git a/core/java/android/bluetooth/BluetoothPan.java b/core/java/android/bluetooth/BluetoothPan.java index 9f401eb3cefc..58be73296027 100644 --- a/core/java/android/bluetooth/BluetoothPan.java +++ b/core/java/android/bluetooth/BluetoothPan.java @@ -18,6 +18,7 @@ package android.bluetooth; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -129,6 +130,7 @@ public final class BluetoothPan implements BluetoothProfile { * Create a BluetoothPan proxy object for interacting with the local * Bluetooth Service which handles the Pan profile */ + @UnsupportedAppUsage /*package*/ BluetoothPan(Context context, ServiceListener l) { mContext = context; mServiceListener = l; @@ -142,6 +144,7 @@ public final class BluetoothPan implements BluetoothProfile { doBind(); } + @UnsupportedAppUsage boolean doBind() { Intent intent = new Intent(IBluetoothPan.class.getName()); ComponentName comp = intent.resolveSystemService(mContext.getPackageManager(), 0); @@ -154,6 +157,7 @@ public final class BluetoothPan implements BluetoothProfile { return true; } + @UnsupportedAppUsage /*package*/ void close() { if (VDBG) log("close()"); @@ -236,6 +240,7 @@ public final class BluetoothPan implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean connect(BluetoothDevice device) { if (DBG) log("connect(" + device + ")"); final IBluetoothPan service = mPanService; @@ -276,6 +281,7 @@ public final class BluetoothPan implements BluetoothProfile { * @return false on immediate error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothPan service = mPanService; @@ -348,6 +354,7 @@ public final class BluetoothPan implements BluetoothProfile { return BluetoothProfile.STATE_DISCONNECTED; } + @UnsupportedAppUsage public void setBluetoothTethering(boolean value) { if (DBG) log("setBluetoothTethering(" + value + ")"); final IBluetoothPan service = mPanService; @@ -360,6 +367,7 @@ public final class BluetoothPan implements BluetoothProfile { } } + @UnsupportedAppUsage public boolean isTetheringOn() { if (VDBG) log("isTetheringOn()"); final IBluetoothPan service = mPanService; @@ -392,14 +400,17 @@ public final class BluetoothPan implements BluetoothProfile { } }; + @UnsupportedAppUsage private boolean isEnabled() { return mAdapter.getState() == BluetoothAdapter.STATE_ON; } + @UnsupportedAppUsage private static boolean isValidDevice(BluetoothDevice device) { return device != null && BluetoothAdapter.checkBluetoothAddress(device.getAddress()); } + @UnsupportedAppUsage private static void log(String msg) { Log.d(TAG, msg); } diff --git a/core/java/android/bluetooth/BluetoothPbap.java b/core/java/android/bluetooth/BluetoothPbap.java index c60e9e075c87..ae264e19bb7c 100644 --- a/core/java/android/bluetooth/BluetoothPbap.java +++ b/core/java/android/bluetooth/BluetoothPbap.java @@ -17,6 +17,7 @@ package android.bluetooth; import android.annotation.SdkConstant; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -281,6 +282,7 @@ public class BluetoothPbap implements BluetoothProfile { */ // TODO: This is currently being used by SettingsLib and will be used in the future. // TODO: Must specify target device. Implement this in the service. + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { log("disconnect()"); final IBluetoothPbap service = mService; diff --git a/core/java/android/bluetooth/BluetoothProfile.java b/core/java/android/bluetooth/BluetoothProfile.java index 6aeb94da1175..9777b5cc6cdc 100644 --- a/core/java/android/bluetooth/BluetoothProfile.java +++ b/core/java/android/bluetooth/BluetoothProfile.java @@ -20,6 +20,7 @@ package android.bluetooth; import android.Manifest; import android.annotation.RequiresPermission; import android.annotation.SystemApi; +import android.annotation.UnsupportedAppUsage; import java.util.List; @@ -85,6 +86,7 @@ public interface BluetoothProfile { * * @hide */ + @UnsupportedAppUsage int PAN = 5; /** @@ -122,6 +124,7 @@ public interface BluetoothProfile { * * @hide */ + @UnsupportedAppUsage int A2DP_SINK = 11; /** @@ -129,6 +132,7 @@ public interface BluetoothProfile { * * @hide */ + @UnsupportedAppUsage int AVRCP_CONTROLLER = 12; /** @@ -192,6 +196,7 @@ public interface BluetoothProfile { * * @hide **/ + @UnsupportedAppUsage int PRIORITY_AUTO_CONNECT = 1000; /** @@ -217,6 +222,7 @@ public interface BluetoothProfile { * * @hide */ + @UnsupportedAppUsage int PRIORITY_UNDEFINED = -1; /** diff --git a/core/java/android/bluetooth/BluetoothSap.java b/core/java/android/bluetooth/BluetoothSap.java index c51e39a74186..1b732062f614 100644 --- a/core/java/android/bluetooth/BluetoothSap.java +++ b/core/java/android/bluetooth/BluetoothSap.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.content.ComponentName; import android.content.Context; import android.content.Intent; @@ -280,6 +281,7 @@ public final class BluetoothSap implements BluetoothProfile { * @return false on error, true otherwise * @hide */ + @UnsupportedAppUsage public boolean disconnect(BluetoothDevice device) { if (DBG) log("disconnect(" + device + ")"); final IBluetoothSap service = mService; diff --git a/core/java/android/bluetooth/BluetoothServerSocket.java b/core/java/android/bluetooth/BluetoothServerSocket.java index ebb7f187aea5..ba4b5a566799 100644 --- a/core/java/android/bluetooth/BluetoothServerSocket.java +++ b/core/java/android/bluetooth/BluetoothServerSocket.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.Handler; import android.os.ParcelUuid; import android.util.Log; @@ -69,6 +70,7 @@ public final class BluetoothServerSocket implements Closeable { private static final String TAG = "BluetoothServerSocket"; private static final boolean DBG = false; + @UnsupportedAppUsage /*package*/ final BluetoothSocket mSocket; private Handler mHandler; private int mMessage; diff --git a/core/java/android/bluetooth/BluetoothSocket.java b/core/java/android/bluetooth/BluetoothSocket.java index 09a5b593e521..780f896139f9 100644 --- a/core/java/android/bluetooth/BluetoothSocket.java +++ b/core/java/android/bluetooth/BluetoothSocket.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.net.LocalSocket; import android.os.ParcelFileDescriptor; import android.os.ParcelUuid; @@ -110,6 +111,7 @@ public final class BluetoothSocket implements Closeable { public static final int TYPE_L2CAP_LE = 4; /*package*/ static final int EBADFD = 77; + @UnsupportedAppUsage /*package*/ static final int EADDRINUSE = 98; /*package*/ static final int SEC_FLAG_ENCRYPT = 1; @@ -129,10 +131,13 @@ public final class BluetoothSocket implements Closeable { private boolean mExcludeSdp = false; /* when true no SPP SDP record will be created */ private boolean mAuthMitm = false; /* when true Man-in-the-middle protection will be enabled*/ private boolean mMin16DigitPin = false; /* Minimum 16 digit pin for sec mode 2 connections */ + @UnsupportedAppUsage private ParcelFileDescriptor mPfd; + @UnsupportedAppUsage private LocalSocket mSocket; private InputStream mSocketIS; private OutputStream mSocketOS; + @UnsupportedAppUsage private int mPort; /* RFCOMM channel or L2CAP psm */ private int mFd; private String mServiceName; @@ -517,6 +522,7 @@ public final class BluetoothSocket implements Closeable { * * @throws IOException if an i/o error occurs. */ + @UnsupportedAppUsage /*package*/ void flush() throws IOException { if (mSocketOS == null) throw new IOException("flush is called on null OutputStream"); if (VDBG) Log.d(TAG, "flush: " + mSocketOS); diff --git a/core/java/android/bluetooth/BluetoothUuid.java b/core/java/android/bluetooth/BluetoothUuid.java index 605dbd21993f..fdbfec00e627 100644 --- a/core/java/android/bluetooth/BluetoothUuid.java +++ b/core/java/android/bluetooth/BluetoothUuid.java @@ -16,6 +16,7 @@ package android.bluetooth; +import android.annotation.UnsupportedAppUsage; import android.os.ParcelUuid; import java.nio.ByteBuffer; @@ -37,16 +38,20 @@ public final class BluetoothUuid { * The following 128 bit values are calculated as: * uuid * 2^96 + BASE_UUID */ + @UnsupportedAppUsage public static final ParcelUuid AudioSink = ParcelUuid.fromString("0000110B-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid AudioSource = ParcelUuid.fromString("0000110A-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid AdvAudioDist = ParcelUuid.fromString("0000110D-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid HSP = ParcelUuid.fromString("00001108-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid HSP_AG = ParcelUuid.fromString("00001112-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid Handsfree = ParcelUuid.fromString("0000111E-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid Handsfree_AG = @@ -55,20 +60,24 @@ public final class BluetoothUuid { ParcelUuid.fromString("0000110E-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid AvrcpTarget = ParcelUuid.fromString("0000110C-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid ObexObjectPush = ParcelUuid.fromString("00001105-0000-1000-8000-00805f9b34fb"); public static final ParcelUuid Hid = ParcelUuid.fromString("00001124-0000-1000-8000-00805f9b34fb"); + @UnsupportedAppUsage public static final ParcelUuid Hogp = ParcelUuid.fromString("00001812-0000-1000-8000-00805f9b34fb"); public static final ParcelUuid PANU = ParcelUuid.fromString("00001115-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid NAP = ParcelUuid.fromString("00001116-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid BNEP = ParcelUuid.fromString("0000000f-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid PBAP_PCE = ParcelUuid.fromString("0000112e-0000-1000-8000-00805F9B34FB"); + @UnsupportedAppUsage public static final ParcelUuid PBAP_PSE = ParcelUuid.fromString("0000112f-0000-1000-8000-00805F9B34FB"); public static final ParcelUuid MAP = @@ -92,10 +101,12 @@ public final class BluetoothUuid { /** Length of bytes for 128 bit UUID */ public static final int UUID_BYTES_128_BIT = 16; + @UnsupportedAppUsage public static final ParcelUuid[] RESERVED_UUIDS = { AudioSink, AudioSource, AdvAudioDist, HSP, Handsfree, AvrcpController, AvrcpTarget, ObexObjectPush, PANU, NAP, MAP, MNS, MAS, SAP}; + @UnsupportedAppUsage public static boolean isAudioSource(ParcelUuid uuid) { return uuid.equals(AudioSource); } @@ -104,6 +115,7 @@ public final class BluetoothUuid { return uuid.equals(AudioSink); } + @UnsupportedAppUsage public static boolean isAdvAudioDist(ParcelUuid uuid) { return uuid.equals(AdvAudioDist); } @@ -120,6 +132,7 @@ public final class BluetoothUuid { return uuid.equals(AvrcpController); } + @UnsupportedAppUsage public static boolean isAvrcpTarget(ParcelUuid uuid) { return uuid.equals(AvrcpTarget); } @@ -162,6 +175,7 @@ public final class BluetoothUuid { * @param uuidArray - Array of ParcelUuids * @param uuid */ + @UnsupportedAppUsage public static boolean isUuidPresent(ParcelUuid[] uuidArray, ParcelUuid uuid) { if ((uuidArray == null || uuidArray.length == 0) && uuid == null) { return true; @@ -183,6 +197,7 @@ public final class BluetoothUuid { * @param uuidA - List of ParcelUuids * @param uuidB - List of ParcelUuids */ + @UnsupportedAppUsage public static boolean containsAnyUuid(ParcelUuid[] uuidA, ParcelUuid[] uuidB) { if (uuidA == null && uuidB == null) return true; @@ -330,6 +345,7 @@ public final class BluetoothUuid { * @param parcelUuid * @return true if the parcelUuid can be converted to 16 bit uuid, false otherwise. */ + @UnsupportedAppUsage public static boolean is16BitUuid(ParcelUuid parcelUuid) { UUID uuid = parcelUuid.getUuid(); if (uuid.getLeastSignificantBits() != BASE_UUID.getUuid().getLeastSignificantBits()) { @@ -345,6 +361,7 @@ public final class BluetoothUuid { * @param parcelUuid * @return true if the parcelUuid can be converted to 32 bit uuid, false otherwise. */ + @UnsupportedAppUsage public static boolean is32BitUuid(ParcelUuid parcelUuid) { UUID uuid = parcelUuid.getUuid(); if (uuid.getLeastSignificantBits() != BASE_UUID.getUuid().getLeastSignificantBits()) { diff --git a/core/java/android/bluetooth/le/ScanRecord.java b/core/java/android/bluetooth/le/ScanRecord.java index 04dd060cae5d..07ed18d90ee6 100644 --- a/core/java/android/bluetooth/le/ScanRecord.java +++ b/core/java/android/bluetooth/le/ScanRecord.java @@ -17,6 +17,7 @@ package android.bluetooth.le; import android.annotation.Nullable; +import android.annotation.UnsupportedAppUsage; import android.bluetooth.BluetoothUuid; import android.os.ParcelUuid; import android.util.ArrayMap; @@ -174,6 +175,7 @@ public final class ScanRecord { * @param scanRecord The scan record of Bluetooth LE advertisement and/or scan response. * @hide */ + @UnsupportedAppUsage public static ScanRecord parseFromBytes(byte[] scanRecord) { if (scanRecord == null) { return null; |