Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 42944508 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Make Settings battery entries support dock charging" into tm-qpr-dev...

Merge "Make Settings battery entries support dock charging" into tm-qpr-dev am: 80e36dbb am: 4f2dfc5c

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/18527310



Change-Id: I89708a75f6c3139b22a9cf7322498ba4f0d157e0
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents 1ac98b30 4f2dfc5c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1134,6 +1134,8 @@
    <string name="battery_info_status_charging_slow">Charging slowly</string>
    <!-- [CHAR_LIMIT=20] Battery use screen.  Battery status shown in chart label when charging wirelessly.  -->
    <string name="battery_info_status_charging_wireless">Charging wirelessly</string>
    <!-- [CHAR_LIMIT=20] Battery use screen.  Battery status shown in chart label when the device is dock charging.  -->
    <string name="battery_info_status_charging_dock">Charging Dock</string>
    <!-- Battery Info screen. Value for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
    <string name="battery_info_status_discharging">Not charging</string>
    <!-- Battery Info screen. Value for a status item. A state which device is connected with any charger(e.g. USB, Adapter or Wireless) but not charging yet. Used for diagnostic info screens, precise translation isn't needed -->
+2 −0
Original line number Diff line number Diff line
@@ -239,6 +239,8 @@ public class Utils {
                            statusString = res.getString(R.string.battery_info_status_charging);
                            break;
                    }
                } else if (batteryStatus.isPluggedInDock()) {
                    statusString = res.getString(R.string.battery_info_status_charging_dock);
                } else {
                    statusString = res.getString(R.string.battery_info_status_charging_wireless);
                }
+11 −0
Original line number Diff line number Diff line
@@ -364,6 +364,17 @@ public class UtilsTest {
                resources.getString(R.string.battery_info_status_charging));
    }

    @Test
    public void getBatteryStatus_chargingDock_returnDockChargingString() {
        final Intent intent = new Intent();
        intent.putExtra(BatteryManager.EXTRA_STATUS, BatteryManager.BATTERY_STATUS_CHARGING);
        intent.putExtra(BatteryManager.EXTRA_PLUGGED, BatteryManager.BATTERY_PLUGGED_DOCK);
        final Resources resources = mContext.getResources();

        assertThat(Utils.getBatteryStatus(mContext, intent, /* compactStatus= */ false)).isEqualTo(
                resources.getString(R.string.battery_info_status_charging_dock));
    }

    @Test
    public void getBatteryStatus_chargingWireless_returnWirelessChargingString() {
        final Intent intent = new Intent();