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

Commit 042ec817 authored by Marie Janssen's avatar Marie Janssen Committed by android-build-merger
Browse files

Merge "Move state dumpsys (to BluetoothManagerService)"

am: 308a4357

Change-Id: Ic42adca7615a1992919392cdef45c782fbc94091
parents 3769af8c 308a4357
Loading
Loading
Loading
Loading
+0 −36
Original line number Original line Diff line number Diff line
@@ -2552,28 +2552,6 @@ public class AdapterService extends Service {
        return getResources().getInteger(R.integer.config_bluetooth_operating_voltage_mv) / 1000.0;
        return getResources().getInteger(R.integer.config_bluetooth_operating_voltage_mv) / 1000.0;
    }
    }


    private String getStateString() {
        int state = getState();
        switch (state) {
            case BluetoothAdapter.STATE_OFF:
                return "STATE_OFF";
            case BluetoothAdapter.STATE_TURNING_ON:
                return "STATE_TURNING_ON";
            case BluetoothAdapter.STATE_ON:
                return "STATE_ON";
            case BluetoothAdapter.STATE_TURNING_OFF:
                return "STATE_TURNING_OFF";
            case BluetoothAdapter.STATE_BLE_TURNING_ON:
                return "STATE_BLE_TURNING_ON";
            case BluetoothAdapter.STATE_BLE_ON:
                return "STATE_BLE_ON";
            case BluetoothAdapter.STATE_BLE_TURNING_OFF:
                return "STATE_BLE_TURNING_OFF";
            default:
                return "UNKNOWN STATE: " + state;
        }
    }

    @Override
    @Override
    protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
    protected void dump(FileDescriptor fd, PrintWriter writer, String[] args) {
        enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
        enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);
@@ -2591,20 +2569,6 @@ 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: " + getStateString());
        writer.println("  address: " + getAddress());
        writer.println("  name: " + getName());
        writer.println("  time since enabled: " + onDurationString + "\n");

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