From 418d78f978aba58bad8b6770e0238942260ed153 Mon Sep 17 00:00:00 2001 From: SongFerngWang Date: Wed, 23 Mar 2022 02:42:34 +0800 Subject: [PATCH] [LE adudio] The condition of right location is wrong. 1. Fix the condition of right location. 2. If the location is left+right, showing the legacy battery style. Bug: 225800014 Test: build pass. local test. Change-Id: I03d1d7bfe26d52e0b69d24aec6bd3216350403a0 --- .../LeAudioBluetoothDetailsHeaderController.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/android/settings/bluetooth/LeAudioBluetoothDetailsHeaderController.java b/src/com/android/settings/bluetooth/LeAudioBluetoothDetailsHeaderController.java index 06cee852442..7b74f77806a 100644 --- a/src/com/android/settings/bluetooth/LeAudioBluetoothDetailsHeaderController.java +++ b/src/com/android/settings/bluetooth/LeAudioBluetoothDetailsHeaderController.java @@ -275,11 +275,15 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr return; } boolean isLeft = (deviceId & LEFT_DEVICE_ID) != 0; - boolean isRight = (deviceId & LEFT_DEVICE_ID) != 0; + boolean isRight = (deviceId & RIGHT_DEVICE_ID) != 0; boolean isLeftRight = isLeft && isRight; // The LE device updates the BatteryLayout if (isLeftRight) { - Log.d(TAG, "The device id is left+right. Do nothing."); + Log.d(TAG, "Show the legacy battery style if the device id is left+right."); + final TextView summary = mLayoutPreference.findViewById(R.id.entity_header_summary); + if (summary != null) { + summary.setText(mCachedDevice.getConnectionSummary()); + } } else if (isLeft) { updateBatteryLayout(getBatteryTitleResource(LEFT_DEVICE_ID), getBatterySummaryResource(LEFT_DEVICE_ID), cachedDevice.getBatteryLevel());