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

Commit 1dda4f55 authored by Jakub Rotkiewicz's avatar Jakub Rotkiewicz
Browse files

24Q4: Removal of a2dp_offload_codec_extensibility_settings

Bug: 323319530
Fix: 323319530
Flag: EXEMPT removing com.android.settings.development.a2dp_offload_codec_extensibility_settings
Test: atest SettingsRoboTests
Merged-In: If9c710c0aaed7326b32dd2e7d5f3109de4047b97
Change-Id: I3fad2d0b5b356afd3524ef9ddc0cf1ccbaed9eb4
parent 672fcd51
Loading
Loading
Loading
Loading
+0 −7
Original line number Original line Diff line number Diff line
package: "com.android.settings.development"
package: "com.android.settings.development"
container: "system"
container: "system"


flag {
  name: "a2dp_offload_codec_extensibility_settings"
  namespace: "bluetooth"
  description: "Feature flag for Bluetooth Audio Codec extensibility in Settings"
  bug: "323319530"
}

flag {
flag {
  name: "deprecate_list_activity"
  name: "deprecate_list_activity"
  namespace: "android_settings"
  namespace: "android_settings"
+0 −75
Original line number Original line Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2019 The Android Open Source Project

     Licensed under the Apache License, Version 2.0 (the "License");
     you may not use this file except in compliance with the License.
     You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

     Unless required by applicable law or agreed to in writing, software
     distributed under the License is distributed on an "AS IS" BASIS,
     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     See the License for the specific language governing permissions and
     limitations under the License.
-->

<ScrollView
    xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="wrap_content">

    <LinearLayout
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:orientation="vertical"
        android:padding="8dp">

        <RadioGroup
            android:id="@+id/bluetooth_audio_codec_radio_group"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:layout_marginStart="@dimen/developer_option_dialog_margin_start">

            <include
                android:id="@+id/bluetooth_audio_codec_default"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_sbc"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_aac"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_aptx"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_aptx_hd"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_ldac"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_lc3"
                layout="@layout/preference_widget_dialog_radiobutton"/>

            <include
                android:id="@+id/bluetooth_audio_codec_opus"
                layout="@layout/preference_widget_dialog_radiobutton"/>

        </RadioGroup>

        <include
                android:id="@+id/bluetooth_audio_codec_help_info"
                layout="@layout/preference_widget_dialog_summary"/>

    </LinearLayout>

</ScrollView>
+0 −8
Original line number Original line Diff line number Diff line
@@ -429,14 +429,6 @@
            android:key="bluetooth_hd_audio_settings"
            android:key="bluetooth_hd_audio_settings"
            android:title="@string/bluetooth_profile_a2dp_high_quality_unknown_codec"/>
            android:title="@string/bluetooth_profile_a2dp_high_quality_unknown_codec"/>


        <com.android.settings.development.bluetooth.BluetoothCodecDialogPreference
            android:key="bluetooth_audio_codec_settings"
            android:title="@string/bluetooth_select_a2dp_codec_type"
            android:dialogTitle="@string/bluetooth_select_a2dp_codec_type_dialog_title"
            android:dialogLayout="@layout/bluetooth_audio_codec_dialog"
            android:positiveButtonText=""
            android:negativeButtonText="@string/dlg_ok"/>

        <ListPreference
        <ListPreference
            android:key="bluetooth_audio_codec_settings_list"
            android:key="bluetooth_audio_codec_settings_list"
            android:title="@string/bluetooth_select_a2dp_codec_type"
            android:title="@string/bluetooth_select_a2dp_codec_type"
+1 −27
Original line number Original line Diff line number Diff line
@@ -16,11 +16,9 @@


package com.android.settings.development;
package com.android.settings.development;


import android.annotation.FlaggedApi;
import android.bluetooth.BluetoothCodecConfig;
import android.bluetooth.BluetoothCodecConfig;
import android.bluetooth.BluetoothCodecType;
import android.bluetooth.BluetoothCodecType;


import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.Nullable;


/** Utility class for storing current Bluetooth A2DP profile values */
/** Utility class for storing current Bluetooth A2DP profile values */
@@ -38,10 +36,6 @@ public class BluetoothA2dpConfigStore {
    private long mCodecSpecific3Value;
    private long mCodecSpecific3Value;
    private long mCodecSpecific4Value;
    private long mCodecSpecific4Value;


    public void setCodecType(int codecType) {
        mCodecTypeNative = codecType;
    }

    public void setCodecType(@Nullable BluetoothCodecType codecType) {
    public void setCodecType(@Nullable BluetoothCodecType codecType) {
        mCodecType = codecType;
        mCodecType = codecType;
    }
    }
@@ -82,6 +76,7 @@ public class BluetoothA2dpConfigStore {
    public BluetoothCodecConfig createCodecConfig() {
    public BluetoothCodecConfig createCodecConfig() {
        BluetoothCodecConfig.Builder builder = new BluetoothCodecConfig.Builder()
        BluetoothCodecConfig.Builder builder = new BluetoothCodecConfig.Builder()
                .setCodecPriority(mCodecPriority)
                .setCodecPriority(mCodecPriority)
                .setExtendedCodecType(mCodecType)
                .setSampleRate(mSampleRate)
                .setSampleRate(mSampleRate)
                .setBitsPerSample(mBitsPerSample)
                .setBitsPerSample(mBitsPerSample)
                .setChannelMode(mChannelMode)
                .setChannelMode(mChannelMode)
@@ -89,27 +84,6 @@ public class BluetoothA2dpConfigStore {
                .setCodecSpecific2(mCodecSpecific2Value)
                .setCodecSpecific2(mCodecSpecific2Value)
                .setCodecSpecific3(mCodecSpecific3Value)
                .setCodecSpecific3(mCodecSpecific3Value)
                .setCodecSpecific4(mCodecSpecific4Value);
                .setCodecSpecific4(mCodecSpecific4Value);
        if (Flags.a2dpOffloadCodecExtensibilitySettings()) {
            builder.setExtendedCodecType(mCodecType);
        } else {
            builder.setCodecType(mCodecTypeNative);
        }
        return builder.build();
        return builder.build();
    }
    }

    /** Create codec config utilizing {@link BluetoothCodecType} */
    @FlaggedApi(Flags.FLAG_A2DP_OFFLOAD_CODEC_EXTENSIBILITY_SETTINGS)
    public @NonNull BluetoothCodecConfig createCodecConfigFromCodecType() {
        return new BluetoothCodecConfig.Builder()
                .setExtendedCodecType(mCodecType)
                .setCodecPriority(mCodecPriority)
                .setSampleRate(mSampleRate)
                .setBitsPerSample(mBitsPerSample)
                .setChannelMode(mChannelMode)
                .setCodecSpecific1(mCodecSpecific1Value)
                .setCodecSpecific2(mCodecSpecific2Value)
                .setCodecSpecific3(mCodecSpecific3Value)
                .setCodecSpecific4(mCodecSpecific4Value)
                .build();
    }
}
}
+1 −5
Original line number Original line Diff line number Diff line
@@ -67,7 +67,6 @@ import com.android.settings.development.bluetooth.AbstractBluetoothDialogPrefere
import com.android.settings.development.bluetooth.AbstractBluetoothPreferenceController;
import com.android.settings.development.bluetooth.AbstractBluetoothPreferenceController;
import com.android.settings.development.bluetooth.BluetoothBitPerSampleDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothBitPerSampleDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothChannelModeDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothChannelModeDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothCodecDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothCodecListPreferenceController;
import com.android.settings.development.bluetooth.BluetoothCodecListPreferenceController;
import com.android.settings.development.bluetooth.BluetoothHDAudioPreferenceController;
import com.android.settings.development.bluetooth.BluetoothHDAudioPreferenceController;
import com.android.settings.development.bluetooth.BluetoothQualityDialogPreferenceController;
import com.android.settings.development.bluetooth.BluetoothQualityDialogPreferenceController;
@@ -802,8 +801,6 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
        controllers.add(new AutofillCategoryController(context, lifecycle));
        controllers.add(new AutofillCategoryController(context, lifecycle));
        controllers.add(new AutofillLoggingLevelPreferenceController(context, lifecycle));
        controllers.add(new AutofillLoggingLevelPreferenceController(context, lifecycle));
        controllers.add(new AutofillResetOptionsPreferenceController(context));
        controllers.add(new AutofillResetOptionsPreferenceController(context));
        controllers.add(new BluetoothCodecDialogPreferenceController(context, lifecycle,
                bluetoothA2dpConfigStore, fragment));
        controllers.add(
        controllers.add(
                new BluetoothCodecListPreferenceController(
                new BluetoothCodecListPreferenceController(
                        context, lifecycle, bluetoothA2dpConfigStore, fragment));
                        context, lifecycle, bluetoothA2dpConfigStore, fragment));
@@ -838,8 +835,7 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
    @Override
    @Override
    public void onBluetoothCodecChanged() {
    public void onBluetoothCodecChanged() {
        for (AbstractPreferenceController controller : mPreferenceControllers) {
        for (AbstractPreferenceController controller : mPreferenceControllers) {
            if (controller instanceof AbstractBluetoothDialogPreferenceController
            if (controller instanceof AbstractBluetoothDialogPreferenceController) {
                    && !(controller instanceof BluetoothCodecDialogPreferenceController)) {
                ((AbstractBluetoothDialogPreferenceController) controller)
                ((AbstractBluetoothDialogPreferenceController) controller)
                        .onBluetoothCodecUpdated();
                        .onBluetoothCodecUpdated();
            }
            }
Loading