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

Commit 761c81b1 authored by Hui Peng's avatar Hui Peng
Browse files

Replace log statements in BluetoothDevice

Test: refactoring CL. Existing unit tests still pass
Bug: 174487588
Tag: #security
Change-Id: I433b67795ee1e9d177f30604dc42e01c1c89ddda
parent bcdae181
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -1472,7 +1472,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
     * @return Bluetooth hardware address as string
     */
    public String getAddress() {
        if (DBG) Log.d(TAG, "mAddress: " + mAddress);
        if (DBG) Log.d(TAG, "getAddress: mAddress=" + getAddressForLogging());
        return mAddress;
    }

@@ -1885,7 +1885,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
            Log.e(TAG, "BT not enabled. Cannot cancel Remote Device bond");
            if (DBG) log(Log.getStackTraceString(new Throwable()));
        } else {
            Log.i(TAG, "cancelBondProcess() for device " + getAddress()
            Log.i(TAG, "cancelBondProcess() for device " + toStringForLogging()
                    + " called by pid: " + Process.myPid()
                    + " tid: " + Process.myTid());
            try {
@@ -1918,7 +1918,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
            Log.e(TAG, "BT not enabled. Cannot remove Remote Device bond");
            if (DBG) log(Log.getStackTraceString(new Throwable()));
        } else {
            Log.i(TAG, "removeBond() for device " + getAddress()
            Log.i(TAG, "removeBond() for device " + toStringForLogging()
                    + " called by pid: " + Process.myPid()
                    + " tid: " + Process.myTid());
            try {
@@ -1963,7 +1963,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
                    AttributionSource source = pairQuery.second.first;
                    BluetoothDevice device = pairQuery.second.second;
                    if (DBG) {
                        log("getBondState(" + device.getAnonymizedAddress() + ") uncached");
                        log("getBondState(" + device.toStringForLogging() + ") uncached");
                    }
                    try {
                        final SynchronousResultReceiver<Integer> recv =
@@ -2005,7 +2005,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
    @RequiresBluetoothConnectPermission
    @RequiresPermission(android.Manifest.permission.BLUETOOTH_CONNECT)
    public int getBondState() {
        if (DBG) log("getBondState(" + getAnonymizedAddress() + ")");
        if (DBG) log("getBondState(" + toStringForLogging() + ")");
        final IBluetooth service = getService();
        if (service == null) {
            Log.e(TAG, "BT not enabled. Cannot get bond state");
@@ -2039,7 +2039,7 @@ public final class BluetoothDevice implements Parcelable, Attributable {
            android.Manifest.permission.BLUETOOTH_PRIVILEGED,
    })
    public boolean canBondWithoutDialog() {
        if (DBG) log("canBondWithoutDialog, device: " + this);
        if (DBG) log("canBondWithoutDialog, device: " + toStringForLogging());
        final IBluetooth service = getService();
        final boolean defaultValue = false;
        if (service == null || !isBluetoothEnabled()) {