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

Commit e8593771 authored by Sal Savage's avatar Sal Savage
Browse files

Refactor HFP AG logging to be unguarded

With the recent addition of a process minimum default log level, the
Android Log framework will now enforce the set log level against the
various log invocations we make in code. We no longer need to guard log
invocations on our own.

Tag: #refactor
Flag: EXEMPT, logging only change
Bug: 315046089
Test: atest BluetoothInstrumentationTests
Change-Id: I2cdc3b013c79152b4cb299416a624d6ea73ac69f
parent d56b2fbe
Loading
Loading
Loading
Loading
+2 −7
Original line number Diff line number Diff line
@@ -47,7 +47,6 @@ import java.util.HashMap;
 */
public class AtPhonebook {
    private static final String TAG = "BluetoothAtPhonebook";
    private static final boolean DBG = false;

    /** The projection to use when querying the call log database in response
     *  to AT+CPBR for the MC, RC, and DC phone books (missed, received, and
@@ -257,9 +256,7 @@ public class AtPhonebook {
                    pb = pb.substring(1, pb.length());
                }
                if (getPhonebookResult(pb, false) == null && !"SM".equals(pb)) {
                    if (DBG) {
                    Log.d(TAG, "Dont know phonebook: '" + pb + "'");
                    }
                    atCommandErrorCode = BluetoothCmeError.OPERATION_NOT_ALLOWED;
                    break;
                }
@@ -565,10 +562,8 @@ public class AtPhonebook {
                    c.close();
                }
                if (name == null) {
                    if (DBG) {
                    Log.d(TAG, "Caller ID lookup failed for " + number);
                }
                }

            } else if (pbr.nameColumn != -1) {
                name = pbr.cursor.getString(pbr.nameColumn);
+1 −4
Original line number Diff line number Diff line
@@ -107,7 +107,6 @@ import java.util.concurrent.FutureTask;
 */
public class HeadsetService extends ProfileService {
    private static final String TAG = "HeadsetService";
    private static final boolean DBG = false;

    /**
     * HFP AG owned/managed components
@@ -2430,10 +2429,8 @@ public class HeadsetService extends ProfileService {
    }

    private static void logD(String message) {
        if (DBG) {
        Log.d(TAG, message);
    }
    }

    private Handler getStateMachinesThreadHandler() {
        if (mStateMachinesThreadHandler == null) {
+1 −4
Original line number Diff line number Diff line
@@ -86,7 +86,6 @@ import java.util.Scanner;
@VisibleForTesting
public class HeadsetStateMachine extends StateMachine {
    private static final String TAG = "HeadsetStateMachine";
    private static final boolean DBG = true;

    static final int CONNECT = 1;
    static final int DISCONNECT = 2;
@@ -2584,10 +2583,8 @@ public class HeadsetStateMachine extends StateMachine {

    @Override
    protected void log(String msg) {
        if (DBG) {
        super.log(msg);
    }
    }

    @Override
    protected String getLogRecString(Message msg) {