Add BtProfileConnectionInfo.a2dpSinkInfo

Following aosp/1782984 comment from QC, we are adding the a2dpSinkInfo
method.

Test: build
Tag: #feature
Bug: 190422401
Change-Id: I456ced3bb87dcffcea7bd0c24b63e06d62d9b95a
This commit is contained in:
William Escande
2021-12-31 11:41:25 +01:00
parent 4f4060c7b4
commit b22dcdb6a1
2 changed files with 12 additions and 1 deletions

View File

@@ -127,6 +127,7 @@ package android.media {
public final class BtProfileConnectionInfo implements android.os.Parcelable {
method @NonNull public static android.media.BtProfileConnectionInfo a2dpInfo(boolean, int);
method @NonNull public static android.media.BtProfileConnectionInfo a2dpSinkInfo(int);
method public int describeContents();
method public boolean getIsLeOutput();
method public int getProfile();

View File

@@ -34,7 +34,7 @@ public final class BtProfileConnectionInfo implements Parcelable {
/** @hide */
@IntDef({
BluetoothProfile.A2DP,
BluetoothProfile.A2DP_SINK, // Can only be set by BtHelper
BluetoothProfile.A2DP_SINK,
BluetoothProfile.HEADSET, // Can only be set by BtHelper
BluetoothProfile.HEARING_AID,
BluetoothProfile.LE_AUDIO,
@@ -104,6 +104,16 @@ public final class BtProfileConnectionInfo implements Parcelable {
false);
}
/**
* Constructor for A2dp sink info
* The {@link AudioManager.ACTION_AUDIO_BECOMING_NOISY} intent will not be sent.
*
* @param volume of device -1 to ignore value
*/
public static @NonNull BtProfileConnectionInfo a2dpSinkInfo(int volume) {
return new BtProfileConnectionInfo(BluetoothProfile.A2DP_SINK, true, volume, false);
}
/**
* Constructor for hearing aid info
*