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

Commit fafff1b1 authored by Sal Savage's avatar Sal Savage Committed by Automerger Merge Worker
Browse files

Merge "Don't add the contents of dump() to our log messages" into main am:...

Merge "Don't add the contents of dump() to our log messages" into main am: c42f22ce am: d77d7c4f

Original change: https://android-review.googlesource.com/c/platform/packages/modules/Bluetooth/+/2907655



Change-Id: I25d1737ae032f4ac49aa871b5c2b5b262129bd56
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents e110fac8 d77d7c4f
Loading
Loading
Loading
Loading
+11 −33
Original line number Diff line number Diff line
@@ -58,7 +58,8 @@ public class MapClientService extends ProfileService {

    static final int MAXIMUM_CONNECTED_DEVICES = 4;

    private Map<BluetoothDevice, MceStateMachine> mMapInstanceMap = new ConcurrentHashMap<>(1);
    private final Map<BluetoothDevice, MceStateMachine> mMapInstanceMap =
            new ConcurrentHashMap<>(1);
    private MnsService mMnsServer;

    private AdapterService mAdapterService;
@@ -123,10 +124,7 @@ public class MapClientService extends ProfileService {
            throw new IllegalArgumentException("Null device");
        }
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "MAP connect device: " + device
                    + ", InstanceMap start state: " + sb.toString());
            Log.d(TAG, "connect(device= " + device + "): devices=" + mMapInstanceMap.keySet());
        }
        if (getConnectionPolicy(device) == BluetoothProfile.CONNECTION_POLICY_FORBIDDEN) {
            Log.w(TAG, "Connection not allowed: <" + device.getAddress()
@@ -172,10 +170,7 @@ public class MapClientService extends ProfileService {

        addDeviceToMapAndConnect(device);
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "MAP connect device: " + device
                    + ", InstanceMap end state: " + sb.toString());
            Log.d(TAG, "connect(device= " + device + "): end devices=" + mMapInstanceMap.keySet());
        }
        return true;
    }
@@ -194,10 +189,7 @@ public class MapClientService extends ProfileService {
        enforceCallingOrSelfPermission(BLUETOOTH_PRIVILEGED,
                "Need BLUETOOTH_PRIVILEGED permission");
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "MAP disconnect device: " + device
                    + ", InstanceMap start state: " + sb.toString());
            Log.d(TAG, "disconnect(device= " + device + "): devices=" + mMapInstanceMap.keySet());
        }
        MceStateMachine mapStateMachine = mMapInstanceMap.get(device);
        // a map state machine instance doesn't exist. maybe it is already gone?
@@ -211,10 +203,8 @@ public class MapClientService extends ProfileService {
        }
        mapStateMachine.disconnect();
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "MAP disconnect device: " + device
                    + ", InstanceMap start state: " + sb.toString());
            Log.d(TAG, "disconnect(device= " + device + "): end devices="
                    + mMapInstanceMap.keySet());
        }
        return true;
    }
@@ -381,10 +371,7 @@ public class MapClientService extends ProfileService {
    @VisibleForTesting
    public void cleanupDevice(BluetoothDevice device, MceStateMachine sm) {
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "Cleanup device: " + device + ", InstanceMap start state: "
                    + sb.toString());
            Log.d(TAG, "cleanup(device= " + device + "): devices=" + mMapInstanceMap.keySet());
        }
        synchronized (mMapInstanceMap) {
            MceStateMachine stateMachine = mMapInstanceMap.get(device);
@@ -398,20 +385,14 @@ public class MapClientService extends ProfileService {
            }
        }
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "Cleanup device: " + device + ", InstanceMap end state: "
                    + sb.toString());
            Log.d(TAG, "cleanup(device= " + device + "): end devices=" + mMapInstanceMap.keySet());
        }
    }

    @VisibleForTesting
    void removeUncleanAccounts() {
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "removeUncleanAccounts:InstanceMap end state: "
                    + sb.toString());
            Log.d(TAG, "removeUncleanAccounts(): devices=" + mMapInstanceMap.keySet());
        }
        Iterator iterator = mMapInstanceMap.entrySet().iterator();
        while (iterator.hasNext()) {
@@ -422,10 +403,7 @@ public class MapClientService extends ProfileService {
            }
        }
        if (DBG) {
            StringBuilder sb = new StringBuilder();
            dump(sb);
            Log.d(TAG, "removeUncleanAccounts:InstanceMap end state: "
                    + sb.toString());
            Log.d(TAG, "removeUncleanAccounts(): end devices=" + mMapInstanceMap.keySet());
        }
    }