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

Commit acdd448f authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Obfuscate address logging in GattService and a few other files" into main

parents 46836fa7 04942915
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@

package com.android.bluetooth.btservice;

import android.bluetooth.BluetoothUtils;
import android.util.Log;

/**
@@ -62,7 +63,12 @@ public class InteropUtil {
            return false;
        }

        Log.d(TAG, "interopMatchAddr: feature=" + feature.name() + ", address=" + address);
        Log.d(
                TAG,
                "interopMatchAddr: feature="
                        + feature.name()
                        + ", address="
                        + BluetoothUtils.toAnonymizedAddress(address));
        if (address == null) {
            return false;
        }
@@ -121,7 +127,12 @@ public class InteropUtil {
            return false;
        }

        Log.d(TAG, "interopMatchAddrOrName: feature=" + feature.name() + ", address=" + address);
        Log.d(
                TAG,
                "interopMatchAddrOrName: feature="
                        + feature.name()
                        + ", address="
                        + BluetoothUtils.toAnonymizedAddress(address));
        if (address == null) {
            return false;
        }
@@ -156,7 +167,7 @@ public class InteropUtil {
                "interopDatabaseAddAddr: feature="
                        + feature.name()
                        + ", address="
                        + address
                        + BluetoothUtils.toAnonymizedAddress(address)
                        + ", length="
                        + length);
        if (address == null || (length <= 0 || length > 6)) {
@@ -184,7 +195,12 @@ public class InteropUtil {
            return;
        }

        Log.d(TAG, "interopDatabaseRemoveAddr: feature=" + feature.name() + ", address=" + address);
        Log.d(
                TAG,
                "interopDatabaseRemoveAddr: feature="
                        + feature.name()
                        + ", address="
                        + BluetoothUtils.toAnonymizedAddress(address));
        if (address == null) {
            return;
        }
+2 −1
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.bluetooth.BluetoothManager;
import android.bluetooth.BluetoothProfile;
import android.bluetooth.BluetoothProtoEnums;
import android.bluetooth.BluetoothSinkAudioPolicy;
import android.bluetooth.BluetoothUtils;
import android.bluetooth.IBluetoothConnectionCallback;
import android.content.Context;
import android.content.Intent;
@@ -183,7 +184,7 @@ public class RemoteDevices {

                        debugLog(
                                "reset(): address="
                                        + address
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + ", connected="
                                        + bluetoothDevice.isConnected());

+219 −64

File changed.

Preview size limit exceeded, changes collapsed.

+2 −1
Original line number Diff line number Diff line
@@ -28,6 +28,7 @@ import android.app.AppOpsManager;
import android.app.PendingIntent;
import android.bluetooth.BluetoothAdapter;
import android.bluetooth.BluetoothDevice;
import android.bluetooth.BluetoothUtils;
import android.bluetooth.le.BluetoothLeScanner;
import android.bluetooth.le.IPeriodicAdvertisingCallback;
import android.bluetooth.le.IScannerCallback;
@@ -342,7 +343,7 @@ public class TransitionalScanHelper {
                        + ", addressType="
                        + addressType
                        + ", address="
                        + address
                        + BluetoothUtils.toAnonymizedAddress(address)
                        + ", primaryPhy="
                        + primaryPhy
                        + ", secondaryPhy="
+36 −8
Original line number Diff line number Diff line
@@ -299,7 +299,8 @@ public final class BluetoothGatt implements BluetoothProfile {
                                TAG,
                                "onPhyUpdate() -"
                                        + (" status=" + status)
                                        + (" address=" + address)
                                        + (" address="
                                                + BluetoothUtils.toAnonymizedAddress(address))
                                        + (" txPhy=" + txPhy)
                                        + (" rxPhy=" + rxPhy));
                    }
@@ -332,7 +333,8 @@ public final class BluetoothGatt implements BluetoothProfile {
                                TAG,
                                "onPhyRead() -"
                                        + (" status=" + status)
                                        + (" address=" + address)
                                        + (" address="
                                                + BluetoothUtils.toAnonymizedAddress(address))
                                        + (" txPhy=" + txPhy)
                                        + (" rxPhy=" + rxPhy));
                    }
@@ -414,7 +416,12 @@ public final class BluetoothGatt implements BluetoothProfile {
                public void onSearchComplete(
                        String address, List<BluetoothGattService> services, int status) {
                    if (DBG) {
                        Log.d(TAG, "onSearchComplete() = Device=" + address + " Status=" + status);
                        Log.d(
                                TAG,
                                "onSearchComplete() = address="
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + " status="
                                        + status);
                    }
                    if (!address.equals(mDevice.getAddress())) {
                        return;
@@ -613,8 +620,14 @@ public final class BluetoothGatt implements BluetoothProfile {
                 */
                @Override
                public void onNotify(String address, int handle, byte[] value) {
                    if (VDBG) Log.d(TAG, "onNotify() - Device=" + address + " handle=" + handle);

                    if (VDBG) {
                        Log.d(
                                TAG,
                                "onNotify() - address="
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + " handle="
                                        + handle);
                    }
                    if (!address.equals(mDevice.getAddress())) {
                        return;
                    }
@@ -646,7 +659,12 @@ public final class BluetoothGatt implements BluetoothProfile {
                @SuppressLint("AndroidFrameworkRequiresPermission")
                public void onDescriptorRead(String address, int status, int handle, byte[] value) {
                    if (VDBG) {
                        Log.d(TAG, "onDescriptorRead() - Device=" + address + " handle=" + handle);
                        Log.d(
                                TAG,
                                "onDescriptorRead() - address="
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + " handle="
                                        + handle);
                    }

                    if (!address.equals(mDevice.getAddress())) {
@@ -703,7 +721,12 @@ public final class BluetoothGatt implements BluetoothProfile {
                public void onDescriptorWrite(
                        String address, int status, int handle, byte[] value) {
                    if (VDBG) {
                        Log.d(TAG, "onDescriptorWrite() - Device=" + address + " handle=" + handle);
                        Log.d(
                                TAG,
                                "onDescriptorWrite() - address="
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + " handle="
                                        + handle);
                    }

                    if (!address.equals(mDevice.getAddress())) {
@@ -757,7 +780,12 @@ public final class BluetoothGatt implements BluetoothProfile {
                @Override
                public void onExecuteWrite(String address, int status) {
                    if (VDBG) {
                        Log.d(TAG, "onExecuteWrite() - Device=" + address + " status=" + status);
                        Log.d(
                                TAG,
                                "onExecuteWrite() - address="
                                        + BluetoothUtils.toAnonymizedAddress(address)
                                        + " status="
                                        + status);
                    }
                    if (!address.equals(mDevice.getAddress())) {
                        return;
Loading