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

Commit 32a92489 authored by Pavlin Radoslavov's avatar Pavlin Radoslavov
Browse files

Enable debug logs for Bluetooth AdapterService

Enabled log messages that are useful to debug the AdapterService state.
Remaining log messages are controlled by AdapterService.VERBOSE flag
and are disabled by default.

Bug: 31442739
Test: manual, and "frameworks/base/core/tests/bluetoothtests" unit tests
Change-Id: I7d81fd605f64e64f29aee37314821384234b286d
parent c536e600
Loading
Loading
Loading
Loading
+14 −8
Original line number Diff line number Diff line
@@ -86,7 +86,8 @@ import java.util.List;

public class AdapterService extends Service {
    private static final String TAG = "BluetoothAdapterService";
    private static final boolean DBG = false;
    private static final boolean DBG = true;
    private static final boolean VERBOSE = false;
    private static final boolean TRACE_REF = false;
    private static final int MIN_ADVT_INSTANCES_FOR_MA = 5;
    private static final int MIN_OFFLOADED_FILTERS = 10;
@@ -2379,9 +2380,10 @@ public class AdapterService extends Service {
            }
        }

        debugLog("energyInfoCallback() status = " + status +
        verboseLog("energyInfoCallback() status = " + status +
                   "tx_time = " + tx_time + "rx_time = " + rx_time +
                "idle_time = " + idle_time + "energy_used = " + energy_used +
                   "idle_time = " + idle_time +
                   "energy_used = " + energy_used +
                   "ctrl_state = " + ctrl_state +
                   "traffic = " + Arrays.toString(data));
    }
@@ -2429,7 +2431,7 @@ public class AdapterService extends Service {
        enforceCallingOrSelfPermission(android.Manifest.permission.DUMP, TAG);

        if (args.length > 0) {
            debugLog("dumpsys arguments, check for protobuf output: "
            verboseLog("dumpsys arguments, check for protobuf output: "
                       + TextUtils.join(" ", args));
            if (args[0].startsWith("--proto")) {
                if (args[0].equals("--proto-java-bin")) {
@@ -2498,6 +2500,10 @@ public class AdapterService extends Service {
        if (DBG) Log.d(TAG, msg);
    }

    private void verboseLog(String msg) {
        if (VERBOSE) Log.v(TAG, msg);
    }

    private void errorLog(String msg) {
        Log.e(TAG, msg);
    }