Add SystemApis annotations

There are some number of places where bluetooth APIs are used via
reflection from GMSCore. Add proper annotations.

Bug: 67052734
Test: Manual - and using make update-api
Change-Id: Ib6e3aa1ff5b6f9cdc78367f9be13ed00542d6f65
(cherry picked from commit 64bd35ef2c)
This commit is contained in:
Selim Gurun
2017-10-17 17:01:38 -07:00
committed by Jack He
parent 6efee9c079
commit 4029fa6039
4 changed files with 28 additions and 0 deletions

View File

@@ -615,6 +615,7 @@ package android.bluetooth {
public final class BluetoothAdapter {
method public boolean disableBLE();
method public boolean enableBLE();
method public boolean enableNoAutoConnect();
method public boolean isBleScanAlwaysAvailable();
method public boolean isLeEnabled();
field public static final java.lang.String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
@@ -622,8 +623,17 @@ package android.bluetooth {
}
public final class BluetoothDevice implements android.os.Parcelable {
method public boolean cancelBondProcess();
method public boolean isConnected();
method public boolean isEncrypted();
method public boolean removeBond();
method public boolean setPhonebookAccessPermission(int);
}
public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
method public boolean connect(android.bluetooth.BluetoothDevice);
method public boolean disconnect(android.bluetooth.BluetoothDevice);
method public boolean setPriority(android.bluetooth.BluetoothDevice, int);
}
}

View File

@@ -2425,6 +2425,8 @@ public final class BluetoothAdapter {
*
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean enableNoAutoConnect() {
if (isEnabled()) {
if (DBG) {

View File

@@ -1098,6 +1098,8 @@ public final class BluetoothDevice implements Parcelable {
* @return true on success, false on error
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean cancelBondProcess() {
final IBluetooth service = sService;
if (service == null) {
@@ -1125,6 +1127,8 @@ public final class BluetoothDevice implements Parcelable {
* @return true on success, false on error
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean removeBond() {
final IBluetooth service = sService;
if (service == null) {
@@ -1174,6 +1178,7 @@ public final class BluetoothDevice implements Parcelable {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH)
public boolean isConnected() {
final IBluetooth service = sService;
if (service == null) {
@@ -1197,6 +1202,7 @@ public final class BluetoothDevice implements Parcelable {
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH)
public boolean isEncrypted() {
final IBluetooth service = sService;
if (service == null) {
@@ -1444,6 +1450,8 @@ public final class BluetoothDevice implements Parcelable {
* @return Whether the value has been successfully set.
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
public boolean setPhonebookAccessPermission(int value) {
final IBluetooth service = sService;
if (service == null) {

View File

@@ -16,8 +16,10 @@
package android.bluetooth;
import android.annotation.RequiresPermission;
import android.annotation.SdkConstant;
import android.annotation.SdkConstant.SdkConstantType;
import android.annotation.SystemApi;
import android.content.ComponentName;
import android.content.Context;
import android.os.Binder;
@@ -416,6 +418,8 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return false on immediate error, true otherwise
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean connect(BluetoothDevice device) {
if (DBG) log("connect(" + device + ")");
final IBluetoothHeadset service = mService;
@@ -456,6 +460,8 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return false on immediate error, true otherwise
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean disconnect(BluetoothDevice device) {
if (DBG) log("disconnect(" + device + ")");
final IBluetoothHeadset service = mService;
@@ -543,6 +549,8 @@ public final class BluetoothHeadset implements BluetoothProfile {
* @return true if priority is set, false on error
* @hide
*/
@SystemApi
@RequiresPermission(android.Manifest.permission.BLUETOOTH_ADMIN)
public boolean setPriority(BluetoothDevice device, int priority) {
if (DBG) log("setPriority(" + device + ", " + priority + ")");
final IBluetoothHeadset service = mService;