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

Commit 90a21bee authored by Hui Peng's avatar Hui Peng Committed by Gerrit Code Review
Browse files

Merge "[redact_log]Redact addresses java code of Bluetooth App"

parents 07d4b475 dd307fa8
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -146,6 +146,14 @@ public final class Utils {
                address[3], address[4], address[5]);
    }

    public static String getRedactedAddressStringFromByte(byte[] address) {
        if (address == null || address.length != BD_ADDR_LEN) {
            return null;
        }

        return String.format("XX:XX:XX:XX:%02X:%02X", address[4], address[5]);
    }

    public static byte[] getByteAddress(BluetoothDevice device) {
        return getBytesFromAddress(device.getAddress());
    }
+1 −1
Original line number Diff line number Diff line
@@ -374,7 +374,7 @@ public class A2dpSinkService extends ProfileService {
                    + ", InstanceMap start state: " + sb.toString());
        }
        if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
            Log.w(TAG, "Connection not allowed: <" + device.getAddress()
            Log.w(TAG, "Connection not allowed: <" + device
                    + "> is CONNECTION_POLICY_FORBIDDEN");
            return false;
        }
+1 −1
Original line number Diff line number Diff line
@@ -130,7 +130,7 @@ public class A2dpSinkStateMachine extends StateMachine {
     * @param sb output string
     */
    public void dump(StringBuilder sb) {
        ProfileService.println(sb, "mDevice: " + mDevice.getAddress() + "("
        ProfileService.println(sb, "mDevice: " + mDevice + "("
                + Utils.getName(mDevice) + ") " + this.toString());
    }

+5 −5
Original line number Diff line number Diff line
@@ -448,7 +448,7 @@ public class AvrcpBipClient {

    @Override
    public String toString() {
        return "<AvrcpBipClient" + " device=" + mDevice.getAddress() + " psm=" + mPsm
        return "<AvrcpBipClient" + " device=" + mDevice + " psm=" + mPsm
                + " state=" + getStateName() + ">";
    }

@@ -457,7 +457,7 @@ public class AvrcpBipClient {
     */
    private void debug(String msg) {
        if (DBG) {
            Log.d(TAG, "[" + mDevice.getAddress() + "] " + msg);
            Log.d(TAG, "[" + mDevice + "] " + msg);
        }
    }

@@ -465,17 +465,17 @@ public class AvrcpBipClient {
     * Print to warn
     */
    private void warn(String msg) {
        Log.w(TAG, "[" + mDevice.getAddress() + "] " + msg);
        Log.w(TAG, "[" + mDevice+ "] " + msg);
    }

    /**
     * Print to error
     */
    private void error(String msg) {
        Log.e(TAG, "[" + mDevice.getAddress() + "] " + msg);
        Log.e(TAG, "[" + mDevice + "] " + msg);
    }

    private void error(String msg, Throwable e) {
        Log.e(TAG, "[" + mDevice.getAddress() + "] " + msg, e);
        Log.e(TAG, "[" + mDevice + "] " + msg, e);
    }
}
+1 −1
Original line number Diff line number Diff line
@@ -251,7 +251,7 @@ class AvrcpControllerStateMachine extends StateMachine {
     * @param sb output string
     */
    public void dump(StringBuilder sb) {
        ProfileService.println(sb, "mDevice: " + mDevice.getAddress() + "("
        ProfileService.println(sb, "mDevice: " + mDevice + "("
                + Utils.getName(mDevice) + ") " + this.toString());
        ProfileService.println(sb, "isActive: " + isActive());
        ProfileService.println(sb, "Control: " + mRemoteControlConnected);
Loading