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

Commit 97746811 authored by Neil Fuller's avatar Neil Fuller
Browse files

Convert last user of Time.format() to an alt.

Convert last frameworks/base/ user of
android.text.format.Time.format("%Y-%m-%d %H:%M:%S")
to use calculations based on java.time instead. This avoids future
Y2038 issues associated with Time.

Bug: 16550209
Test: build / boot / treehugger
Change-Id: I3843450350c26505211a2788c4ed114e30403fa8
parent 3628bb3a
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -211,7 +211,7 @@ import android.service.voice.VoiceInteractionManagerInternal;
import android.sysprop.DisplayProperties;
import android.sysprop.DisplayProperties;
import android.telecom.TelecomManager;
import android.telecom.TelecomManager;
import android.text.TextUtils;
import android.text.TextUtils;
import android.text.format.Time;
import android.text.format.TimeMigrationUtils;
import android.util.ArrayMap;
import android.util.ArrayMap;
import android.util.EventLog;
import android.util.EventLog;
import android.util.Log;
import android.util.Log;
@@ -5878,9 +5878,9 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub {
                tracesFile = File.createTempFile("app_slow", null, tracesDir);
                tracesFile = File.createTempFile("app_slow", null, tracesDir);


                StringBuilder sb = new StringBuilder();
                StringBuilder sb = new StringBuilder();
                Time tobj = new Time();
                String timeString =
                tobj.set(System.currentTimeMillis());
                        TimeMigrationUtils.formatMillisWithFixedFormat(System.currentTimeMillis());
                sb.append(tobj.format("%Y-%m-%d %H:%M:%S"));
                sb.append(timeString);
                sb.append(": ");
                sb.append(": ");
                TimeUtils.formatDuration(SystemClock.uptimeMillis()-startTime, sb);
                TimeUtils.formatDuration(SystemClock.uptimeMillis()-startTime, sb);
                sb.append(" since ");
                sb.append(" since ");