Loading packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +11 −5 Original line number Diff line number Diff line Loading @@ -1789,7 +1789,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } else { int overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery, caseBattery})); Arrays.stream(new int[]{leftBattery, rightBattery})); if (overallBattery <= BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { overallBattery = caseBattery; } Log.d(TAG, "Acquired battery info from metadata for untethered device " + mDevice.getAnonymizedAddress() + " left earbud battery: " + leftBattery Loading Loading @@ -1895,7 +1898,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } int leftBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int rightBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int overallBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int singleBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; Set<BluetoothDevice> allDevices = Stream.concat( Loading @@ -1914,15 +1917,18 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> // We should expect only one device assign to one side, but if it happens, // we don't care which one. if (isLeftRight) { overallBattery = battery; singleBattery = battery; } else if (isLeft) { leftBattery = battery; } else if (isRight) { rightBattery = battery; } } overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery, overallBattery})); int overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery})); if (overallBattery <= BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { overallBattery = singleBattery; } Log.d(TAG, "Acquired battery info from Bluetooth service for le audio device " + mDevice.getAnonymizedAddress() Loading Loading
packages/SettingsLib/src/com/android/settingslib/bluetooth/CachedBluetoothDevice.java +11 −5 Original line number Diff line number Diff line Loading @@ -1789,7 +1789,10 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } else { int overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery, caseBattery})); Arrays.stream(new int[]{leftBattery, rightBattery})); if (overallBattery <= BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { overallBattery = caseBattery; } Log.d(TAG, "Acquired battery info from metadata for untethered device " + mDevice.getAnonymizedAddress() + " left earbud battery: " + leftBattery Loading Loading @@ -1895,7 +1898,7 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> } int leftBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int rightBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int overallBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; int singleBattery = BluetoothDevice.BATTERY_LEVEL_UNKNOWN; Set<BluetoothDevice> allDevices = Stream.concat( Loading @@ -1914,15 +1917,18 @@ public class CachedBluetoothDevice implements Comparable<CachedBluetoothDevice> // We should expect only one device assign to one side, but if it happens, // we don't care which one. if (isLeftRight) { overallBattery = battery; singleBattery = battery; } else if (isLeft) { leftBattery = battery; } else if (isRight) { rightBattery = battery; } } overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery, overallBattery})); int overallBattery = getMinBatteryLevels( Arrays.stream(new int[]{leftBattery, rightBattery})); if (overallBattery <= BluetoothDevice.BATTERY_LEVEL_UNKNOWN) { overallBattery = singleBattery; } Log.d(TAG, "Acquired battery info from Bluetooth service for le audio device " + mDevice.getAnonymizedAddress() Loading