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

Commit a2ed5372 authored by William Escande's avatar William Escande Committed by Automerger Merge Worker
Browse files

Merge "Use aconfig flag for flaggedApi" into main am: 1b2e449d

parents b444f988 1b2e449d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -17,12 +17,15 @@ java_aconfig_library {
    visibility: [
        "//cts/tests/tests/bluetooth:__subpackages__",
        "//packages/modules/Bluetooth/android/app",
        "//packages/modules/Bluetooth/framework",
        "//packages/modules/Bluetooth/framework/tests/util",
        "//packages/modules/Bluetooth/service:__subpackages__",
    ],
    apex_available: [
        "com.android.btservices",
    ],
    libs: ["framework-configinfrastructure"],
    sdk_version: "module_current",
    min_sdk_version: "Tiramisu",
}

+2 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ java_defaults {
    defaults: ["bluetooth-module-sdk-version-defaults"],
    static_libs: [
        "PlatformProperties",
        "bluetooth_flags_java_lib",
        "modules-utils-expresslog",
        "modules-utils-synchronous-result-receiver",
    ],
@@ -85,6 +86,7 @@ java_sdk_library {

    permitted_packages: [
        "android.bluetooth",
        "com.android.bluetooth.flags",
        // Created by jarjar rules.
        "com.android.bluetooth.x",
    ],
+2 −1
Original line number Diff line number Diff line
@@ -39,6 +39,7 @@ import android.os.ParcelUuid;
import android.os.RemoteException;
import android.util.Log;

import com.android.bluetooth.flags.Flags;
import com.android.modules.utils.SynchronousResultReceiver;

import java.lang.annotation.Retention;
@@ -742,7 +743,7 @@ public final class BluetoothA2dp implements BluetoothProfile {
    @NonNull
    @RequiresLegacyBluetoothPermission
    @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() {
        Log.d(TAG, "getSupportedSourceCodecTypes()");
        final IBluetoothA2dp service = getService();
+4 −2
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ import android.compat.annotation.UnsupportedAppUsage;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.bluetooth.flags.Flags;

import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.util.Objects;
@@ -547,7 +549,7 @@ public final class BluetoothCodecConfig implements Parcelable {
    }

    /** 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() {
        return mCodecType;
    }
@@ -857,7 +859,7 @@ public final class BluetoothCodecConfig implements Parcelable {
         * @param codecType of this codec
         * @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) {
            mCodecType = codecType;
            return this;
+10 −8
Original line number Diff line number Diff line
@@ -23,12 +23,14 @@ import android.annotation.SystemApi;
import android.os.Parcel;
import android.os.Parcelable;

import com.android.bluetooth.flags.Flags;

/**
 * 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
 * codec identifier.
 */
@FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility")
@FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY)
public final class BluetoothCodecType implements Parcelable {
    private final int mNativeCodecType;
    private final long mCodecId;
@@ -86,7 +88,7 @@ public final class BluetoothCodecType implements Parcelable {
    }

    /** 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() {
        return mNativeCodecType == BluetoothCodecConfig.SOURCE_CODEC_TYPE_SBC;
    }
@@ -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
     * 0xFF.
     */
    @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility")
    @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY)
    public long getCodecId() {
        return mCodecId;
    }

    /** Returns the codec name. */
    @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility")
    @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY)
    public @NonNull String getCodecName() {
        return mCodecName;
    }
@@ -144,7 +146,7 @@ public final class BluetoothCodecType implements Parcelable {

    /** @hide */
    @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) {
        dest.writeInt(mNativeCodecType);
        dest.writeLong(mCodecId);
@@ -159,7 +161,7 @@ public final class BluetoothCodecType implements Parcelable {
     * @hide
     */
    @SystemApi
    @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility")
    @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY)
    public static @Nullable BluetoothCodecType createFromType(
            @BluetoothCodecConfig.SourceCodecType int codecType) {
        long codecId =
@@ -185,12 +187,12 @@ public final class BluetoothCodecType implements Parcelable {
     * @hide
     */
    @Override
    @FlaggedApi("com.android.bluetooth.flags.a2dp_offload_codec_extensibility")
    @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY)
    public int describeContents() {
        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 =
            new Creator<>() {
                public BluetoothCodecType createFromParcel(Parcel in) {
Loading