// Signature format: 2.0
package android.bluetooth {

  public final class BluetoothA2dp implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void disableOptionalCodecs(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void enableOptionalCodecs(@NonNull android.bluetooth.BluetoothDevice);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BufferConstraints getBufferConstraints();
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothCodecStatus getCodecStatus(@NonNull android.bluetooth.BluetoothDevice);
    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 int getDynamicBufferSupport();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isOptionalCodecsEnabled(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isOptionalCodecsSupported(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setAvrcpAbsoluteVolume(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setBufferLengthMillis(int, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setCodecConfigPreference(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothCodecConfig);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setOptionalCodecsEnabled(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACTIVE_DEVICE_CHANGED = "android.bluetooth.a2dp.profile.action.ACTIVE_DEVICE_CHANGED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CODEC_CONFIG_CHANGED = "android.bluetooth.a2dp.profile.action.CODEC_CONFIG_CHANGED";
    field public static final int DYNAMIC_BUFFER_SUPPORT_A2DP_OFFLOAD = 1; // 0x1
    field public static final int DYNAMIC_BUFFER_SUPPORT_A2DP_SOFTWARE_ENCODING = 2; // 0x2
    field public static final int DYNAMIC_BUFFER_SUPPORT_NONE = 0; // 0x0
    field public static final int OPTIONAL_CODECS_NOT_SUPPORTED = 0; // 0x0
    field public static final int OPTIONAL_CODECS_PREF_DISABLED = 0; // 0x0
    field public static final int OPTIONAL_CODECS_PREF_ENABLED = 1; // 0x1
    field public static final int OPTIONAL_CODECS_PREF_UNKNOWN = -1; // 0xffffffff
    field public static final int OPTIONAL_CODECS_SUPPORTED = 1; // 0x1
    field public static final int OPTIONAL_CODECS_SUPPORT_UNKNOWN = -1; // 0xffffffff
  }

  public final class BluetoothA2dpSink implements android.bluetooth.BluetoothProfile {
    method public void finalize();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isAudioPlaying(@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.a2dp-sink.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothActivityEnergyInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getBluetoothStackState();
    method public long getControllerEnergyUsed();
    method public long getControllerIdleTimeMillis();
    method public long getControllerRxTimeMillis();
    method public long getControllerTxTimeMillis();
    method public long getTimestampMillis();
    method @NonNull public java.util.List<android.bluetooth.UidTraffic> getUidTraffic();
    method public boolean isValid();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BT_STACK_STATE_INVALID = 0; // 0x0
    field public static final int BT_STACK_STATE_STATE_ACTIVE = 1; // 0x1
    field public static final int BT_STACK_STATE_STATE_IDLE = 3; // 0x3
    field public static final int BT_STACK_STATE_STATE_SCANNING = 2; // 0x2
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothActivityEnergyInfo> CREATOR;
  }

  public final class BluetoothAdapter {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean addOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean clearBluetooth();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean disable(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableBLE();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean enableNoAutoConnect();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void generateLocalOobData(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OobDataCallback);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getActiveDevices(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getBluetoothHciSnoopLoggingMode();
    method public int getConnectionState();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public long getDiscoveryEndMillis();
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.le.DistanceMeasurementManager getDistanceMeasurementManager();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getMostRecentlyConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getOffloadedTransportDiscoveryDataScanSupported();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.os.Bundle getPreferredAudioProfiles(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<java.lang.Integer> getSupportedProfiles();
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.os.ParcelUuid> getUuidsList();
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnEnabled();
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean isAutoOnSupported();
    method public boolean isBleScanAlwaysAvailable();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isDistanceMeasurementSupported();
    method public boolean isLeEnabled();
    method @NonNull public static String nameForState(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int notifyActiveDeviceChangeApplied(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean registerBluetoothConnectionCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.BluetoothConnectionCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int registerBluetoothQualityReportReadyCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.BluetoothQualityReportReadyCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int registerPreferredAudioProfilesChangedCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.PreferredAudioProfilesChangedCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean removeActiveDevice(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean removeOnMetadataChangedListener(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothAdapter.OnMetadataChangedListener);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void requestControllerActivityEnergyInfo(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothSocket retrieveConnectedRfcommSocket(@NonNull java.util.UUID);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean setActiveDevice(@NonNull android.bluetooth.BluetoothDevice, int);
    method @FlaggedApi("com.android.bluetooth.flags.auto_on_feature") @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void setAutoOnEnabled(boolean);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int setBluetoothHciSnoopLoggingMode(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setDiscoverableTimeout(@NonNull java.time.Duration);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setPreferredAudioProfiles(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.os.Bundle);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setScanMode(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int startRfcommServer(@NonNull String, @NonNull java.util.UUID, @NonNull android.app.PendingIntent);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int stopRfcommServer(@NonNull java.util.UUID);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean unregisterBluetoothConnectionCallback(@NonNull android.bluetooth.BluetoothAdapter.BluetoothConnectionCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int unregisterBluetoothQualityReportReadyCallback(@NonNull android.bluetooth.BluetoothAdapter.BluetoothQualityReportReadyCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int unregisterPreferredAudioProfilesChangedCallback(@NonNull android.bluetooth.BluetoothAdapter.PreferredAudioProfilesChangedCallback);
    field public static final String ACTION_BLE_STATE_CHANGED = "android.bluetooth.adapter.action.BLE_STATE_CHANGED";
    field public static final String ACTION_REQUEST_BLE_SCAN_ALWAYS_AVAILABLE = "android.bluetooth.adapter.action.REQUEST_BLE_SCAN_ALWAYS_AVAILABLE";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_REQUEST_DISABLE = "android.bluetooth.adapter.action.REQUEST_DISABLE";
    field public static final int ACTIVE_DEVICE_ALL = 2; // 0x2
    field public static final int ACTIVE_DEVICE_AUDIO = 0; // 0x0
    field public static final int ACTIVE_DEVICE_PHONE_CALL = 1; // 0x1
    field public static final String AUDIO_MODE_DUPLEX = "audio_mode_duplex";
    field public static final String AUDIO_MODE_OUTPUT_ONLY = "audio_mode_output_only";
    field public static final int BT_SNOOP_LOG_MODE_DISABLED = 0; // 0x0
    field public static final int BT_SNOOP_LOG_MODE_FILTERED = 1; // 0x1
    field public static final int BT_SNOOP_LOG_MODE_FULL = 2; // 0x2
    field public static final String EXTRA_RFCOMM_LISTENER_ID = "android.bluetooth.adapter.extra.RFCOMM_LISTENER_ID";
    field public static final int STATE_BLE_ON = 15; // 0xf
  }

  public abstract static class BluetoothAdapter.BluetoothConnectionCallback {
    ctor public BluetoothAdapter.BluetoothConnectionCallback();
    method @NonNull public static String disconnectReasonToString(int);
    method public void onDeviceConnected(@NonNull android.bluetooth.BluetoothDevice);
    method public void onDeviceDisconnected(@NonNull android.bluetooth.BluetoothDevice, int);
  }

  public static interface BluetoothAdapter.BluetoothQualityReportReadyCallback {
    method public void onBluetoothQualityReportReady(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothQualityReport, int);
  }

  public static interface BluetoothAdapter.OnBluetoothActivityEnergyInfoCallback {
    method public void onBluetoothActivityEnergyInfoAvailable(@NonNull android.bluetooth.BluetoothActivityEnergyInfo);
    method public void onBluetoothActivityEnergyInfoError(int);
  }

  public static interface BluetoothAdapter.OnMetadataChangedListener {
    method public void onMetadataChanged(@NonNull android.bluetooth.BluetoothDevice, int, @Nullable byte[]);
  }

  public static interface BluetoothAdapter.OobDataCallback {
    method public void onError(int);
    method public void onOobData(int, @NonNull android.bluetooth.OobData);
  }

  public static interface BluetoothAdapter.PreferredAudioProfilesChangedCallback {
    method public void onPreferredAudioProfilesChanged(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.os.Bundle, int);
  }

  public static class BluetoothAssignedNumbers.OrganizationId {
    field public static final int BLUETOOTH_SIG = 1; // 0x1
    field public static final int WIFI_ALLIANCE_NEIGHBOR_AWARENESS_NETWORKING = 2; // 0x2
    field public static final int WIFI_ALLIANCE_SERVICE_ADVERTISEMENT = 3; // 0x3
  }

  public final class BluetoothClass implements android.os.Parcelable {
    field public static final int PROFILE_A2DP_SINK = 6; // 0x6
    field public static final int PROFILE_NAP = 5; // 0x5
    field public static final int PROFILE_OPP = 2; // 0x2
    field public static final int PROFILE_PANU = 4; // 0x4
  }

  @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") public final class BluetoothCodecType implements android.os.Parcelable {
    ctor public BluetoothCodecType(int, long, @NonNull String);
    method @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @Nullable public static android.bluetooth.BluetoothCodecType createFromType(int);
  }

  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);
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.Map<java.lang.Integer,android.os.ParcelUuid> getGroupUuidMapByDevice(@Nullable android.bluetooth.BluetoothDevice);
    method @Nullable @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public java.util.UUID lockGroup(int, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothCsipSetCoordinator.ClientLockCallback);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean setConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public boolean unlockGroup(@NonNull java.util.UUID);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_DEVICE_AVAILABLE = "android.bluetooth.action.CSIS_DEVICE_AVAILABLE";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public static final String ACTION_CSIS_SET_MEMBER_AVAILABLE = "android.bluetooth.action.CSIS_SET_MEMBER_AVAILABLE";
    field public static final String EXTRA_CSIS_GROUP_ID = "android.bluetooth.extra.CSIS_GROUP_ID";
    field public static final int GROUP_ID_INVALID = -1; // 0xffffffff
  }

  public static interface BluetoothCsipSetCoordinator.ClientLockCallback {
    method public void onGroupLockSet(int, int, boolean);
  }

  public final class BluetoothDevice implements android.os.Parcelable {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean canBondWithoutDialog();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean cancelBondProcess();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public int connect();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBond(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean createBondOutOfBand(int, @Nullable android.bluetooth.OobData, @Nullable android.bluetooth.OobData);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int disconnect();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean fetchUuidsWithSdp(int);
    method @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getActiveAudioDevicePolicy();
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public String getAnonymizedAddress();
    method @IntRange(from=0xffffff9c, to=100) @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getBatteryLevel();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionHandle(int);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public String getIdentityAddress();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getMessageAccessPermission();
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public byte[] getMetadata(int);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public String getPackageNameOfBondingApplication();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getPhonebookAccessPermission();
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothSinkAudioPolicy getRequestedAudioPolicyAsSink();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getSimAccessPermission();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isBondingInitiatedLocally();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isConnected();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isEncrypted();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInSilenceMode();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int isRequestAudioPolicyAsSinkSupported();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void prepareToEnterProcess(@NonNull android.content.AttributionSource);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean removeBond();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int requestAudioPolicyAsSink(@NonNull android.bluetooth.BluetoothSinkAudioPolicy);
    method @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setActiveAudioDevicePolicy(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setLowLatencyAudioAllowed(boolean);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setMessageAccessPermission(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setMetadata(int, @NonNull byte[]);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPhonebookAccessPermission(int);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean setPin(@NonNull String);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setSilenceMode(boolean);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setSimAccessPermission(int);
    field public static final int ACCESS_ALLOWED = 1; // 0x1
    field public static final int ACCESS_REJECTED = 2; // 0x2
    field public static final int ACCESS_UNKNOWN = 0; // 0x0
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_BATTERY_LEVEL_CHANGED = "android.bluetooth.device.action.BATTERY_LEVEL_CHANGED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_CANCEL = "android.bluetooth.device.action.CONNECTION_ACCESS_CANCEL";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_REPLY = "android.bluetooth.device.action.CONNECTION_ACCESS_REPLY";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_ACCESS_REQUEST = "android.bluetooth.device.action.CONNECTION_ACCESS_REQUEST";
    field @FlaggedApi("com.android.bluetooth.flags.key_missing_broadcast") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_KEY_MISSING = "android.bluetooth.device.action.KEY_MISSING";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_PAIRING_CANCEL = "android.bluetooth.device.action.PAIRING_CANCEL";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_SILENCE_MODE_CHANGED = "android.bluetooth.device.action.SILENCE_MODE_CHANGED";
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_SWITCH_BUFFER_SIZE = "android.bluetooth.device.action.SWITCH_BUFFER_SIZE";
    field @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") public static final int ACTIVE_AUDIO_DEVICE_POLICY_ALL_PROFILES_ACTIVE_UPON_CONNECTION = 1; // 0x1
    field @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") public static final int ACTIVE_AUDIO_DEVICE_POLICY_ALL_PROFILES_INACTIVE_UPON_CONNECTION = 2; // 0x2
    field @FlaggedApi("com.android.bluetooth.flags.metadata_api_inactive_audio_device_upon_connection") public static final int ACTIVE_AUDIO_DEVICE_POLICY_DEFAULT = 0; // 0x0
    field public static final int BATTERY_LEVEL_BLUETOOTH_OFF = -100; // 0xffffff9c
    field public static final int BATTERY_LEVEL_UNKNOWN = -1; // 0xffffffff
    field public static final int CONNECTION_ACCESS_NO = 2; // 0x2
    field public static final int CONNECTION_ACCESS_YES = 1; // 0x1
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_CARKIT = "Carkit";
    field public static final String DEVICE_TYPE_DEFAULT = "Default";
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_HEADSET = "Headset";
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_HEARING_AID = "HearingAid";
    field @FlaggedApi("com.android.bluetooth.flags.support_metadata_device_types_apis") public static final String DEVICE_TYPE_SPEAKER = "Speaker";
    field public static final String DEVICE_TYPE_STYLUS = "Stylus";
    field public static final String DEVICE_TYPE_UNTETHERED_HEADSET = "Untethered Headset";
    field public static final String DEVICE_TYPE_WATCH = "Watch";
    field public static final String EXTRA_ACCESS_REQUEST_TYPE = "android.bluetooth.device.extra.ACCESS_REQUEST_TYPE";
    field public static final String EXTRA_ALWAYS_ALLOWED = "android.bluetooth.device.extra.ALWAYS_ALLOWED";
    field public static final String EXTRA_BATTERY_LEVEL = "android.bluetooth.device.extra.BATTERY_LEVEL";
    field public static final String EXTRA_CONNECTION_ACCESS_RESULT = "android.bluetooth.device.extra.CONNECTION_ACCESS_RESULT";
    field public static final String EXTRA_LOW_LATENCY_BUFFER_SIZE = "android.bluetooth.device.extra.LOW_LATENCY_BUFFER_SIZE";
    field public static final String EXTRA_PAIRING_INITIATOR = "android.bluetooth.device.extra.PAIRING_INITIATOR";
    field public static final int EXTRA_PAIRING_INITIATOR_BACKGROUND = 2; // 0x2
    field public static final int EXTRA_PAIRING_INITIATOR_FOREGROUND = 1; // 0x1
    field public static final String EXTRA_UNBOND_REASON = "android.bluetooth.device.extra.REASON";
    field public static final int METADATA_COMPANION_APP = 4; // 0x4
    field public static final int METADATA_DEVICE_TYPE = 17; // 0x11
    field public static final int METADATA_ENHANCED_SETTINGS_UI_URI = 16; // 0x10
    field @FlaggedApi("com.android.bluetooth.flags.support_exclusive_manager") public static final int METADATA_EXCLUSIVE_MANAGER = 29; // 0x1d
    field public static final int METADATA_HARDWARE_VERSION = 3; // 0x3
    field public static final int METADATA_IS_UNTETHERED_HEADSET = 6; // 0x6
    field public static final int METADATA_LE_AUDIO = 26; // 0x1a
    field public static final int METADATA_MAIN_BATTERY = 18; // 0x12
    field public static final int METADATA_MAIN_CHARGING = 19; // 0x13
    field public static final int METADATA_MAIN_ICON = 5; // 0x5
    field public static final int METADATA_MAIN_LOW_BATTERY_THRESHOLD = 20; // 0x14
    field public static final int METADATA_MANUFACTURER_NAME = 0; // 0x0
    field public static final int METADATA_MAX_LENGTH = 2048; // 0x800
    field public static final int METADATA_MODEL_NAME = 1; // 0x1
    field public static final int METADATA_SOFTWARE_VERSION = 2; // 0x2
    field public static final int METADATA_UNTETHERED_CASE_BATTERY = 12; // 0xc
    field public static final int METADATA_UNTETHERED_CASE_CHARGING = 15; // 0xf
    field public static final int METADATA_UNTETHERED_CASE_ICON = 9; // 0x9
    field public static final int METADATA_UNTETHERED_CASE_LOW_BATTERY_THRESHOLD = 23; // 0x17
    field public static final int METADATA_UNTETHERED_LEFT_BATTERY = 10; // 0xa
    field public static final int METADATA_UNTETHERED_LEFT_CHARGING = 13; // 0xd
    field public static final int METADATA_UNTETHERED_LEFT_ICON = 7; // 0x7
    field public static final int METADATA_UNTETHERED_LEFT_LOW_BATTERY_THRESHOLD = 21; // 0x15
    field public static final int METADATA_UNTETHERED_RIGHT_BATTERY = 11; // 0xb
    field public static final int METADATA_UNTETHERED_RIGHT_CHARGING = 14; // 0xe
    field public static final int METADATA_UNTETHERED_RIGHT_ICON = 8; // 0x8
    field public static final int METADATA_UNTETHERED_RIGHT_LOW_BATTERY_THRESHOLD = 22; // 0x16
    field public static final int PAIRING_VARIANT_CONSENT = 3; // 0x3
    field public static final int PAIRING_VARIANT_DISPLAY_PASSKEY = 4; // 0x4
    field public static final int PAIRING_VARIANT_DISPLAY_PIN = 5; // 0x5
    field public static final int PAIRING_VARIANT_OOB_CONSENT = 6; // 0x6
    field public static final int PAIRING_VARIANT_PASSKEY = 1; // 0x1
    field public static final int PAIRING_VARIANT_PIN_16_DIGITS = 7; // 0x7
    field public static final int REQUEST_TYPE_MESSAGE_ACCESS = 3; // 0x3
    field public static final int REQUEST_TYPE_PHONEBOOK_ACCESS = 2; // 0x2
    field public static final int REQUEST_TYPE_PROFILE_CONNECTION = 1; // 0x1
    field public static final int REQUEST_TYPE_SIM_ACCESS = 4; // 0x4
    field public static final int UNBOND_REASON_AUTH_CANCELED = 3; // 0x3
    field public static final int UNBOND_REASON_AUTH_FAILED = 1; // 0x1
    field public static final int UNBOND_REASON_AUTH_REJECTED = 2; // 0x2
    field public static final int UNBOND_REASON_AUTH_TIMEOUT = 6; // 0x6
    field public static final int UNBOND_REASON_DISCOVERY_IN_PROGRESS = 5; // 0x5
    field public static final int UNBOND_REASON_REMOTE_AUTH_CANCELED = 8; // 0x8
    field public static final int UNBOND_REASON_REMOTE_DEVICE_DOWN = 4; // 0x4
    field public static final int UNBOND_REASON_REMOVED = 9; // 0x9
    field public static final int UNBOND_REASON_REPEATED_ATTEMPTS = 7; // 0x7
  }

  public interface BluetoothDevicePicker {
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_DEVICE_SELECTED = "android.bluetooth.devicepicker.action.DEVICE_SELECTED";
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_LAUNCH = "android.bluetooth.devicepicker.action.LAUNCH";
    field public static final String EXTRA_FILTER_TYPE = "android.bluetooth.devicepicker.extra.FILTER_TYPE";
    field public static final String EXTRA_LAUNCH_CLASS = "android.bluetooth.devicepicker.extra.DEVICE_PICKER_LAUNCH_CLASS";
    field public static final String EXTRA_LAUNCH_PACKAGE = "android.bluetooth.devicepicker.extra.LAUNCH_PACKAGE";
    field public static final String EXTRA_NEED_AUTH = "android.bluetooth.devicepicker.extra.NEED_AUTH";
    field public static final int FILTER_TYPE_ALL = 0; // 0x0
    field public static final int FILTER_TYPE_AUDIO = 1; // 0x1
    field public static final int FILTER_TYPE_NAP = 4; // 0x4
    field public static final int FILTER_TYPE_PANU = 3; // 0x3
    field public static final int FILTER_TYPE_TRANSFER = 2; // 0x2
  }

  public final class BluetoothHapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getActivePresetIndex(@NonNull android.bluetooth.BluetoothDevice);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothHapPresetInfo getActivePresetInfo(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothHapPresetInfo> getAllPresetInfo(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getHapGroup(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getHearingAidType(@NonNull android.bluetooth.BluetoothDevice);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothHapPresetInfo getPresetInfo(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothHapClient.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void selectPreset(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void selectPresetForGroup(int, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setPresetName(@NonNull android.bluetooth.BluetoothDevice, int, @NonNull String);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setPresetNameForGroup(int, int, @NonNull String);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean supportsDynamicPresets(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean supportsIndependentPresets(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean supportsSynchronizedPresets(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean supportsWritablePresets(@NonNull android.bluetooth.BluetoothDevice);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void switchToNextPreset(@NonNull android.bluetooth.BluetoothDevice);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void switchToNextPresetForGroup(int);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void switchToPreviousPreset(@NonNull android.bluetooth.BluetoothDevice);
    method @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void switchToPreviousPresetForGroup(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothHapClient.Callback);
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_HAP_CONNECTION_STATE_CHANGED = "android.bluetooth.action.HAP_CONNECTION_STATE_CHANGED";
    field @FlaggedApi("com.android.bluetooth.flags.settings_can_control_hap_preset") public static final int PRESET_INDEX_UNAVAILABLE = 0; // 0x0
    field public static final int TYPE_BANDED = 2; // 0x2
    field public static final int TYPE_BINAURAL = 0; // 0x0
    field public static final int TYPE_MONAURAL = 1; // 0x1
    field public static final int TYPE_RFU = 3; // 0x3
  }

  public static interface BluetoothHapClient.Callback {
    method public void onPresetInfoChanged(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.List<android.bluetooth.BluetoothHapPresetInfo>, int);
    method public void onPresetSelected(@NonNull android.bluetooth.BluetoothDevice, int, int);
    method public void onPresetSelectionFailed(@NonNull android.bluetooth.BluetoothDevice, int);
    method public void onPresetSelectionForGroupFailed(int, int);
    method public void onSetPresetNameFailed(@NonNull android.bluetooth.BluetoothDevice, int);
    method public void onSetPresetNameForGroupFailed(int, int);
  }

  public final class BluetoothHapPresetInfo implements android.os.Parcelable {
    method public int describeContents();
    method public int getIndex();
    method @NonNull public String getName();
    method public boolean isAvailable();
    method public boolean isWritable();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHapPresetInfo> CREATOR;
  }

  public final class BluetoothHeadset implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean connect(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int connectAudio();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean disconnect(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int disconnectAudio();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getAudioRouteAllowed();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getAudioState(@NonNull android.bluetooth.BluetoothDevice);
    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 isInbandRingingEnabled();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int setAudioRouteAllowed(boolean);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.MODIFY_PHONE_STATE}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean startScoUsingVirtualVoiceCall();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.MODIFY_PHONE_STATE, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean stopScoUsingVirtualVoiceCall();
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACTIVE_DEVICE_CHANGED = "android.bluetooth.headset.profile.action.ACTIVE_DEVICE_CHANGED";
  }

  public final class BluetoothHeadsetClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    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 int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothHeadsetClient.NetworkServiceState getNetworkServiceState(@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(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.headsetclient.profile.action.CONNECTION_STATE_CHANGED";
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_NETWORK_SERVICE_STATE_CHANGED = "android.bluetooth.headsetclient.profile.action.NETWORK_SERVICE_STATE_CHANGED";
    field public static final String EXTRA_NETWORK_SERVICE_STATE = "android.bluetooth.headsetclient.extra.EXTRA_NETWORK_SERVICE_STATE";
  }

  public static final class BluetoothHeadsetClient.NetworkServiceState implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.bluetooth.BluetoothDevice getDevice();
    method @Nullable public String getNetworkOperatorName();
    method @IntRange(from=0, to=5) public int getSignalStrength();
    method public boolean isRoaming();
    method public boolean isServiceAvailable();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHeadsetClient.NetworkServiceState> CREATOR;
  }

  public final class BluetoothHearingAid implements android.bluetooth.BluetoothProfile {
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothHearingAid.AdvertisementServiceData getAdvertisementServiceData(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getDeviceMode(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getDeviceSide(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public long getHiSyncId(@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);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolume(int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_ACTIVE_DEVICE_CHANGED = "android.bluetooth.hearingaid.profile.action.ACTIVE_DEVICE_CHANGED";
    field public static final long HI_SYNC_ID_INVALID = 0L; // 0x0L
    field public static final int MODE_BINAURAL = 1; // 0x1
    field public static final int MODE_MONAURAL = 0; // 0x0
    field public static final int MODE_UNKNOWN = -1; // 0xffffffff
    field public static final int SIDE_LEFT = 0; // 0x0
    field public static final int SIDE_RIGHT = 1; // 0x1
    field public static final int SIDE_UNKNOWN = -1; // 0xffffffff
  }

  public static final class BluetoothHearingAid.AdvertisementServiceData implements android.os.Parcelable {
    method public int describeContents();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getDeviceMode();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getDeviceSide();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getTruncatedHiSyncId();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isCsipSupported();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInPairWith(@Nullable android.bluetooth.BluetoothHearingAid.AdvertisementServiceData);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothHearingAid.AdvertisementServiceData> CREATOR;
  }

  public final class BluetoothHidDevice implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothHidHost implements android.bluetooth.BluetoothProfile {
    method @NonNull @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @FlaggedApi("com.android.bluetooth.flags.allow_switching_hid_and_hogp") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getPreferredTransport(@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);
    method @FlaggedApi("com.android.bluetooth.flags.allow_switching_hid_and_hogp") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setPreferredTransport(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.input.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothLeAudio implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getAudioLocation(@NonNull android.bluetooth.BluetoothDevice);
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.bluetooth.BluetoothLeAudioCodecStatus getCodecStatus(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@Nullable android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isInbandRingtoneEnabled(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothLeAudio.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setCodecConfigPreference(int, @NonNull android.bluetooth.BluetoothLeAudioCodecConfig, @NonNull android.bluetooth.BluetoothLeAudioCodecConfig);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolume(@IntRange(from=0, to=255) int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothLeAudio.Callback);
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_LE_AUDIO_ACTIVE_DEVICE_CHANGED = "android.bluetooth.action.LE_AUDIO_ACTIVE_DEVICE_CHANGED";
    field public static final int AUDIO_LOCATION_BACK_CENTER = 256; // 0x100
    field public static final int AUDIO_LOCATION_BACK_LEFT = 16; // 0x10
    field public static final int AUDIO_LOCATION_BACK_RIGHT = 32; // 0x20
    field public static final int AUDIO_LOCATION_BOTTOM_FRONT_CENTER = 2097152; // 0x200000
    field public static final int AUDIO_LOCATION_BOTTOM_FRONT_LEFT = 4194304; // 0x400000
    field public static final int AUDIO_LOCATION_BOTTOM_FRONT_RIGHT = 8388608; // 0x800000
    field public static final int AUDIO_LOCATION_FRONT_CENTER = 4; // 0x4
    field public static final int AUDIO_LOCATION_FRONT_LEFT = 1; // 0x1
    field public static final int AUDIO_LOCATION_FRONT_LEFT_OF_CENTER = 64; // 0x40
    field public static final int AUDIO_LOCATION_FRONT_LEFT_WIDE = 16777216; // 0x1000000
    field public static final int AUDIO_LOCATION_FRONT_RIGHT = 2; // 0x2
    field public static final int AUDIO_LOCATION_FRONT_RIGHT_OF_CENTER = 128; // 0x80
    field public static final int AUDIO_LOCATION_FRONT_RIGHT_WIDE = 33554432; // 0x2000000
    field public static final int AUDIO_LOCATION_INVALID = 0; // 0x0
    field public static final int AUDIO_LOCATION_LEFT_SURROUND = 67108864; // 0x4000000
    field public static final int AUDIO_LOCATION_LOW_FREQ_EFFECTS_ONE = 8; // 0x8
    field public static final int AUDIO_LOCATION_LOW_FREQ_EFFECTS_TWO = 512; // 0x200
    field public static final int AUDIO_LOCATION_RIGHT_SURROUND = 134217728; // 0x8000000
    field public static final int AUDIO_LOCATION_SIDE_LEFT = 1024; // 0x400
    field public static final int AUDIO_LOCATION_SIDE_RIGHT = 2048; // 0x800
    field public static final int AUDIO_LOCATION_TOP_BACK_CENTER = 1048576; // 0x100000
    field public static final int AUDIO_LOCATION_TOP_BACK_LEFT = 65536; // 0x10000
    field public static final int AUDIO_LOCATION_TOP_BACK_RIGHT = 131072; // 0x20000
    field public static final int AUDIO_LOCATION_TOP_CENTER = 32768; // 0x8000
    field public static final int AUDIO_LOCATION_TOP_FRONT_CENTER = 16384; // 0x4000
    field public static final int AUDIO_LOCATION_TOP_FRONT_LEFT = 4096; // 0x1000
    field public static final int AUDIO_LOCATION_TOP_FRONT_RIGHT = 8192; // 0x2000
    field public static final int AUDIO_LOCATION_TOP_SIDE_LEFT = 262144; // 0x40000
    field public static final int AUDIO_LOCATION_TOP_SIDE_RIGHT = 524288; // 0x80000
    field public static final String EXTRA_LE_AUDIO_GROUP_ID = "android.bluetooth.extra.LE_AUDIO_GROUP_ID";
  }

  public static interface BluetoothLeAudio.Callback {
    method public void onCodecConfigChanged(int, @NonNull android.bluetooth.BluetoothLeAudioCodecStatus);
    method public void onGroupNodeAdded(@NonNull android.bluetooth.BluetoothDevice, int);
    method public void onGroupNodeRemoved(@NonNull android.bluetooth.BluetoothDevice, int);
    method public void onGroupStatusChanged(int, int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_callback_on_group_stream_status") public default void onGroupStreamStatusChanged(int, int);
  }

  public final class BluetoothLeAudioCodecConfigMetadata implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public static android.bluetooth.BluetoothLeAudioCodecConfigMetadata fromRawBytes(@NonNull byte[]);
    method public long getAudioLocation();
    method public int getFrameDuration();
    method public int getOctetsPerFrame();
    method @NonNull public byte[] getRawMetadata();
    method public int getSampleRate();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeAudioCodecConfigMetadata> CREATOR;
  }

  public static final class BluetoothLeAudioCodecConfigMetadata.Builder {
    ctor public BluetoothLeAudioCodecConfigMetadata.Builder();
    ctor public BluetoothLeAudioCodecConfigMetadata.Builder(@NonNull android.bluetooth.BluetoothLeAudioCodecConfigMetadata);
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata build();
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata.Builder setAudioLocation(long);
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata.Builder setFrameDuration(int);
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata.Builder setOctetsPerFrame(int);
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata.Builder setSampleRate(int);
  }

  public final class BluetoothLeAudioContentMetadata implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public static android.bluetooth.BluetoothLeAudioContentMetadata fromRawBytes(@NonNull byte[]);
    method @Nullable public String getLanguage();
    method @Nullable public String getProgramInfo();
    method @NonNull public byte[] getRawMetadata();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeAudioContentMetadata> CREATOR;
  }

  public static final class BluetoothLeAudioContentMetadata.Builder {
    ctor public BluetoothLeAudioContentMetadata.Builder();
    ctor public BluetoothLeAudioContentMetadata.Builder(@NonNull android.bluetooth.BluetoothLeAudioContentMetadata);
    method @NonNull public android.bluetooth.BluetoothLeAudioContentMetadata build();
    method @NonNull public android.bluetooth.BluetoothLeAudioContentMetadata.Builder setLanguage(@Nullable String);
    method @NonNull public android.bluetooth.BluetoothLeAudioContentMetadata.Builder setProgramInfo(@Nullable String);
  }

  public final class BluetoothLeBroadcast implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothLeBroadcastMetadata> getAllBroadcastMetadata();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumNumberOfBroadcasts();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumStreamsPerBroadcast();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public int getMaximumSubgroupsPerBroadcast();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isPlaying(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothLeBroadcast.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startBroadcast(@NonNull android.bluetooth.BluetoothLeAudioContentMetadata, @Nullable byte[]);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startBroadcast(@NonNull android.bluetooth.BluetoothLeBroadcastSettings);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopBroadcast(int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothLeBroadcast.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void updateBroadcast(int, @NonNull android.bluetooth.BluetoothLeAudioContentMetadata);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void updateBroadcast(int, @NonNull android.bluetooth.BluetoothLeBroadcastSettings);
  }

  public static interface BluetoothLeBroadcast.Callback {
    method public void onBroadcastMetadataChanged(int, @NonNull android.bluetooth.BluetoothLeBroadcastMetadata);
    method public void onBroadcastStartFailed(int);
    method public void onBroadcastStarted(int, int);
    method public void onBroadcastStopFailed(int);
    method public void onBroadcastStopped(int, int);
    method public void onBroadcastUpdateFailed(int, int);
    method public void onBroadcastUpdated(int, int);
    method public void onPlaybackStarted(int, int);
    method public void onPlaybackStopped(int, int);
  }

  public final class BluetoothLeBroadcastAssistant implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void addSource(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothLeBroadcastMetadata, boolean);
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothLeBroadcastReceiveState> getAllSources(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    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 int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method public int getMaximumSourceCapacity(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isSearchInProgress();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void modifySource(@NonNull android.bluetooth.BluetoothDevice, int, @NonNull android.bluetooth.BluetoothLeBroadcastMetadata);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothLeBroadcastAssistant.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void removeSource(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void startSearchingForSources(@NonNull java.util.List<android.bluetooth.le.ScanFilter>);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void stopSearchingForSources();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothLeBroadcastAssistant.Callback);
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.action.CONNECTION_STATE_CHANGED";
  }

  public static interface BluetoothLeBroadcastAssistant.Callback {
    method public void onReceiveStateChanged(@NonNull android.bluetooth.BluetoothDevice, int, @NonNull android.bluetooth.BluetoothLeBroadcastReceiveState);
    method public void onSearchStartFailed(int);
    method public void onSearchStarted(int);
    method public void onSearchStopFailed(int);
    method public void onSearchStopped(int);
    method public void onSourceAddFailed(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.BluetoothLeBroadcastMetadata, int);
    method public void onSourceAdded(@NonNull android.bluetooth.BluetoothDevice, int, int);
    method public void onSourceFound(@NonNull android.bluetooth.BluetoothLeBroadcastMetadata);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_monitor_source_sync_status") public default void onSourceLost(int);
    method public void onSourceModified(@NonNull android.bluetooth.BluetoothDevice, int, int);
    method public void onSourceModifyFailed(@NonNull android.bluetooth.BluetoothDevice, int, int);
    method public void onSourceRemoveFailed(@NonNull android.bluetooth.BluetoothDevice, int, int);
    method public void onSourceRemoved(@NonNull android.bluetooth.BluetoothDevice, int, int);
  }

  public final class BluetoothLeBroadcastChannel implements android.os.Parcelable {
    method public int describeContents();
    method public int getChannelIndex();
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata getCodecMetadata();
    method public boolean isSelected();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastChannel> CREATOR;
  }

  public static final class BluetoothLeBroadcastChannel.Builder {
    ctor public BluetoothLeBroadcastChannel.Builder();
    ctor public BluetoothLeBroadcastChannel.Builder(@NonNull android.bluetooth.BluetoothLeBroadcastChannel);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastChannel build();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastChannel.Builder setChannelIndex(int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastChannel.Builder setCodecMetadata(@NonNull android.bluetooth.BluetoothLeAudioCodecConfigMetadata);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastChannel.Builder setSelected(boolean);
  }

  public final class BluetoothLeBroadcastMetadata implements android.os.Parcelable {
    method public int describeContents();
    method public int getAudioConfigQuality();
    method @Nullable public byte[] getBroadcastCode();
    method public int getBroadcastId();
    method @Nullable public String getBroadcastName();
    method public int getPaSyncInterval();
    method @IntRange(from=0, to=16777215) public int getPresentationDelayMicros();
    method @Nullable public android.bluetooth.BluetoothLeAudioContentMetadata getPublicBroadcastMetadata();
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_monitor_source_sync_status") @IntRange(from=0xffffff81, to=127) public int getRssi();
    method public int getSourceAddressType();
    method public int getSourceAdvertisingSid();
    method @NonNull public android.bluetooth.BluetoothDevice getSourceDevice();
    method @NonNull public java.util.List<android.bluetooth.BluetoothLeBroadcastSubgroup> getSubgroups();
    method public boolean isEncrypted();
    method public boolean isPublicBroadcast();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int AUDIO_CONFIG_QUALITY_HIGH = 2; // 0x2
    field public static final int AUDIO_CONFIG_QUALITY_NONE = 0; // 0x0
    field public static final int AUDIO_CONFIG_QUALITY_STANDARD = 1; // 0x1
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastMetadata> CREATOR;
    field public static final int PA_SYNC_INTERVAL_UNKNOWN = 65535; // 0xffff
    field @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_monitor_source_sync_status") public static final int RSSI_UNKNOWN = 127; // 0x7f
  }

  public static final class BluetoothLeBroadcastMetadata.Builder {
    ctor public BluetoothLeBroadcastMetadata.Builder();
    ctor public BluetoothLeBroadcastMetadata.Builder(@NonNull android.bluetooth.BluetoothLeBroadcastMetadata);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder addSubgroup(@NonNull android.bluetooth.BluetoothLeBroadcastSubgroup);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata build();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder clearSubgroup();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setAudioConfigQuality(int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setBroadcastCode(@Nullable byte[]);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setBroadcastId(int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setBroadcastName(@Nullable String);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setEncrypted(boolean);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setPaSyncInterval(int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setPresentationDelayMicros(@IntRange(from=0, to=16777215) int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setPublicBroadcast(boolean);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setPublicBroadcastMetadata(@Nullable android.bluetooth.BluetoothLeAudioContentMetadata);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_monitor_source_sync_status") @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setRssi(@IntRange(from=0xffffff81, to=127) int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setSourceAdvertisingSid(int);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastMetadata.Builder setSourceDevice(@NonNull android.bluetooth.BluetoothDevice, int);
  }

  public final class BluetoothLeBroadcastReceiveState implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public byte[] getBadCode();
    method public int getBigEncryptionState();
    method @NonNull public java.util.List<java.lang.Long> getBisSyncState();
    method public int getBroadcastId();
    method public int getNumSubgroups();
    method public int getPaSyncState();
    method public int getSourceAddressType();
    method public int getSourceAdvertisingSid();
    method @NonNull public android.bluetooth.BluetoothDevice getSourceDevice();
    method @IntRange(from=0, to=255) public int getSourceId();
    method @NonNull public java.util.List<android.bluetooth.BluetoothLeAudioContentMetadata> getSubgroupMetadata();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final int BIG_ENCRYPTION_STATE_BAD_CODE = 3; // 0x3
    field public static final int BIG_ENCRYPTION_STATE_CODE_REQUIRED = 1; // 0x1
    field public static final int BIG_ENCRYPTION_STATE_DECRYPTING = 2; // 0x2
    field public static final int BIG_ENCRYPTION_STATE_NOT_ENCRYPTED = 0; // 0x0
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastReceiveState> CREATOR;
    field public static final int PA_SYNC_STATE_FAILED_TO_SYNCHRONIZE = 3; // 0x3
    field public static final int PA_SYNC_STATE_IDLE = 0; // 0x0
    field public static final int PA_SYNC_STATE_NO_PAST = 4; // 0x4
    field public static final int PA_SYNC_STATE_SYNCHRONIZED = 2; // 0x2
    field public static final int PA_SYNC_STATE_SYNCINFO_REQUEST = 1; // 0x1
  }

  public final class BluetoothLeBroadcastSettings implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public byte[] getBroadcastCode();
    method @Nullable public String getBroadcastName();
    method @Nullable public android.bluetooth.BluetoothLeAudioContentMetadata getPublicBroadcastMetadata();
    method @NonNull public java.util.List<android.bluetooth.BluetoothLeBroadcastSubgroupSettings> getSubgroupSettings();
    method public boolean isPublicBroadcast();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastSettings> CREATOR;
  }

  public static final class BluetoothLeBroadcastSettings.Builder {
    ctor public BluetoothLeBroadcastSettings.Builder();
    ctor public BluetoothLeBroadcastSettings.Builder(@NonNull android.bluetooth.BluetoothLeBroadcastSettings);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder addSubgroupSettings(@NonNull android.bluetooth.BluetoothLeBroadcastSubgroupSettings);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings build();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder clearSubgroupSettings();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder setBroadcastCode(@Nullable byte[]);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder setBroadcastName(@Nullable String);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder setPublicBroadcast(boolean);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSettings.Builder setPublicBroadcastMetadata(@Nullable android.bluetooth.BluetoothLeAudioContentMetadata);
  }

  public final class BluetoothLeBroadcastSubgroup implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public java.util.List<android.bluetooth.BluetoothLeBroadcastChannel> getChannels();
    method public long getCodecId();
    method @NonNull public android.bluetooth.BluetoothLeAudioCodecConfigMetadata getCodecSpecificConfig();
    method @NonNull public android.bluetooth.BluetoothLeAudioContentMetadata getContentMetadata();
    method public boolean hasChannelPreference();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastSubgroup> CREATOR;
  }

  public static final class BluetoothLeBroadcastSubgroup.Builder {
    ctor public BluetoothLeBroadcastSubgroup.Builder();
    ctor public BluetoothLeBroadcastSubgroup.Builder(@NonNull android.bluetooth.BluetoothLeBroadcastSubgroup);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup.Builder addChannel(@NonNull android.bluetooth.BluetoothLeBroadcastChannel);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup build();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup.Builder clearChannel();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup.Builder setCodecId(long);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup.Builder setCodecSpecificConfig(@NonNull android.bluetooth.BluetoothLeAudioCodecConfigMetadata);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroup.Builder setContentMetadata(@NonNull android.bluetooth.BluetoothLeAudioContentMetadata);
  }

  public final class BluetoothLeBroadcastSubgroupSettings implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public android.bluetooth.BluetoothLeAudioContentMetadata getContentMetadata();
    method public int getPreferredQuality();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothLeBroadcastSubgroupSettings> CREATOR;
    field public static final int QUALITY_HIGH = 1; // 0x1
    field public static final int QUALITY_STANDARD = 0; // 0x0
  }

  public static final class BluetoothLeBroadcastSubgroupSettings.Builder {
    ctor public BluetoothLeBroadcastSubgroupSettings.Builder();
    ctor public BluetoothLeBroadcastSubgroupSettings.Builder(@NonNull android.bluetooth.BluetoothLeBroadcastSubgroupSettings);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroupSettings build();
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroupSettings.Builder setContentMetadata(@NonNull android.bluetooth.BluetoothLeAudioContentMetadata);
    method @NonNull public android.bluetooth.BluetoothLeBroadcastSubgroupSettings.Builder setPreferredQuality(int);
  }

  public final class BluetoothMap implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    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.map.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothMapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    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 int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.SEND_SMS}) public boolean sendMessage(@NonNull android.bluetooth.BluetoothDevice, @NonNull java.util.Collection<android.net.Uri>, @NonNull String, @Nullable android.app.PendingIntent, @Nullable android.app.PendingIntent);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.mapmce.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothPan implements android.bluetooth.BluetoothProfile {
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public boolean isTetheringOn();
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.TETHER_PRIVILEGED}) public void setBluetoothTethering(boolean);
    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.pan.profile.action.CONNECTION_STATE_CHANGED";
    field public static final String ACTION_TETHERING_STATE_CHANGED = "android.bluetooth.action.TETHERING_STATE_CHANGED";
    field public static final String EXTRA_LOCAL_ROLE = "android.bluetooth.pan.extra.LOCAL_ROLE";
    field public static final String EXTRA_TETHERING_STATE = "android.bluetooth.extra.TETHERING_STATE";
    field public static final int LOCAL_NAP_ROLE = 1; // 0x1
    field public static final int LOCAL_PANU_ROLE = 2; // 0x2
    field public static final int PAN_ROLE_NONE = 0; // 0x0
    field public static final int REMOTE_NAP_ROLE = 1; // 0x1
    field public static final int REMOTE_PANU_ROLE = 2; // 0x2
    field public static final int TETHERING_STATE_OFF = 1; // 0x1
    field public static final int TETHERING_STATE_ON = 2; // 0x2
  }

  public class BluetoothPbap implements android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    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.pbap.profile.action.CONNECTION_STATE_CHANGED";
  }

  public final class BluetoothPbapClient implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    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 int getConnectionState(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(@NonNull int[]);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    field @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.pbapclient.profile.action.CONNECTION_STATE_CHANGED";
  }

  public interface BluetoothProfile {
    method @NonNull public static String getConnectionStateName(int);
    method @NonNull public static String getProfileName(int);
    field public static final int A2DP_SINK = 11; // 0xb
    field public static final int AVRCP_CONTROLLER = 12; // 0xc
    field public static final int CONNECTION_POLICY_ALLOWED = 100; // 0x64
    field public static final int CONNECTION_POLICY_FORBIDDEN = 0; // 0x0
    field public static final int CONNECTION_POLICY_UNKNOWN = -1; // 0xffffffff
    field public static final int HEADSET_CLIENT = 16; // 0x10
    field public static final int HID_HOST = 4; // 0x4
    field public static final int LE_AUDIO_BROADCAST = 26; // 0x1a
    field public static final int LE_AUDIO_BROADCAST_ASSISTANT = 29; // 0x1d
    field public static final int MAP = 9; // 0x9
    field public static final int MAP_CLIENT = 18; // 0x12
    field public static final int OPP = 20; // 0x14
    field public static final int PAN = 5; // 0x5
    field public static final int PBAP = 6; // 0x6
    field public static final int PBAP_CLIENT = 17; // 0x11
    field @Deprecated public static final int PRIORITY_OFF = 0; // 0x0
    field @Deprecated public static final int PRIORITY_ON = 100; // 0x64
    field public static final int VOLUME_CONTROL = 23; // 0x17
  }

  public final class BluetoothQualityReport implements android.os.Parcelable {
    method public int describeContents();
    method @Nullable public android.bluetooth.BluetoothClass getBluetoothClass();
    method @Nullable public android.bluetooth.BluetoothQualityReport.BqrCommon getBqrCommon();
    method @Nullable public android.os.Parcelable getBqrEvent();
    method public int getLmpSubVersion();
    method public int getLmpVersion();
    method public int getManufacturerId();
    method public int getQualityReportId();
    method @Nullable public String getRemoteAddress();
    method @Nullable public String getRemoteName();
    method @NonNull public static String qualityReportIdToString(int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport> CREATOR;
    field public static final int QUALITY_REPORT_ID_A2DP_CHOPPY = 3; // 0x3
    field public static final int QUALITY_REPORT_ID_APPROACH_LSTO = 2; // 0x2
    field public static final int QUALITY_REPORT_ID_CONN_FAIL = 8; // 0x8
    field public static final int QUALITY_REPORT_ID_MONITOR = 1; // 0x1
    field public static final int QUALITY_REPORT_ID_SCO_CHOPPY = 4; // 0x4
  }

  public static final class BluetoothQualityReport.BqrCommon implements android.os.Parcelable {
    method @NonNull public static String connectionRoleToString(int);
    method public int describeContents();
    method public int getAfhSelectUnidealChannelCount();
    method public int getCalFailedItemCount();
    method public int getConnectionHandle();
    method public int getConnectionRole();
    method public long getFlowOffCount();
    method public long getLastFlowOnTimestamp();
    method public long getLastTxAckTimestamp();
    method public int getLsto();
    method public long getNakCount();
    method public long getNoRxCount();
    method public long getOverflowCount();
    method public int getPacketType();
    method public long getPiconetClock();
    method public long getRetransmissionCount();
    method public int getRssi();
    method public int getSnr();
    method public int getTxPowerLevel();
    method public long getUnderflowCount();
    method public int getUnusedAfhChannelCount();
    method @Nullable public static String packetTypeToString(int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CONNECTION_ROLE_CENTRAL = 0; // 0x0
    field public static final int CONNECTION_ROLE_PERIPHERAL = 1; // 0x1
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport.BqrCommon> CREATOR;
  }

  public static final class BluetoothQualityReport.BqrConnectFail implements android.os.Parcelable {
    method @NonNull public static String connectFailIdToString(int);
    method public int describeContents();
    method public int getFailReason();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CONNECT_FAIL_ID_ACL_ALREADY_EXIST = 11; // 0xb
    field public static final int CONNECT_FAIL_ID_CONNECTION_TIMEOUT = 8; // 0x8
    field public static final int CONNECT_FAIL_ID_CONTROLLER_BUSY = 58; // 0x3a
    field public static final int CONNECT_FAIL_ID_NO_ERROR = 0; // 0x0
    field public static final int CONNECT_FAIL_ID_PAGE_TIMEOUT = 4; // 0x4
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport.BqrConnectFail> CREATOR;
  }

  public static final class BluetoothQualityReport.BqrVsA2dpChoppy implements android.os.Parcelable {
    method public int describeContents();
    method public int getAclTxQueueLength();
    method public long getArrivalTime();
    method public int getGlitchCount();
    method public int getLinkQuality();
    method public int getRxCxmDenials();
    method public long getScheduleTime();
    method public int getTxCxmDenials();
    method @Nullable public static String linkQualityToString(int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport.BqrVsA2dpChoppy> CREATOR;
  }

  public static final class BluetoothQualityReport.BqrVsLsto implements android.os.Parcelable {
    method @Nullable public static String connStateToString(int);
    method public int describeContents();
    method public long getBasebandStats();
    method public int getConnState();
    method public int getCxmDenials();
    method public long getLastTxAckTimestamp();
    method public long getNativeClock();
    method public int getRfLoss();
    method public long getSlotsUsed();
    method public int getTxSkipped();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport.BqrVsLsto> CREATOR;
  }

  public static final class BluetoothQualityReport.BqrVsScoChoppy implements android.os.Parcelable {
    method @Nullable public static String airFormatToString(int);
    method public int describeContents();
    method public int getAirFormat();
    method public int getGlitchCount();
    method public int getGoodRxFrameCount();
    method public int getInstanceCount();
    method public int getIntervalEsco();
    method public int getLateDispatch();
    method public int getLpaIntrMiss();
    method public int getMicIntrMiss();
    method public int getMissedInstanceCount();
    method public int getPlcDiscardCount();
    method public int getPlcFillCount();
    method public int getRxCxmDenials();
    method public int getRxRetransmitSlotCount();
    method public int getSprIntrMiss();
    method public int getTxAbortCount();
    method public int getTxCxmDenials();
    method public int getTxRetransmitSlotCount();
    method public int getWindowEsco();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothQualityReport.BqrVsScoChoppy> CREATOR;
  }

  public static final class BluetoothQualityReport.Builder {
    ctor public BluetoothQualityReport.Builder(@NonNull byte[]);
    method @NonNull public android.bluetooth.BluetoothQualityReport build();
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setBluetoothClass(@Nullable android.bluetooth.BluetoothClass);
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setLmpSubVersion(int);
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setLmpVersion(int);
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setManufacturerId(int);
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setRemoteAddress(@Nullable String);
    method @NonNull public android.bluetooth.BluetoothQualityReport.Builder setRemoteName(@Nullable String);
  }

  public final class BluetoothSap implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method public void close();
    method protected void finalize();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    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";
  }

  public final class BluetoothSinkAudioPolicy implements android.os.Parcelable {
    method public int describeContents();
    method public int getActiveDevicePolicyAfterConnection();
    method public int getCallEstablishPolicy();
    method public int getInBandRingtonePolicy();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BluetoothSinkAudioPolicy> CREATOR;
    field public static final int POLICY_ALLOWED = 1; // 0x1
    field public static final int POLICY_NOT_ALLOWED = 2; // 0x2
    field public static final int POLICY_UNCONFIGURED = 0; // 0x0
  }

  public static final class BluetoothSinkAudioPolicy.Builder {
    ctor public BluetoothSinkAudioPolicy.Builder();
    ctor public BluetoothSinkAudioPolicy.Builder(@NonNull android.bluetooth.BluetoothSinkAudioPolicy);
    method @NonNull public android.bluetooth.BluetoothSinkAudioPolicy build();
    method @NonNull public android.bluetooth.BluetoothSinkAudioPolicy.Builder setActiveDevicePolicyAfterConnection(int);
    method @NonNull public android.bluetooth.BluetoothSinkAudioPolicy.Builder setCallEstablishPolicy(int);
    method @NonNull public android.bluetooth.BluetoothSinkAudioPolicy.Builder setInBandRingtonePolicy(int);
  }

  public final class BluetoothStatusCodes {
    field public static final int ALLOWED = 400; // 0x190
    field public static final int ERROR_ALREADY_IN_TARGET_STATE = 26; // 0x1a
    field public static final int ERROR_ANOTHER_ACTIVE_OOB_REQUEST = 1000; // 0x3e8
    field public static final int ERROR_ANOTHER_ACTIVE_REQUEST = 29; // 0x1d
    field public static final int ERROR_AUDIO_DEVICE_ALREADY_CONNECTED = 1116; // 0x45c
    field public static final int ERROR_AUDIO_DEVICE_ALREADY_DISCONNECTED = 1117; // 0x45d
    field public static final int ERROR_AUDIO_ROUTE_BLOCKED = 1118; // 0x45e
    field public static final int ERROR_BAD_PARAMETERS = 21; // 0x15
    field public static final int ERROR_CALLBACK_NOT_REGISTERED = 28; // 0x1c
    field public static final int ERROR_CALL_ACTIVE = 1119; // 0x45f
    field public static final int ERROR_CSIP_GROUP_LOCKED_BY_OTHER = 1208; // 0x4b8
    field public static final int ERROR_CSIP_INVALID_GROUP_ID = 1207; // 0x4b7
    field public static final int ERROR_CSIP_LOCKED_GROUP_MEMBER_LOST = 1209; // 0x4b9
    field public static final int ERROR_DISTANCE_MEASUREMENT_INTERNAL = 1301; // 0x515
    field public static final int ERROR_HAP_INVALID_PRESET_INDEX = 1211; // 0x4bb
    field public static final int ERROR_HAP_PRESET_NAME_TOO_LONG = 1210; // 0x4ba
    field public static final int ERROR_HARDWARE_GENERIC = 20; // 0x14
    field public static final int ERROR_LE_BROADCAST_ASSISTANT_DUPLICATE_ADDITION = 1203; // 0x4b3
    field public static final int ERROR_LE_BROADCAST_ASSISTANT_INVALID_SOURCE_ID = 1202; // 0x4b2
    field public static final int ERROR_LE_BROADCAST_INVALID_BROADCAST_ID = 1200; // 0x4b0
    field public static final int ERROR_LE_BROADCAST_INVALID_CODE = 1201; // 0x4b1
    field public static final int ERROR_LE_CONTENT_METADATA_INVALID_LANGUAGE = 1205; // 0x4b5
    field public static final int ERROR_LE_CONTENT_METADATA_INVALID_OTHER = 1206; // 0x4b6
    field public static final int ERROR_LE_CONTENT_METADATA_INVALID_PROGRAM_INFO = 1204; // 0x4b4
    field public static final int ERROR_LOCAL_NOT_ENOUGH_RESOURCES = 22; // 0x16
    field public static final int ERROR_NOT_ACTIVE_DEVICE = 12; // 0xc
    field public static final int ERROR_NOT_DUAL_MODE_AUDIO_DEVICE = 3000; // 0xbb8
    field public static final int ERROR_NO_ACTIVE_DEVICES = 13; // 0xd
    field public static final int ERROR_NO_LE_CONNECTION = 1300; // 0x514
    field public static final int ERROR_PROFILE_NOT_CONNECTED = 14; // 0xe
    field public static final int ERROR_REMOTE_LINK_ERROR = 25; // 0x19
    field public static final int ERROR_REMOTE_NOT_ENOUGH_RESOURCES = 23; // 0x17
    field public static final int ERROR_REMOTE_OPERATION_NOT_SUPPORTED = 27; // 0x1b
    field public static final int ERROR_REMOTE_OPERATION_REJECTED = 24; // 0x18
    field public static final int ERROR_TIMEOUT = 15; // 0xf
    field public static final int NOT_ALLOWED = 401; // 0x191
    field public static final int REASON_LOCAL_APP_REQUEST = 16; // 0x10
    field public static final int REASON_LOCAL_STACK_REQUEST = 17; // 0x11
    field public static final int REASON_REMOTE_REQUEST = 18; // 0x12
    field public static final int REASON_SYSTEM_POLICY = 19; // 0x13
    field public static final int RFCOMM_LISTENER_FAILED_TO_CLOSE_SERVER_SOCKET = 2004; // 0x7d4
    field public static final int RFCOMM_LISTENER_FAILED_TO_CREATE_SERVER_SOCKET = 2003; // 0x7d3
    field public static final int RFCOMM_LISTENER_NO_SOCKET_AVAILABLE = 2005; // 0x7d5
    field public static final int RFCOMM_LISTENER_OPERATION_FAILED_DIFFERENT_APP = 2002; // 0x7d2
    field public static final int RFCOMM_LISTENER_OPERATION_FAILED_NO_MATCHING_SERVICE_RECORD = 2001; // 0x7d1
    field public static final int RFCOMM_LISTENER_START_FAILED_UUID_IN_USE = 2000; // 0x7d0
  }

  public final class BluetoothUuid {
    method public static boolean containsAnyUuid(@Nullable android.os.ParcelUuid[], @Nullable android.os.ParcelUuid[]);
    method @NonNull public static android.os.ParcelUuid parseUuidFrom(@Nullable byte[]);
    field @NonNull public static final android.os.ParcelUuid A2DP_SINK;
    field @NonNull public static final android.os.ParcelUuid A2DP_SOURCE;
    field @NonNull public static final android.os.ParcelUuid ADV_AUDIO_DIST;
    field @NonNull public static final android.os.ParcelUuid AVRCP;
    field @NonNull public static final android.os.ParcelUuid AVRCP_CONTROLLER;
    field @NonNull public static final android.os.ParcelUuid AVRCP_TARGET;
    field @NonNull public static final android.os.ParcelUuid BASE_UUID;
    field @NonNull public static final android.os.ParcelUuid BASS;
    field @NonNull public static final android.os.ParcelUuid BNEP;
    field @NonNull public static final android.os.ParcelUuid CAP;
    field @NonNull public static final android.os.ParcelUuid COORDINATED_SET;
    field @NonNull public static final android.os.ParcelUuid DIP;
    field @NonNull public static final android.os.ParcelUuid GENERIC_MEDIA_CONTROL;
    field @NonNull public static final android.os.ParcelUuid HAS;
    field @NonNull public static final android.os.ParcelUuid HEARING_AID;
    field @NonNull public static final android.os.ParcelUuid HFP;
    field @NonNull public static final android.os.ParcelUuid HFP_AG;
    field @NonNull public static final android.os.ParcelUuid HID;
    field @NonNull public static final android.os.ParcelUuid HOGP;
    field @NonNull public static final android.os.ParcelUuid HSP;
    field @NonNull public static final android.os.ParcelUuid HSP_AG;
    field @NonNull public static final android.os.ParcelUuid LE_AUDIO;
    field @NonNull public static final android.os.ParcelUuid MAP;
    field @NonNull public static final android.os.ParcelUuid MAS;
    field @NonNull public static final android.os.ParcelUuid MEDIA_CONTROL;
    field @FlaggedApi("com.android.bluetooth.flags.mfi_has_uuid") @NonNull public static final android.os.ParcelUuid MFI_HAS;
    field @NonNull public static final android.os.ParcelUuid MNS;
    field @NonNull public static final android.os.ParcelUuid NAP;
    field @NonNull public static final android.os.ParcelUuid OBEX_OBJECT_PUSH;
    field @NonNull public static final android.os.ParcelUuid PANU;
    field @NonNull public static final android.os.ParcelUuid PBAP_PCE;
    field @NonNull public static final android.os.ParcelUuid PBAP_PSE;
    field @NonNull public static final android.os.ParcelUuid SAP;
    field public static final int UUID_BYTES_128_BIT = 16; // 0x10
    field public static final int UUID_BYTES_16_BIT = 2; // 0x2
    field public static final int UUID_BYTES_32_BIT = 4; // 0x4
    field @NonNull public static final android.os.ParcelUuid VOLUME_CONTROL;
  }

  public final class BluetoothVolumeControl implements java.lang.AutoCloseable android.bluetooth.BluetoothProfile {
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) public void close();
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) protected void finalize();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.BluetoothDevice> getConnectedDevices();
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public int getConnectionState(android.bluetooth.BluetoothDevice);
    method @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public java.util.List<android.bluetooth.BluetoothDevice> getDevicesMatchingConnectionStates(int[]);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getNumberOfVolumeOffsetInstances(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean isVolumeOffsetAvailable(@NonNull android.bluetooth.BluetoothDevice);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void registerCallback(@NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.BluetoothVolumeControl.Callback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public boolean setConnectionPolicy(@NonNull android.bluetooth.BluetoothDevice, int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_volume_control_for_connected_devices") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setDeviceVolume(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int, boolean);
    method @Deprecated @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolumeOffset(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void setVolumeOffset(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public void unregisterCallback(@NonNull android.bluetooth.BluetoothVolumeControl.Callback);
    field @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT) public static final String ACTION_CONNECTION_STATE_CHANGED = "android.bluetooth.volume-control.profile.action.CONNECTION_STATE_CHANGED";
  }

  public static interface BluetoothVolumeControl.Callback {
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_broadcast_volume_control_for_connected_devices") public default void onDeviceVolumeChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioDescriptionChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @NonNull String);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetAudioLocationChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
    method @Deprecated public void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=0xffffff01, to=255) int);
    method @FlaggedApi("com.android.bluetooth.flags.leaudio_multiple_vocs_instances_api") public default void onVolumeOffsetChanged(@NonNull android.bluetooth.BluetoothDevice, @IntRange(from=1, to=255) int, @IntRange(from=0xffffff01, to=255) int);
  }

  public final class BufferConstraint implements android.os.Parcelable {
    ctor public BufferConstraint(int, int, int);
    method public int describeContents();
    method public int getDefaultMillis();
    method public int getMaxMillis();
    method public int getMinMillis();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraint> CREATOR;
  }

  public final class BufferConstraints implements android.os.Parcelable {
    ctor public BufferConstraints(@NonNull java.util.List<android.bluetooth.BufferConstraint>);
    method public int describeContents();
    method @Nullable public android.bluetooth.BufferConstraint forCodec(int);
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int BUFFER_CODEC_MAX_NUM = 32; // 0x20
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.BufferConstraints> CREATOR;
  }

  public final class OobData implements android.os.Parcelable {
    method public int describeContents();
    method @NonNull public byte[] getClassOfDevice();
    method @NonNull public byte[] getClassicLength();
    method @NonNull public byte[] getConfirmationHash();
    method @NonNull public byte[] getDeviceAddressWithType();
    method @Nullable public byte[] getDeviceName();
    method @Nullable public byte[] getLeAppearance();
    method @NonNull public int getLeDeviceRole();
    method @NonNull public int getLeFlags();
    method @Nullable public byte[] getLeTemporaryKey();
    method @NonNull public byte[] getRandomizerHash();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field public static final int CLASS_OF_DEVICE_OCTETS = 3; // 0x3
    field public static final int CONFIRMATION_OCTETS = 16; // 0x10
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.OobData> CREATOR;
    field public static final int DEVICE_ADDRESS_OCTETS = 7; // 0x7
    field public static final int LE_APPEARANCE_OCTETS = 2; // 0x2
    field public static final int LE_DEVICE_FLAG_OCTETS = 1; // 0x1
    field public static final int LE_DEVICE_ROLE_BOTH_PREFER_CENTRAL = 3; // 0x3
    field public static final int LE_DEVICE_ROLE_BOTH_PREFER_PERIPHERAL = 2; // 0x2
    field public static final int LE_DEVICE_ROLE_CENTRAL_ONLY = 1; // 0x1
    field public static final int LE_DEVICE_ROLE_OCTETS = 1; // 0x1
    field public static final int LE_DEVICE_ROLE_PERIPHERAL_ONLY = 0; // 0x0
    field public static final int LE_FLAG_BREDR_NOT_SUPPORTED = 2; // 0x2
    field public static final int LE_FLAG_GENERAL_DISCOVERY_MODE = 1; // 0x1
    field public static final int LE_FLAG_LIMITED_DISCOVERY_MODE = 0; // 0x0
    field public static final int LE_FLAG_SIMULTANEOUS_CONTROLLER = 3; // 0x3
    field public static final int LE_FLAG_SIMULTANEOUS_HOST = 4; // 0x4
    field public static final int LE_TK_OCTETS = 16; // 0x10
    field public static final int OOB_LENGTH_OCTETS = 2; // 0x2
    field public static final int RANDOMIZER_OCTETS = 16; // 0x10
  }

  public static final class OobData.ClassicBuilder {
    ctor public OobData.ClassicBuilder(@NonNull byte[], @NonNull byte[], @NonNull byte[]);
    method @NonNull public android.bluetooth.OobData build();
    method @NonNull public android.bluetooth.OobData.ClassicBuilder setClassOfDevice(@NonNull byte[]);
    method @NonNull public android.bluetooth.OobData.ClassicBuilder setDeviceName(@NonNull byte[]);
    method @NonNull public android.bluetooth.OobData.ClassicBuilder setRandomizerHash(@NonNull byte[]);
  }

  public static final class OobData.LeBuilder {
    ctor public OobData.LeBuilder(@NonNull byte[], @NonNull byte[], int);
    method @NonNull public android.bluetooth.OobData build();
    method @NonNull public android.bluetooth.OobData.LeBuilder setDeviceName(@NonNull byte[]);
    method @NonNull public android.bluetooth.OobData.LeBuilder setLeFlags(int);
    method @NonNull public android.bluetooth.OobData.LeBuilder setLeTemporaryKey(@NonNull byte[]);
    method @NonNull public android.bluetooth.OobData.LeBuilder setRandomizerHash(@NonNull byte[]);
  }

  public final class UidTraffic implements java.lang.Cloneable android.os.Parcelable {
    method public android.bluetooth.UidTraffic clone();
    method public int describeContents();
    method public long getRxBytes();
    method public long getTxBytes();
    method public int getUid();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.UidTraffic> CREATOR;
  }

}

package android.bluetooth.le {

  public final class AdvertiseSettings implements android.os.Parcelable {
    method public int getOwnAddressType();
  }

  public static final class AdvertiseSettings.Builder {
    method @NonNull public android.bluetooth.le.AdvertiseSettings.Builder setOwnAddressType(int);
  }

  public final class AdvertisingSet {
    method public int getAdvertiserId();
  }

  public final class AdvertisingSetParameters implements android.os.Parcelable {
    method public int getOwnAddressType();
    field public static final int ADDRESS_TYPE_DEFAULT = -1; // 0xffffffff
    field public static final int ADDRESS_TYPE_PUBLIC = 0; // 0x0
    field public static final int ADDRESS_TYPE_RANDOM = 1; // 0x1
    field public static final int ADDRESS_TYPE_RANDOM_NON_RESOLVABLE = 2; // 0x2
  }

  public static final class AdvertisingSetParameters.Builder {
    method @NonNull public android.bluetooth.le.AdvertisingSetParameters.Builder setOwnAddressType(int);
  }

  public final class BluetoothLeAdvertiser {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_PRIVILEGED, android.Manifest.permission.BLUETOOTH_ADVERTISE, android.Manifest.permission.BLUETOOTH_CONNECT}) public void startAdvertisingSet(@NonNull android.bluetooth.le.AdvertisingSetParameters, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.AdvertiseData, @Nullable android.bluetooth.le.PeriodicAdvertisingParameters, @Nullable android.bluetooth.le.AdvertiseData, int, int, @Nullable android.bluetooth.BluetoothGattServer, @Nullable android.bluetooth.le.AdvertisingSetCallback, @NonNull android.os.Handler);
  }

  public final class BluetoothLeScanner {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(android.os.WorkSource, android.bluetooth.le.ScanCallback);
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_SCAN, android.Manifest.permission.UPDATE_DEVICE_STATS}) public void startScanFromSource(java.util.List<android.bluetooth.le.ScanFilter>, android.bluetooth.le.ScanSettings, android.os.WorkSource, android.bluetooth.le.ScanCallback);
    method @Deprecated @RequiresPermission(android.Manifest.permission.BLUETOOTH_SCAN) public void startTruncatedScan(java.util.List<android.bluetooth.le.TruncatedFilter>, android.bluetooth.le.ScanSettings, android.bluetooth.le.ScanCallback);
  }

  @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public final class ChannelSoundingParams implements android.os.Parcelable {
    method public int describeContents();
    method public int getCsSecurityLevel();
    method public int getLocationType();
    method public int getSightType();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ChannelSoundingParams> CREATOR;
    field public static final int CS_SECURITY_LEVEL_FOUR = 4; // 0x4
    field public static final int CS_SECURITY_LEVEL_ONE = 1; // 0x1
    field public static final int CS_SECURITY_LEVEL_THREE = 3; // 0x3
    field public static final int CS_SECURITY_LEVEL_TWO = 2; // 0x2
    field public static final int CS_SECURITY_LEVEL_UNKNOWN = 0; // 0x0
    field public static final int LOCATION_TYPE_INDOOR = 1; // 0x1
    field public static final int LOCATION_TYPE_OUTDOOR = 2; // 0x2
    field public static final int LOCATION_TYPE_UNKNOWN = 0; // 0x0
    field public static final int SIGHT_TYPE_LINE_OF_SIGHT = 1; // 0x1
    field public static final int SIGHT_TYPE_NON_LINE_OF_SIGHT = 2; // 0x2
    field public static final int SIGHT_TYPE_UNKNOWN = 0; // 0x0
  }

  public static final class ChannelSoundingParams.Builder {
    ctor public ChannelSoundingParams.Builder();
    method @NonNull public android.bluetooth.le.ChannelSoundingParams build();
    method @NonNull public android.bluetooth.le.ChannelSoundingParams.Builder setCsSecurityLevel(int);
    method @NonNull public android.bluetooth.le.ChannelSoundingParams.Builder setLocationType(int);
    method @NonNull public android.bluetooth.le.ChannelSoundingParams.Builder setSightType(int);
  }

  public final class DistanceMeasurementManager {
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getChannelSoundingMaxSupportedSecurityLevel(@NonNull android.bluetooth.BluetoothDevice);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int getLocalChannelSoundingMaxSupportedSecurityLevel();
    method @NonNull @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public java.util.List<android.bluetooth.le.DistanceMeasurementMethod> getSupportedMethods();
    method @Nullable @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public android.os.CancellationSignal startMeasurementSession(@NonNull android.bluetooth.le.DistanceMeasurementParams, @NonNull java.util.concurrent.Executor, @NonNull android.bluetooth.le.DistanceMeasurementSession.Callback);
  }

  public final class DistanceMeasurementMethod implements android.os.Parcelable {
    method public int describeContents();
    method public double getId();
    method public boolean isAltitudeAngleSupported();
    method public boolean isAzimuthAngleSupported();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.DistanceMeasurementMethod> CREATOR;
    field public static final int DISTANCE_MEASUREMENT_METHOD_AUTO = 0; // 0x0
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int DISTANCE_MEASUREMENT_METHOD_CHANNEL_SOUNDING = 2; // 0x2
    field public static final int DISTANCE_MEASUREMENT_METHOD_RSSI = 1; // 0x1
  }

  public static final class DistanceMeasurementMethod.Builder {
    ctor public DistanceMeasurementMethod.Builder(int);
    method @NonNull public android.bluetooth.le.DistanceMeasurementMethod build();
    method @NonNull public android.bluetooth.le.DistanceMeasurementMethod.Builder setAltitudeAngleSupported(boolean);
    method @NonNull public android.bluetooth.le.DistanceMeasurementMethod.Builder setAzimuthAngleSupported(boolean);
  }

  public final class DistanceMeasurementParams implements android.os.Parcelable {
    method public int describeContents();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @Nullable public android.bluetooth.le.ChannelSoundingParams getChannelSoundingParams();
    method public static int getDefaultDurationSeconds();
    method @NonNull public android.bluetooth.BluetoothDevice getDevice();
    method @IntRange(from=0) public int getDurationSeconds();
    method public int getFrequency();
    method public static int getMaxDurationSeconds();
    method public int getMethodId();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.DistanceMeasurementParams> CREATOR;
    field public static final int REPORT_FREQUENCY_HIGH = 2; // 0x2
    field public static final int REPORT_FREQUENCY_LOW = 0; // 0x0
    field public static final int REPORT_FREQUENCY_MEDIUM = 1; // 0x1
  }

  public static final class DistanceMeasurementParams.Builder {
    ctor public DistanceMeasurementParams.Builder(@NonNull android.bluetooth.BluetoothDevice);
    method @NonNull public android.bluetooth.le.DistanceMeasurementParams build();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementParams.Builder setChannelSoundingParams(@NonNull android.bluetooth.le.ChannelSoundingParams);
    method @NonNull public android.bluetooth.le.DistanceMeasurementParams.Builder setDurationSeconds(@IntRange(from=0) int);
    method @NonNull public android.bluetooth.le.DistanceMeasurementParams.Builder setFrequency(int);
    method @NonNull public android.bluetooth.le.DistanceMeasurementParams.Builder setMethodId(int);
  }

  public final class DistanceMeasurementResult implements android.os.Parcelable {
    method public int describeContents();
    method @FloatRange(from=-90.0, to=90.0) public double getAltitudeAngle();
    method @FloatRange(from=0.0, to=360.0) public double getAzimuthAngle();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @FloatRange(from=0.0, to=1.0) public double getConfidenceLevel();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public double getDelaySpreadMeters();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public int getDetectedAttackLevel();
    method public double getErrorAltitudeAngle();
    method public double getErrorAzimuthAngle();
    method @FloatRange(from=0.0) public double getErrorMeters();
    method public double getResultMeters();
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public double getVelocityMetersPerSecond();
    method public void writeToParcel(android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.DistanceMeasurementResult> CREATOR;
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_EXTREMELY_LIKELY = 6; // 0x6
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_EXTREMELY_UNLIKELY = 0; // 0x0
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_LIKELY = 4; // 0x4
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_POSSIBLE = 3; // 0x3
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_UNLIKELY = 2; // 0x2
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_VERY_LIKELY = 5; // 0x5
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_ATTACK_IS_VERY_UNLIKELY = 1; // 0x1
    field @FlaggedApi("com.android.bluetooth.flags.channel_sounding") public static final int NADM_UNKNOWN = 255; // 0xff
  }

  public static final class DistanceMeasurementResult.Builder {
    ctor public DistanceMeasurementResult.Builder(@FloatRange(from=0.0) double, @FloatRange(from=0.0) double);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult build();
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setAltitudeAngle(@FloatRange(from=-90.0, to=90.0) double);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setAzimuthAngle(@FloatRange(from=0.0, to=360.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setConfidenceLevel(@FloatRange(from=0.0, to=1.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setDelaySpreadMeters(double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setDetectedAttackLevel(int);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setErrorAltitudeAngle(@FloatRange(from=0.0, to=180.0) double);
    method @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setErrorAzimuthAngle(@FloatRange(from=0.0, to=360.0) double);
    method @FlaggedApi("com.android.bluetooth.flags.channel_sounding") @NonNull public android.bluetooth.le.DistanceMeasurementResult.Builder setVelocityMetersPerSecond(double);
  }

  public final class DistanceMeasurementSession {
    method @RequiresPermission(allOf={android.Manifest.permission.BLUETOOTH_CONNECT, android.Manifest.permission.BLUETOOTH_PRIVILEGED}) public int stopSession();
  }

  public static interface DistanceMeasurementSession.Callback {
    method public void onResult(@NonNull android.bluetooth.BluetoothDevice, @NonNull android.bluetooth.le.DistanceMeasurementResult);
    method public void onStartFail(@NonNull int);
    method public void onStarted(@NonNull android.bluetooth.le.DistanceMeasurementSession);
    method public void onStopped(@NonNull android.bluetooth.le.DistanceMeasurementSession, @NonNull int);
  }

  @Deprecated public final class ResultStorageDescriptor implements android.os.Parcelable {
    ctor @Deprecated public ResultStorageDescriptor(int, int, int);
    method @Deprecated public int describeContents();
    method @Deprecated public int getLength();
    method @Deprecated public int getOffset();
    method @Deprecated public int getType();
    method @Deprecated public void writeToParcel(android.os.Parcel, int);
    field @Deprecated @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.ResultStorageDescriptor> CREATOR;
  }

  public final class ScanFilter implements android.os.Parcelable {
    method public int getAddressType();
    method @Nullable public byte[] getIrk();
    method @Nullable public android.bluetooth.le.TransportBlockFilter getTransportBlockFilter();
  }

  public static final class ScanFilter.Builder {
    method @NonNull public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(@NonNull String, int);
    method @NonNull public android.bluetooth.le.ScanFilter.Builder setDeviceAddress(@NonNull String, int, @NonNull byte[]);
    method @NonNull public android.bluetooth.le.ScanFilter.Builder setTransportBlockFilter(@NonNull android.bluetooth.le.TransportBlockFilter);
    field public static final int LEN_IRK_OCTETS = 16; // 0x10
  }

  public final class ScanRecord {
    method @Nullable public android.bluetooth.le.TransportDiscoveryData getTransportDiscoveryData();
  }

  public final class ScanSettings implements android.os.Parcelable {
    field public static final int SCAN_MODE_AMBIENT_DISCOVERY = 3; // 0x3
    field public static final int SCAN_RESULT_TYPE_ABBREVIATED = 1; // 0x1
    field public static final int SCAN_RESULT_TYPE_FULL = 0; // 0x0
  }

  public static final class ScanSettings.Builder {
    method public android.bluetooth.le.ScanSettings.Builder setScanResultType(int);
  }

  public final class TransportBlockFilter implements android.os.Parcelable {
    method public int describeContents();
    method public int getOrgId();
    method public int getTdsFlags();
    method public int getTdsFlagsMask();
    method @Nullable public byte[] getTransportData();
    method @Nullable public byte[] getTransportDataMask();
    method @Nullable public byte[] getWifiNanHash();
    method public void writeToParcel(@NonNull android.os.Parcel, int);
    field @NonNull public static final android.os.Parcelable.Creator<android.bluetooth.le.TransportBlockFilter> CREATOR;
    field public static final int WIFI_NAN_HASH_LENGTH_BYTES = 8; // 0x8
  }

  public static final class TransportBlockFilter.Builder {
    ctor public TransportBlockFilter.Builder(int);
    method @NonNull public android.bluetooth.le.TransportBlockFilter build();
    method @NonNull public android.bluetooth.le.TransportBlockFilter.Builder setTdsFlags(int, int);
    method @NonNull public android.bluetooth.le.TransportBlockFilter.Builder setTransportData(@NonNull byte[], @NonNull byte[]);
    method @NonNull public android.bluetooth.le.TransportBlockFilter.Builder setWifiNanHash(@NonNull byte[]);
  }

  @Deprecated public final class TruncatedFilter {
    ctor @Deprecated public TruncatedFilter(android.bluetooth.le.ScanFilter, java.util.List<android.bluetooth.le.ResultStorageDescriptor>);
    method @Deprecated public android.bluetooth.le.ScanFilter getFilter();
    method @Deprecated public java.util.List<android.bluetooth.le.ResultStorageDescriptor> getStorageDescriptors();
  }

}

