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

Commit fdc069e0 authored by Haijie Hong's avatar Haijie Hong Committed by Android (Google) Code Review
Browse files

Merge changes I0934889a,I80972995 into main

* changes:
  Update device details toggles
  Update icon position in bluetooth header
parents aa85be1d e9e13a60
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -31,7 +31,8 @@
    <ImageView
        android:id="@+id/bt_header_icon"
        android:importantForAccessibility="no"
        style="@style/SettingsLibEntityHeaderIcon"/>
        style="@style/SettingsLibEntityHeaderIcon"
        android:featureFlag="!com.android.settings.flags.enable_bluetooth_settings_expressive_design_read_only"/>

    <androidx.constraintlayout.widget.ConstraintLayout
        android:layout_width="match_parent"
@@ -77,4 +78,11 @@
        android:layout_marginTop="2dp"
        android:singleLine="false"
        android:textAlignment="center"/>

    <ImageView
        android:id="@+id/bt_header_icon"
        android:importantForAccessibility="no"
        style="@style/SettingsLibEntityHeaderIcon"
        android:layout_marginTop="16dp"
        android:featureFlag="com.android.settings.flags.enable_bluetooth_settings_expressive_design_read_only"/>
</LinearLayout>
+8 −2
Original line number Diff line number Diff line
@@ -89,14 +89,20 @@
        android:key="hearing_device_group" />

    <PreferenceCategory
        android:key="bluetooth_audio_device_type_group"/>
        android:key="bluetooth_audio_device_type_group"
        android:featureFlag="!com.android.settings.flags.enable_bluetooth_settings_expressive_design_read_only"/>

    <PreferenceCategory
        android:key="spatial_audio_group"/>
        android:key="spatial_audio_group"
        android:featureFlag="!com.android.settings.flags.enable_bluetooth_settings_expressive_design_read_only"/>

    <PreferenceCategory
        android:key="bluetooth_profiles"/>

    <PreferenceCategory
        android:key="bluetooth_audio_device_type_group"
        android:featureFlag="com.android.settings.flags.enable_bluetooth_settings_expressive_design_read_only"/>

    <PreferenceCategory
        android:key="bt_extra_options"/>

+1 −1
Original line number Diff line number Diff line
@@ -123,6 +123,7 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
        if (invisibleProfiles != null) {
            mInvisibleProfiles = Set.copyOf(invisibleProfiles);
        }
        mProfilesContainer.setVisible(false);
        refresh();
    }

@@ -522,7 +523,6 @@ public class BluetoothDetailsProfilesController extends BluetoothDetailsControll
     */
    @Override
    protected void refresh() {
        mProfilesContainer.setVisible(false);
        ThreadUtils.postOnBackgroundThread(
                () -> {
                    mAdditionalInvisibleProfiles.set(
+9 −10
Original line number Diff line number Diff line
@@ -19,7 +19,6 @@ package com.android.settings.bluetooth;
import static android.media.Spatializer.SPATIALIZER_IMMERSIVE_LEVEL_NONE;

import android.app.settings.SettingsEnums;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.media.AudioDeviceAttributes;
import android.media.AudioDeviceInfo;
@@ -45,9 +44,6 @@ import com.android.settingslib.core.lifecycle.Lifecycle;
import com.android.settingslib.flags.Flags;
import com.android.settingslib.utils.ThreadUtils;

import com.google.common.collect.ImmutableSet;

import java.util.Set;
import java.util.concurrent.atomic.AtomicBoolean;

/**
@@ -58,6 +54,7 @@ public class BluetoothDetailsSpatialAudioController extends BluetoothDetailsCont

    private static final String TAG = "BluetoothSpatialAudioController";
    private static final String KEY_SPATIAL_AUDIO_GROUP = "spatial_audio_group";
    private static final String KEY_PROFILES_GROUP = "bluetooth_profiles";
    private static final String KEY_SPATIAL_AUDIO = "spatial_audio";
    private static final String KEY_HEAD_TRACKING = "head_tracking";

@@ -71,10 +68,6 @@ public class BluetoothDetailsSpatialAudioController extends BluetoothDetailsCont
    AtomicBoolean mHasHeadTracker = new AtomicBoolean(false);
    AtomicBoolean mInitialRefresh = new AtomicBoolean(true);

    public static final Set<Integer> SA_PROFILES =
            ImmutableSet.of(
                    BluetoothProfile.A2DP, BluetoothProfile.LE_AUDIO, BluetoothProfile.HEARING_AID);

    public BluetoothDetailsSpatialAudioController(
            Context context,
            PreferenceFragmentCompat fragment,
@@ -144,13 +137,17 @@ public class BluetoothDetailsSpatialAudioController extends BluetoothDetailsCont

    @Override
    public String getPreferenceKey() {
        if (com.android.settings.flags.Flags.enableBluetoothSettingsExpressiveDesignReadOnly()) {
            return KEY_PROFILES_GROUP;
        } else {
            return KEY_SPATIAL_AUDIO_GROUP;
        }
    }

    @Override
    protected void init(PreferenceScreen screen) {
        mProfilesContainer = screen.findPreference(getPreferenceKey());
        if (com.android.settings.flags.Flags.enableBluetoothSettingsExpressiveDesign()) {
        if (com.android.settings.flags.Flags.enableBluetoothSettingsExpressiveDesignReadOnly()) {
            mProfilesContainer.setLayoutResource(
                    com.android.settingslib.widget.theme.R.layout
                            .settingslib_expressive_preference_category_no_title);
@@ -243,6 +240,7 @@ public class BluetoothDetailsSpatialAudioController extends BluetoothDetailsCont
        pref.setTitle(context.getString(R.string.bluetooth_details_spatial_audio_title));
        pref.setSummary(context.getString(R.string.bluetooth_details_spatial_audio_summary));
        pref.setOnPreferenceClickListener(this);
        pref.setOrder(-2);
        return pref;
    }

@@ -253,6 +251,7 @@ public class BluetoothDetailsSpatialAudioController extends BluetoothDetailsCont
        pref.setTitle(context.getString(R.string.bluetooth_details_head_tracking_title));
        pref.setSummary(context.getString(R.string.bluetooth_details_head_tracking_summary));
        pref.setOnPreferenceClickListener(this);
        pref.setOrder(-1);
        return pref;
    }