Merge "Hide ambient control when there's no valid control point" into main

This commit is contained in:
Angela Wang
2025-02-06 09:17:37 -08:00
committed by Android (Google) Code Review
2 changed files with 48 additions and 8 deletions

View File

@@ -129,8 +129,11 @@ public class BluetoothDetailsAmbientVolumePreferenceController extends Bluetooth
@Override
public boolean isAvailable() {
return mCachedDevice.isHearingDevice() && mCachedDevice.getProfiles().stream().anyMatch(
profile -> profile instanceof VolumeControlProfile);
return mCachedDevice.isHearingDevice()
&& mCachedDevice.getProfiles().stream().anyMatch(
profile -> profile instanceof VolumeControlProfile)
&& mAmbientUiController != null
&& mAmbientUiController.isAmbientControlAvailable();
}
@Nullable