Add the battery information into device details header

Add the new LE audio header
Add the battery information
Update the condition for non-LE audio header

Bug: 218626547
Test: build pass and manualy test
Change-Id: Ib9f4c388c369dc374c43dd399111e02b5555159b
This commit is contained in:
SongFerngWang
2022-03-08 14:34:20 +08:00
parent faa0eddcc7
commit 57dd3bc444
6 changed files with 481 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
package com.android.settings.bluetooth;
import android.bluetooth.BluetoothProfile;
import android.content.Context;
import android.graphics.drawable.Drawable;
import android.text.TextUtils;
@@ -53,7 +54,10 @@ public class BluetoothDetailsHeaderController extends BluetoothDetailsController
@Override
public boolean isAvailable() {
return !Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice());
boolean hasLeAudio = mCachedDevice.getConnectableProfiles()
.stream()
.anyMatch(profile -> profile.getProfileId() == BluetoothProfile.LE_AUDIO);
return !Utils.isAdvancedDetailsHeader(mCachedDevice.getDevice()) && !hasLeAudio;
}
@Override