Make bluetooth profile toggles configurable

BUG: 343317785
Test: atest BluetoothDetailsProfilesControllerTest
Flag: com.android.settings.flags.enable_bluetooth_device_details_polish
Change-Id: I5aea110f7a42ffee20a56dbd9d5621f44311cc66
This commit is contained in:
Haijie Hong
2024-09-05 14:19:35 +08:00
parent a73545d878
commit cd7627c9ff
7 changed files with 115 additions and 32 deletions

View File

@@ -419,12 +419,16 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
@Override
protected List<AbstractPreferenceController> createPreferenceControllers(Context context) {
List<String> invisibleProfiles = List.of();
if (Flags.enableBluetoothDeviceDetailsPolish()) {
mFormatter =
FeatureFactory.getFeatureFactory()
.getBluetoothFeatureProvider()
.getDeviceDetailsFragmentFormatter(
requireContext(), this, mBluetoothAdapter, mCachedDevice);
invisibleProfiles =
mFormatter.getInvisibleBluetoothProfiles(
FragmentTypeModel.DeviceDetailsMainFragment.INSTANCE);
}
ArrayList<AbstractPreferenceController> controllers = new ArrayList<>();
@@ -444,7 +448,7 @@ public class BluetoothDeviceDetailsFragment extends RestrictedDashboardFragment
controllers.add(new BluetoothDetailsSpatialAudioController(context, this, mCachedDevice,
lifecycle));
controllers.add(new BluetoothDetailsProfilesController(context, this, mManager,
mCachedDevice, lifecycle));
mCachedDevice, lifecycle, invisibleProfiles));
controllers.add(new BluetoothDetailsMacAddressController(context, this, mCachedDevice,
lifecycle));
controllers.add(new StylusDevicesController(context, mInputDevice, mCachedDevice,