Remove duplicate dump method.

Switch to TimeUtils.dumpTime since it does the exact same thing as
the one in TareUtils, which allows us to remove an object that was
only used for log dumps.

Bug: 239951405
Test: adb shell dumpsys tare
Change-Id: I4327fab589b79c77a5987505e64371d8b8368254
This commit is contained in:
Kweku Adams
2022-07-27 17:46:38 +00:00
parent 826ebae0c5
commit ffd77c6453
2 changed files with 1 additions and 12 deletions

View File

@@ -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.NonNull;

View File

@@ -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();
}