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

Commit 229474ec authored by Pulkit Bhuwalka's avatar Pulkit Bhuwalka Committed by android-build-merger
Browse files

Merge "Add IntDef to BluetoothAdapter IO_CAP constants" am: c1fd61b3 am: 84384d59

am: 44dfe29e

Change-Id: If99923316742dbc18ce2c66bc529971ededba485
parents 595d12e5 44dfe29e
Loading
Loading
Loading
Loading
+10 −2
Original line number Diff line number Diff line
@@ -446,6 +446,12 @@ public final class BluetoothAdapter {
     */
    public static final int IO_CAPABILITY_UNKNOWN = 255;

    /** @hide */
    @IntDef({IO_CAPABILITY_OUT, IO_CAPABILITY_IO, IO_CAPABILITY_IN, IO_CAPABILITY_NONE,
            IO_CAPABILITY_KBDISP})
    @Retention(RetentionPolicy.SOURCE)
    public @interface IoCapability {}

    /**
     * Broadcast Action: The local Bluetooth adapter has started the remote
     * device discovery process.
@@ -1292,6 +1298,7 @@ public final class BluetoothAdapter {
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @IoCapability
    public int getIoCapability() {
        if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN;
        try {
@@ -1319,7 +1326,7 @@ public final class BluetoothAdapter {
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean setIoCapability(int capability) {
    public boolean setIoCapability(@IoCapability int capability) {
        if (getState() != STATE_ON) return false;
        try {
            mServiceLock.readLock().lock();
@@ -1342,6 +1349,7 @@ public final class BluetoothAdapter {
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_ADMIN)
    @IoCapability
    public int getLeIoCapability() {
        if (getState() != STATE_ON) return BluetoothAdapter.IO_CAPABILITY_UNKNOWN;
        try {
@@ -1369,7 +1377,7 @@ public final class BluetoothAdapter {
     * @hide
     */
    @RequiresPermission(Manifest.permission.BLUETOOTH_PRIVILEGED)
    public boolean setLeIoCapability(int capability) {
    public boolean setLeIoCapability(@IoCapability int capability) {
        if (getState() != STATE_ON) return false;
        try {
            mServiceLock.readLock().lock();