cherry-pick of aosp/1959811

Due to bigest topic on aosp, the cl has not been merged in internal
This CL is only to reduce merge-conflict between aosp and internal
Test: build

Change-Id: I47edabfbcbd2eb15650194d6234f54c16d74ed07
This commit is contained in:
William Escande
2022-01-31 19:13:50 +01:00
parent 79d81ab200
commit eb01666b8d

View File

@@ -15,39 +15,24 @@
*/
package android.media;
import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.bluetooth.BluetoothProfile;
import android.os.Parcel;
import android.os.Parcelable;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
/**
* Contains information about Bluetooth profile connection state changed
* {@hide}
*/
@SystemApi(client = SystemApi.Client.MODULE_LIBRARIES)
public final class BtProfileConnectionInfo implements Parcelable {
/** @hide */
@IntDef({
BluetoothProfile.A2DP,
BluetoothProfile.A2DP_SINK,
BluetoothProfile.HEADSET, // Can only be set by BtHelper
BluetoothProfile.HEARING_AID,
BluetoothProfile.LE_AUDIO,
})
@Retention(RetentionPolicy.SOURCE)
public @interface BtProfile {}
private final @BtProfile int mProfile;
private final int mProfile;
private final boolean mSupprNoisy;
private final int mVolume;
private final boolean mIsLeOutput;
private BtProfileConnectionInfo(@BtProfile int profile, boolean suppressNoisyIntent, int volume,
private BtProfileConnectionInfo(int profile, boolean suppressNoisyIntent, int volume,
boolean isLeOutput) {
mProfile = profile;
mSupprNoisy = suppressNoisyIntent;
@@ -59,7 +44,7 @@ public final class BtProfileConnectionInfo implements Parcelable {
* Constructor used by BtHelper when a profile is connected
* {@hide}
*/
public BtProfileConnectionInfo(@BtProfile int profile) {
public BtProfileConnectionInfo(int profile) {
this(profile, false, -1, false);
}
@@ -142,7 +127,7 @@ public final class BtProfileConnectionInfo implements Parcelable {
/**
* @return The profile connection
*/
public @BtProfile int getProfile() {
public int getProfile() {
return mProfile;
}