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

Commit 2e06ef25 authored by Ajay Panicker's avatar Ajay Panicker Committed by Gerrit Code Review
Browse files

Merge "Add enabled time to dump output"

parents 8a980761 14bc7705
Loading
Loading
Loading
Loading
+12 −2
Original line number Diff line number Diff line
@@ -96,6 +96,7 @@ public class AdapterService extends Service {
    private static final int MIN_OFFLOADED_SCAN_STORAGE_BYTES = 1024;
    //For Debugging only
    private static int sRefCount = 0;
    private long mBluetoothStartTime = 0;

    private int mStackReportedState;
    private int mTxTimeTotalMs;
@@ -1361,6 +1362,7 @@ public class AdapterService extends Service {
         mQuietmode = quietMode;
         Message m = mAdapterStateMachine.obtainMessage(AdapterState.BLE_TURN_ON);
         mAdapterStateMachine.sendMessage(m);
         mBluetoothStartTime = System.currentTimeMillis();
         return true;
     }

@@ -2112,11 +2114,19 @@ public class AdapterService extends Service {
            }
        }

        long onDuration = System.currentTimeMillis() - mBluetoothStartTime;
        String onDurationString = String.format("%02d:%02d:%02d.%03d",
                                      (int)(onDuration / (1000 * 60 * 60)),
                                      (int)((onDuration / (1000 * 60)) % 60),
                                      (int)((onDuration / 1000) % 60),
                                      (int)(onDuration % 1000));

        writer.println("Bluetooth Status");
        writer.println("  enabled: " + isEnabled());
        writer.println("  state: " + getState());
        writer.println("  address: " + getAddress());
        writer.println("  name: " + getName() + "\n");
        writer.println("  name: " + getName());
        writer.println("  time since enabled: " + onDurationString + "\n");

        writer.println("Bonded devices:");
        for (BluetoothDevice device : getBondedDevices()) {