Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 65b11ccc authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Update BluetoothPbap class description to indicate how to create an...

Merge "Update BluetoothPbap class description to indicate how to create an instance of the class, add intdef to return value of BluetoothPbap#getConnectionState, and move all SystemApis to require the BLUETOOTH_PRIVILEGED permission" am: cc89e59203 am: d2e1ca39 am: c12fe204

Change-Id: Ie7d5fb2def3e86d488150cc271e788e346f2ac76
parents 3b91300c c12fe204
Loading
Loading
Loading
Loading
+9 −5
Original line number Diff line number Diff line
@@ -38,9 +38,6 @@ import java.util.Arrays;
import java.util.List;

/**
 * The Android Bluetooth API is not finalized, and *will* change. Use at your
 * own risk.
 *
 * Public API for controlling the Bluetooth Pbap Service. This includes
 * Bluetooth Phone book Access profile.
 * BluetoothPbap is a proxy object for controlling the Bluetooth Pbap
@@ -56,6 +53,11 @@ import java.util.List;
 * notification when it is bound, this is especially important if you wish to
 * immediately call methods on BluetoothPbap after construction.
 *
 * To get an instance of the BluetoothPbap class, you can call
 * {@link BluetoothAdapter#getProfileProxy(Context, ServiceListener, int)} with the final param
 * being {@link BluetoothProfile#PBAP}. The ServiceListener should be able to get the instance of
 * BluetoothPbap in {@link android.bluetooth.BluetoothProfile.ServiceListener#onServiceConnected}.
 *
 * Android only supports one connected Bluetooth Pce at a time.
 *
 * @hide
@@ -87,6 +89,7 @@ public class BluetoothPbap implements BluetoothProfile {
     */
    @SuppressLint("ActionValue")
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    @SdkConstant(SdkConstant.SdkConstantType.BROADCAST_INTENT_ACTION)
    public static final String ACTION_CONNECTION_STATE_CHANGED =
            "android.bluetooth.pbap.profile.action.CONNECTION_STATE_CHANGED";
@@ -235,7 +238,8 @@ public class BluetoothPbap implements BluetoothProfile {
     */
    @SystemApi
    @Override
    public int getConnectionState(@Nullable BluetoothDevice device) {
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public @BtProfileState int getConnectionState(@Nullable BluetoothDevice device) {
        log("getConnectionState: device=" + device);
        try {
            final IBluetoothPbap service = mService;
@@ -287,7 +291,7 @@ public class BluetoothPbap implements BluetoothProfile {
     * @hide
     */
    @SystemApi
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean setConnectionPolicy(@NonNull BluetoothDevice device,
            @ConnectionPolicy int connectionPolicy) {
        if (DBG) log("setConnectionPolicy(" + device + ", " + connectionPolicy + ")");