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

Commit 5dd68063 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Follow error prone recommendation" into tm-mainline-prod

parents 325b36e5 6134f7c0
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -845,5 +845,8 @@ public final class BluetoothSocket implements Closeable {
        return ret;
    }


    @Override
    public String toString() {
        return BluetoothUtils.toAnonymizedAddress(mAddress);
    }
}
+12 −0
Original line number Diff line number Diff line
@@ -175,4 +175,16 @@ public final class BluetoothUtils {
        }
        return result;
    }

    /**
     * Convert an address to an obfuscate one for logging purpose
     * @param address Mac address to be log
     * @return Loggable mac address
     */
    public static String toAnonymizedAddress(String address) {
        if (address == null || address.length() != 17) {
            return null;
        }
        return "XX:XX:XX" + address.substring(8);
    }
}