Loading flags/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,15 @@ java_aconfig_library { visibility: [ visibility: [ "//cts/tests/tests/bluetooth:__subpackages__", "//cts/tests/tests/bluetooth:__subpackages__", "//packages/modules/Bluetooth/android/app", "//packages/modules/Bluetooth/android/app", "//packages/modules/Bluetooth/framework", "//packages/modules/Bluetooth/framework/tests/util", "//packages/modules/Bluetooth/framework/tests/util", "//packages/modules/Bluetooth/service:__subpackages__", "//packages/modules/Bluetooth/service:__subpackages__", ], ], apex_available: [ apex_available: [ "com.android.btservices", "com.android.btservices", ], ], libs: ["framework-configinfrastructure"], sdk_version: "module_current", min_sdk_version: "Tiramisu", min_sdk_version: "Tiramisu", } } Loading framework/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ java_defaults { defaults: ["bluetooth-module-sdk-version-defaults"], defaults: ["bluetooth-module-sdk-version-defaults"], static_libs: [ static_libs: [ "PlatformProperties", "PlatformProperties", "bluetooth_flags_java_lib", "modules-utils-expresslog", "modules-utils-expresslog", "modules-utils-synchronous-result-receiver", "modules-utils-synchronous-result-receiver", ], ], Loading Loading @@ -85,6 +86,7 @@ java_sdk_library { permitted_packages: [ permitted_packages: [ "android.bluetooth", "android.bluetooth", "com.android.bluetooth.flags", // Created by jarjar rules. // Created by jarjar rules. "com.android.bluetooth.x", "com.android.bluetooth.x", ], ], Loading framework/java/android/bluetooth/BluetoothA2dp.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.ParcelUuid; import android.os.RemoteException; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.bluetooth.flags.Flags; import com.android.modules.utils.SynchronousResultReceiver; import com.android.modules.utils.SynchronousResultReceiver; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -742,7 +743,7 @@ public final class BluetoothA2dp implements BluetoothProfile { @NonNull @NonNull @RequiresLegacyBluetoothPermission @RequiresLegacyBluetoothPermission @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public List<BluetoothCodecType> getSupportedCodecTypes() { public List<BluetoothCodecType> getSupportedCodecTypes() { Log.d(TAG, "getSupportedSourceCodecTypes()"); Log.d(TAG, "getSupportedSourceCodecTypes()"); final IBluetoothA2dp service = getService(); final IBluetoothA2dp service = getService(); Loading framework/java/android/bluetooth/BluetoothCodecConfig.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import com.android.bluetooth.flags.Flags; import java.lang.annotation.Retention; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy; import java.util.Objects; import java.util.Objects; Loading Loading @@ -547,7 +549,7 @@ public final class BluetoothCodecConfig implements Parcelable { } } /** Returns the source codec type of this config. */ /** Returns the source codec type of this config. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @Nullable BluetoothCodecType getExtendedCodecType() { public @Nullable BluetoothCodecType getExtendedCodecType() { return mCodecType; return mCodecType; } } Loading Loading @@ -857,7 +859,7 @@ public final class BluetoothCodecConfig implements Parcelable { * @param codecType of this codec * @param codecType of this codec * @return the same Builder instance * @return the same Builder instance */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @NonNull Builder setCodecType(@Nullable BluetoothCodecType codecType) { public @NonNull Builder setCodecType(@Nullable BluetoothCodecType codecType) { mCodecType = codecType; mCodecType = codecType; return this; return this; Loading framework/java/android/bluetooth/BluetoothCodecType.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -23,12 +23,14 @@ import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import com.android.bluetooth.flags.Flags; /** /** * Represents a supported source codec type for a Bluetooth A2DP device. See {@link * Represents a supported source codec type for a Bluetooth A2DP device. See {@link * BluetoothA2dp#getSupportedCodecTypes}. The codec type is uniquely identified by its name and * BluetoothA2dp#getSupportedCodecTypes}. The codec type is uniquely identified by its name and * codec identifier. * codec identifier. */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public final class BluetoothCodecType implements Parcelable { public final class BluetoothCodecType implements Parcelable { private final int mNativeCodecType; private final int mNativeCodecType; private final long mCodecId; private final long mCodecId; Loading Loading @@ -86,7 +88,7 @@ public final class BluetoothCodecType implements Parcelable { } } /** Returns if the codec type is mandatory in the Bluetooth specification. */ /** Returns if the codec type is mandatory in the Bluetooth specification. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public boolean isMandatoryCodec() { public boolean isMandatoryCodec() { return mNativeCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC; return mNativeCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC; } } Loading @@ -97,13 +99,13 @@ public final class BluetoothCodecType implements Parcelable { * 0, if octet 0 is not 0xFF. - Bits 24-39: Vendor-defined codec ID, set to 0, if octet 0 is not * 0, if octet 0 is not 0xFF. - Bits 24-39: Vendor-defined codec ID, set to 0, if octet 0 is not * 0xFF. * 0xFF. */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public long getCodecId() { public long getCodecId() { return mCodecId; return mCodecId; } } /** Returns the codec name. */ /** Returns the codec name. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @NonNull String getCodecName() { public @NonNull String getCodecName() { return mCodecName; return mCodecName; } } Loading Loading @@ -144,7 +146,7 @@ public final class BluetoothCodecType implements Parcelable { /** @hide */ /** @hide */ @Override @Override @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public void writeToParcel(@NonNull Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mNativeCodecType); dest.writeInt(mNativeCodecType); dest.writeLong(mCodecId); dest.writeLong(mCodecId); Loading @@ -159,7 +161,7 @@ public final class BluetoothCodecType implements Parcelable { * @hide * @hide */ */ @SystemApi @SystemApi @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public static @Nullable BluetoothCodecType createFromType( public static @Nullable BluetoothCodecType createFromType( @BluetoothCodecConfig.SourceCodecType int codecType) { @BluetoothCodecConfig.SourceCodecType int codecType) { long codecId = long codecId = Loading @@ -185,12 +187,12 @@ public final class BluetoothCodecType implements Parcelable { * @hide * @hide */ */ @Override @Override @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public int describeContents() { public int describeContents() { return 0; return 0; } } @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public static final @NonNull Creator<BluetoothCodecType> CREATOR = public static final @NonNull Creator<BluetoothCodecType> CREATOR = new Creator<>() { new Creator<>() { public BluetoothCodecType createFromParcel(Parcel in) { public BluetoothCodecType createFromParcel(Parcel in) { Loading Loading
flags/Android.bp +3 −0 Original line number Original line Diff line number Diff line Loading @@ -17,12 +17,15 @@ java_aconfig_library { visibility: [ visibility: [ "//cts/tests/tests/bluetooth:__subpackages__", "//cts/tests/tests/bluetooth:__subpackages__", "//packages/modules/Bluetooth/android/app", "//packages/modules/Bluetooth/android/app", "//packages/modules/Bluetooth/framework", "//packages/modules/Bluetooth/framework/tests/util", "//packages/modules/Bluetooth/framework/tests/util", "//packages/modules/Bluetooth/service:__subpackages__", "//packages/modules/Bluetooth/service:__subpackages__", ], ], apex_available: [ apex_available: [ "com.android.btservices", "com.android.btservices", ], ], libs: ["framework-configinfrastructure"], sdk_version: "module_current", min_sdk_version: "Tiramisu", min_sdk_version: "Tiramisu", } } Loading
framework/Android.bp +2 −0 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,7 @@ java_defaults { defaults: ["bluetooth-module-sdk-version-defaults"], defaults: ["bluetooth-module-sdk-version-defaults"], static_libs: [ static_libs: [ "PlatformProperties", "PlatformProperties", "bluetooth_flags_java_lib", "modules-utils-expresslog", "modules-utils-expresslog", "modules-utils-synchronous-result-receiver", "modules-utils-synchronous-result-receiver", ], ], Loading Loading @@ -85,6 +86,7 @@ java_sdk_library { permitted_packages: [ permitted_packages: [ "android.bluetooth", "android.bluetooth", "com.android.bluetooth.flags", // Created by jarjar rules. // Created by jarjar rules. "com.android.bluetooth.x", "com.android.bluetooth.x", ], ], Loading
framework/java/android/bluetooth/BluetoothA2dp.java +2 −1 Original line number Original line Diff line number Diff line Loading @@ -39,6 +39,7 @@ import android.os.ParcelUuid; import android.os.RemoteException; import android.os.RemoteException; import android.util.Log; import android.util.Log; import com.android.bluetooth.flags.Flags; import com.android.modules.utils.SynchronousResultReceiver; import com.android.modules.utils.SynchronousResultReceiver; import java.lang.annotation.Retention; import java.lang.annotation.Retention; Loading Loading @@ -742,7 +743,7 @@ public final class BluetoothA2dp implements BluetoothProfile { @NonNull @NonNull @RequiresLegacyBluetoothPermission @RequiresLegacyBluetoothPermission @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED) @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public List<BluetoothCodecType> getSupportedCodecTypes() { public List<BluetoothCodecType> getSupportedCodecTypes() { Log.d(TAG, "getSupportedSourceCodecTypes()"); Log.d(TAG, "getSupportedSourceCodecTypes()"); final IBluetoothA2dp service = getService(); final IBluetoothA2dp service = getService(); Loading
framework/java/android/bluetooth/BluetoothCodecConfig.java +4 −2 Original line number Original line Diff line number Diff line Loading @@ -25,6 +25,8 @@ import android.compat.annotation.UnsupportedAppUsage; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import com.android.bluetooth.flags.Flags; import java.lang.annotation.Retention; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.lang.annotation.RetentionPolicy; import java.util.Objects; import java.util.Objects; Loading Loading @@ -547,7 +549,7 @@ public final class BluetoothCodecConfig implements Parcelable { } } /** Returns the source codec type of this config. */ /** Returns the source codec type of this config. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @Nullable BluetoothCodecType getExtendedCodecType() { public @Nullable BluetoothCodecType getExtendedCodecType() { return mCodecType; return mCodecType; } } Loading Loading @@ -857,7 +859,7 @@ public final class BluetoothCodecConfig implements Parcelable { * @param codecType of this codec * @param codecType of this codec * @return the same Builder instance * @return the same Builder instance */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @NonNull Builder setCodecType(@Nullable BluetoothCodecType codecType) { public @NonNull Builder setCodecType(@Nullable BluetoothCodecType codecType) { mCodecType = codecType; mCodecType = codecType; return this; return this; Loading
framework/java/android/bluetooth/BluetoothCodecType.java +10 −8 Original line number Original line Diff line number Diff line Loading @@ -23,12 +23,14 @@ import android.annotation.SystemApi; import android.os.Parcel; import android.os.Parcel; import android.os.Parcelable; import android.os.Parcelable; import com.android.bluetooth.flags.Flags; /** /** * Represents a supported source codec type for a Bluetooth A2DP device. See {@link * Represents a supported source codec type for a Bluetooth A2DP device. See {@link * BluetoothA2dp#getSupportedCodecTypes}. The codec type is uniquely identified by its name and * BluetoothA2dp#getSupportedCodecTypes}. The codec type is uniquely identified by its name and * codec identifier. * codec identifier. */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public final class BluetoothCodecType implements Parcelable { public final class BluetoothCodecType implements Parcelable { private final int mNativeCodecType; private final int mNativeCodecType; private final long mCodecId; private final long mCodecId; Loading Loading @@ -86,7 +88,7 @@ public final class BluetoothCodecType implements Parcelable { } } /** Returns if the codec type is mandatory in the Bluetooth specification. */ /** Returns if the codec type is mandatory in the Bluetooth specification. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public boolean isMandatoryCodec() { public boolean isMandatoryCodec() { return mNativeCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC; return mNativeCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC; } } Loading @@ -97,13 +99,13 @@ public final class BluetoothCodecType implements Parcelable { * 0, if octet 0 is not 0xFF. - Bits 24-39: Vendor-defined codec ID, set to 0, if octet 0 is not * 0, if octet 0 is not 0xFF. - Bits 24-39: Vendor-defined codec ID, set to 0, if octet 0 is not * 0xFF. * 0xFF. */ */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public long getCodecId() { public long getCodecId() { return mCodecId; return mCodecId; } } /** Returns the codec name. */ /** Returns the codec name. */ @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public @NonNull String getCodecName() { public @NonNull String getCodecName() { return mCodecName; return mCodecName; } } Loading Loading @@ -144,7 +146,7 @@ public final class BluetoothCodecType implements Parcelable { /** @hide */ /** @hide */ @Override @Override @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public void writeToParcel(@NonNull Parcel dest, int flags) { public void writeToParcel(@NonNull Parcel dest, int flags) { dest.writeInt(mNativeCodecType); dest.writeInt(mNativeCodecType); dest.writeLong(mCodecId); dest.writeLong(mCodecId); Loading @@ -159,7 +161,7 @@ public final class BluetoothCodecType implements Parcelable { * @hide * @hide */ */ @SystemApi @SystemApi @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public static @Nullable BluetoothCodecType createFromType( public static @Nullable BluetoothCodecType createFromType( @BluetoothCodecConfig.SourceCodecType int codecType) { @BluetoothCodecConfig.SourceCodecType int codecType) { long codecId = long codecId = Loading @@ -185,12 +187,12 @@ public final class BluetoothCodecType implements Parcelable { * @hide * @hide */ */ @Override @Override @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public int describeContents() { public int describeContents() { return 0; return 0; } } @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility") @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY) public static final @NonNull Creator<BluetoothCodecType> CREATOR = public static final @NonNull Creator<BluetoothCodecType> CREATOR = new Creator<>() { new Creator<>() { public BluetoothCodecType createFromParcel(Parcel in) { public BluetoothCodecType createFromParcel(Parcel in) { Loading