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

Commit 51405bd7 authored by William Escande's avatar William Escande
Browse files

Fix after API_review

* isMandatoryCodec is now public
* SCAN_FAILED_OUT_OF_HARDWARE/SCANNING_TOO_FREQUENTLY is now public with a
IntDef (method using the value are changed accordingly)
* Update doc for EXTRA_BATTERY_LEVEL and EXTRA_PAIRING_INITIATOR and
ACTION_CONNECTION_STATE_CHANGED
* Add Autoclosable to BluetoothSap to remove the NotCloseable
* BluetoothClass.Device.PERI* are now public

Bug: 222725037
Fix: 221851154
Test: Build + TH
Tag: #refactor
CTS-Coverage-Bug: 222539659
Merged-In: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
Change-Id: Ia6aa778d6bdc0319266c52a84633ee593eaa7eb0
parent a7925e53
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -362,6 +362,10 @@ package android.bluetooth {
    field public static final int HEALTH_THERMOMETER = 2312; // 0x908
    field public static final int HEALTH_UNCATEGORIZED = 2304; // 0x900
    field public static final int HEALTH_WEIGHING = 2316; // 0x90c
    field public static final int PERIPHERAL_KEYBOARD = 1344; // 0x540
    field public static final int PERIPHERAL_KEYBOARD_POINTING = 1472; // 0x5c0
    field public static final int PERIPHERAL_NON_KEYBOARD_NON_POINTING = 1280; // 0x500
    field public static final int PERIPHERAL_POINTING = 1408; // 0x580
    field public static final int PHONE_CELLULAR = 516; // 0x204
    field public static final int PHONE_CORDLESS = 520; // 0x208
    field public static final int PHONE_ISDN = 532; // 0x214
@@ -423,6 +427,7 @@ package android.bluetooth {
    method public long getCodecSpecific4();
    method public int getCodecType();
    method public int getSampleRate();
    method public boolean isMandatoryCodec();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BITS_PER_SAMPLE_16 = 1; // 0x1
    field public static final int BITS_PER_SAMPLE_24 = 2; // 0x2
@@ -1227,6 +1232,8 @@ package android.bluetooth.le {
    field public static final int SCAN_FAILED_APPLICATION_REGISTRATION_FAILED = 2; // 0x2
    field public static final int SCAN_FAILED_FEATURE_UNSUPPORTED = 4; // 0x4
    field public static final int SCAN_FAILED_INTERNAL_ERROR = 3; // 0x3
    field public static final int SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES = 5; // 0x5
    field public static final int SCAN_FAILED_SCANNING_TOO_FREQUENTLY = 6; // 0x6
  }

  public final class ScanFilter implements android.os.Parcelable {
+1 −17
Original line number Diff line number Diff line
@@ -112,17 +112,6 @@ package android.bluetooth {
    method public abstract void onBluetoothServiceUp();
  }

  public static class BluetoothClass.Device {
    field public static final int PERIPHERAL_KEYBOARD = 1344; // 0x540
    field public static final int PERIPHERAL_KEYBOARD_POINTING = 1472; // 0x5c0
    field public static final int PERIPHERAL_NON_KEYBOARD_NON_POINTING = 1280; // 0x500
    field public static final int PERIPHERAL_POINTING = 1408; // 0x580
  }

  public final class BluetoothCodecConfig implements android.os.Parcelable {
    method public boolean isMandatoryCodec();
  }

  public final class BluetoothCsipSetCoordinator implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.List<java.lang.Integer> getAllGroupIds(@Nullable android.os.ParcelUuid);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
@@ -610,7 +599,7 @@ package android.bluetooth {
    field public static final int VOLUME_CONTROL = 23; // 0x17
  }

  public final class BluetoothSap implements android.bluetooth.BluetoothProfile {
  public final class BluetoothSap implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.sap.profile.action.CONNECTION_STATE_CHANGED";
@@ -831,11 +820,6 @@ package android.bluetooth.le {
    field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ResultStorageDescriptor> CREATOR;
  }

  public abstract class ScanCallback {
    field public static final int SCAN_FAILED_OUT_OF_HARDWARE_RESOURCES = 5; // 0x5
    field public static final int SCAN_FAILED_SCANNING_TOO_FREQUENTLY = 6; // 0x6
  }

  public final class ScanFilter implements android.os.Parcelable {
    method public int getAddressType();
    method @Nullable public byte[] getIrk();
+0 −17
Original line number Diff line number Diff line
@@ -17,7 +17,6 @@
package android.bluetooth;

import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Build;
import android.os.Parcel;
@@ -242,25 +241,9 @@ public final class BluetoothClass implements Parcelable {
        public static final int HEALTH_DATA_DISPLAY = 0x091C;

        // Devices in PERIPHERAL major class
        /**
         * @hide
         */
        @SystemApi
        public static final int PERIPHERAL_NON_KEYBOARD_NON_POINTING = 0x0500;
        /**
         * @hide
         */
        @SystemApi
        public static final int PERIPHERAL_KEYBOARD = 0x0540;
        /**
         * @hide
         */
        @SystemApi
        public static final int PERIPHERAL_POINTING = 0x0580;
        /**
         * @hide
         */
        @SystemApi
        public static final int PERIPHERAL_KEYBOARD_POINTING = 0x05C0;
    }

+0 −3
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package android.bluetooth;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.compat.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;
@@ -484,9 +483,7 @@ public final class BluetoothCodecConfig implements Parcelable {
     * See {@link #SOURCE_CODEC_TYPE_SBC}.
     *
     * @return {@code true} if the codec is mandatory, {@code false} otherwise
     * @hide
     */
    @SystemApi
    public boolean isMandatoryCodec() {
        return mCodecType == SOURCE_CODEC_TYPE_SBC;
    }
+6 −2
Original line number Diff line number Diff line
@@ -263,7 +263,8 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * Used as an Integer extra field in {@link #ACTION_BATTERY_LEVEL_CHANGED}
     * intent. It contains the most recently retrieved battery level information
     * ranging from 0% to 100% for a remote device, {@link #BATTERY_LEVEL_UNKNOWN}
     * when the valid is unknown or there is an error
     * when the valid is unknown or there is an error, {@link #BATTERY_LEVEL_BLUETOOTH_OFF} when the
     * bluetooth is off
     *
     * @hide
     */
@@ -414,7 +415,10 @@ public final class BluetoothDevice implements Parcelable, Attributable {

    /**
     * Used as an int extra field in {@link #ACTION_PAIRING_REQUEST}
     * intents as the value of passkey.
     * intents as the location of initiator. Possible value are:
     * {@link #EXTRA_PAIRING_INITIATOR_FOREGROUND},
     * {@link #EXTRA_PAIRING_INITIATOR_BACKGROUND},
     *
     * @hide
     */
    @SystemApi
Loading