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

Commit a5c37ace authored by Luofan Chen's avatar Luofan Chen
Browse files

health: Rename msToUTCString to msToHMSString

Change-Id: I1d8a28eee49056e73917c052180fd7328eb7fbd5
parent 436d7503
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -35,13 +35,13 @@ public class Util {
    }

    /**
     * Convert seconds of the day to a string in the format "hh:mm:ss".
     * in UTC.
     * Convert milliseconds to a string in the format "HH:mm:ss".
     *
     * @param ms milliseconds from epoch
     * @return formatted time string in UTC time zone
     * @param ms time in milliseconds, should be less than
     *           ${@link android.text.format.DateUtils#DAY_IN_MILLIS}
     * @return formatted time string in the format "HH:mm:ss"
     */
    static public String msToUTCString(long ms) {
    static public String msToHMSString(long ms) {
        final SimpleDateFormat dateFormat = new SimpleDateFormat("HH:mm:ss");
        Calendar calendar = Calendar.getInstance();
        dateFormat.setTimeZone(TimeZone.getTimeZone("UTC"));
+4 −4
Original line number Diff line number Diff line
@@ -10,7 +10,7 @@ import static lineageos.health.HealthInterface.MODE_LIMIT;
import static lineageos.health.HealthInterface.MODE_MANUAL;

import static org.lineageos.platform.internal.health.Util.msToString;
import static org.lineageos.platform.internal.health.Util.msToUTCString;
import static org.lineageos.platform.internal.health.Util.msToHMSString;

import android.content.Context;
import android.content.Intent;
@@ -143,10 +143,10 @@ public class Toggle extends ChargingControlProvider {
                        BatteryStatsManager.class)).getBatteryUsageStats();
        long remaining = batteryUsageStats.getChargeTimeRemainingMs();
        remaining += mChargingTimeMargin;
        Log.i(TAG, "Current estimated time to full: " + msToUTCString(remaining));
        Log.i(TAG, "Current estimated time to full: " + msToHMSString(remaining));

        long deltaTime = targetTime - currentTime;
        Log.i(TAG, "Current time to target: " + msToUTCString(deltaTime));
        Log.i(TAG, "Current time to target: " + msToHMSString(deltaTime));

        switch (stage) {
            case STAGE_NONE, STAGE_INITIAL -> {
@@ -244,7 +244,7 @@ public class Toggle extends ChargingControlProvider {
        pw.println("Provider: " + getClass().getName());
        pw.println("  mIsLimitSet: " + mIsLimitSet);
        pw.println("  mSavedTargetTime: " + msToString(mContext, mSavedTargetTime));
        pw.println("  mEstimatedFullTime: " + msToUTCString(mEstimatedFullTime));
        pw.println("  mEstimatedFullTime: " + msToHMSString(mEstimatedFullTime));
        pw.println("  mStage: " + mStage);
        pw.println("  mChargeLimitMargin: " + mChargingLimitMargin);
    }