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

Commit 0a269dfe authored by Michael Bestas's avatar Michael Bestas Committed by LuK1337
Browse files

fixup! BatteryService: Add support for battery Moto Mods

Change-Id: If1171bd9ec8972a489db0540889690ae4f9a5d3b
parent ff380f86
Loading
Loading
Loading
Loading
+3 −12
Original line number Diff line number Diff line
@@ -498,7 +498,7 @@ public final class BatteryService extends SystemService {
        traceEnd();
    }

    private static int plugType(HealthInfo healthInfo) {
    private int plugType(HealthInfo healthInfo) {
        if (healthInfo.chargerAcOnline) {
            return BatteryManager.BATTERY_PLUGGED_AC;
        } else if (healthInfo.chargerUsbOnline) {
@@ -507,6 +507,8 @@ public final class BatteryService extends SystemService {
            return BatteryManager.BATTERY_PLUGGED_WIRELESS;
        } else if (healthInfo.chargerDockOnline) {
            return BatteryManager.BATTERY_PLUGGED_DOCK;
        } else if (supplementalOrEmergencyModOnline()) {
            return BatteryManager.BATTERY_PLUGGED_MOD;
        } else {
            return BATTERY_PLUGGED_NONE;
        }
@@ -520,17 +522,6 @@ public final class BatteryService extends SystemService {
            mHealthInfo.batteryStatus != BatteryManager.BATTERY_STATUS_UNKNOWN
            && mHealthInfo.batteryLevel <= mCriticalBatteryLevel;
        mPlugType = plugType(mHealthInfo);
        if (mHealthInfo.chargerAcOnline) {
            mPlugType = BatteryManager.BATTERY_PLUGGED_AC;
        } else if (mHealthInfo.chargerUsbOnline) {
            mPlugType = BatteryManager.BATTERY_PLUGGED_USB;
        } else if (mHealthInfo.chargerWirelessOnline) {
            mPlugType = BatteryManager.BATTERY_PLUGGED_WIRELESS;
        } else if (supplementalOrEmergencyModOnline()) {
            mPlugType = BatteryManager.BATTERY_PLUGGED_MOD;
        } else {
            mPlugType = BATTERY_PLUGGED_NONE;
        }

        if (DEBUG) {
            Slog.d(TAG, "Processing new values: "