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

Commit efb467a0 authored by William Escande's avatar William Escande
Browse files

BluetoothManagerService print ms in dumpsys

Dumpsys is currently only printing the seconds, but there can be a lot
of logs in 1 second.
Adding the millisecond will help us narrowing the search

Test: dumpsys bluetooth_manager
Change-Id: I15fb99a9b7b68a2dea42cf68918790c3e635fe89
parent 27b284ff
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -101,6 +101,9 @@ import java.io.FileDescriptor;
import java.io.FileOutputStream;
import java.io.PrintWriter;
import java.time.Duration;
import java.time.Instant;
import java.time.ZoneId;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.LinkedList;
@@ -242,8 +245,9 @@ public class BluetoothManagerService extends IBluetoothManager.Stub {
    private boolean mEnable;
    private boolean mShutdownInProgress = false;

    private static CharSequence timeToLog(long timestamp) {
        return android.text.format.DateFormat.format("MM-dd HH:mm:ss", timestamp);
    private static String timeToLog(long timestamp) {
        return DateTimeFormatter.ofPattern("MM-dd HH:mm:ss.SSS").withZone(ZoneId.systemDefault())
            .format(Instant.ofEpochMilli(timestamp));
    }

    /**