Merge "[LE adudio] The condition of right location is wrong." am: 75869b5fef

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2037423

Change-Id: I98125699c5fe13fe7acbd7668be1e12b6bcedcd6
This commit is contained in:
SongFerng Wang
2022-03-23 02:11:19 +00:00
committed by Automerger Merge Worker

View File

@@ -275,11 +275,15 @@ public class LeAudioBluetoothDetailsHeaderController extends BasePreferenceContr
return; return;
} }
boolean isLeft = (deviceId & LEFT_DEVICE_ID) != 0; 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; boolean isLeftRight = isLeft && isRight;
// The LE device updates the BatteryLayout // The LE device updates the BatteryLayout
if (isLeftRight) { 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) { } else if (isLeft) {
updateBatteryLayout(getBatteryTitleResource(LEFT_DEVICE_ID), updateBatteryLayout(getBatteryTitleResource(LEFT_DEVICE_ID),
getBatterySummaryResource(LEFT_DEVICE_ID), cachedDevice.getBatteryLevel()); getBatterySummaryResource(LEFT_DEVICE_ID), cachedDevice.getBatteryLevel());