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

Commit 59d41972 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove duplicate dump method."

parents d3b6b5c5 ffd77c64
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -17,9 +17,9 @@
package com.android.server.tare;

import static android.text.format.DateUtils.HOUR_IN_MILLIS;
import static android.util.TimeUtils.dumpTime;

import static com.android.server.tare.TareUtils.cakeToString;
import static com.android.server.tare.TareUtils.dumpTime;
import static com.android.server.tare.TareUtils.getCurrentTimeMillis;

import android.annotation.CurrentTimeMillisLong;
+0 −11
Original line number Diff line number Diff line
@@ -19,26 +19,15 @@ package com.android.server.tare;
import static android.app.tare.EconomyManager.CAKE_IN_ARC;

import android.annotation.NonNull;
import android.annotation.SuppressLint;
import android.util.IndentingPrintWriter;

import com.android.internal.annotations.VisibleForTesting;

import java.text.SimpleDateFormat;
import java.time.Clock;

class TareUtils {
    @SuppressLint("SimpleDateFormat")
    private static final SimpleDateFormat sDumpDateFormat =
            new SimpleDateFormat("yyyy-MM-dd HH:mm:ss.SSS");

    @VisibleForTesting
    static Clock sSystemClock = Clock.systemUTC();

    static void dumpTime(IndentingPrintWriter pw, long time) {
        pw.print(sDumpDateFormat.format(time));
    }

    static long getCurrentTimeMillis() {
        return sSystemClock.millis();
    }