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

Commit a0a58576 authored by Sal Savage's avatar Sal Savage Committed by Gerrit Code Review
Browse files

Merge "Use profile names instead of integer constants when logging"

parents 3a0e9109 8f2c782c
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -729,16 +729,16 @@ class AdapterProperties {
                    metricId, device.getName());
            MetricsLogger.getInstance().logSanitizedBluetoothDeviceName(metricId, device.getName());
        }
        Log.d(TAG,
                "PROFILE_CONNECTION_STATE_CHANGE: profile=" + profile + ", device=" + device + ", "
        Log.d(TAG, "PROFILE_CONNECTION_STATE_CHANGE: profile="
                + BluetoothProfile.getProfileName(profile) + ", device=" + device + ", "
                + prevState + " -> " + state);
        BluetoothStatsLog.write(BluetoothStatsLog.BLUETOOTH_CONNECTION_STATE_CHANGED, state,
                0 /* deprecated */, profile, mService.obfuscateAddress(device),
                metricId, 0, -1);

        if (!isNormalStateTransition(prevState, state)) {
            Log.w(TAG,
                    "PROFILE_CONNECTION_STATE_CHANGE: unexpected transition for profile=" + profile
            Log.w(TAG, "PROFILE_CONNECTION_STATE_CHANGE: unexpected transition for profile="
                    + BluetoothProfile.getProfileName(profile)
                    + ", device=" + device + ", " + prevState + " -> " + state);
        }
        sendConnectionStateChange(device, profile, state, prevState);
+6 −4
Original line number Diff line number Diff line
@@ -506,8 +506,9 @@ class PhonePolicy {
    @RequiresPermission(android.Manifest.permission.BLUETOOTH_PRIVILEGED)
    private void processProfileStateChanged(BluetoothDevice device, int profileId, int nextState,
            int prevState) {
        debugLog("processProfileStateChanged, device=" + device + ", profile=" + profileId + ", "
                + prevState + " -> " + nextState);
        debugLog("processProfileStateChanged, device=" + device + ", profile="
                + BluetoothProfile.getProfileName(profileId) + ", " + prevState + " -> "
                + nextState);
        if (((profileId == BluetoothProfile.A2DP) || (profileId == BluetoothProfile.HEADSET)
                || (profileId == BluetoothProfile.LE_AUDIO)
                || (profileId == BluetoothProfile.CSIP_SET_COORDINATOR)
@@ -544,8 +545,9 @@ class PhonePolicy {
     * @param device is the device we just made the active device
     */
    private void processActiveDeviceChanged(BluetoothDevice device, int profileId) {
        debugLog("processActiveDeviceChanged, device=" + device + ", profile=" + profileId
                + " isDualModeAudioEnabled=" + isDualModeAudioEnabled());
        debugLog("processActiveDeviceChanged, device=" + device + ", profile="
                + BluetoothProfile.getProfileName(profileId) + " isDualModeAudioEnabled="
                + isDualModeAudioEnabled());

        if (device != null) {
            mDatabaseManager.setConnection(device, profileId == BluetoothProfile.A2DP);
+4 −2
Original line number Diff line number Diff line
@@ -300,7 +300,8 @@ public class SilenceDeviceManager {

    void addConnectedDevice(BluetoothDevice device, int profile) {
        if (VERBOSE) {
            Log.d(TAG, "addConnectedDevice: " + device + ", profile:" + profile);
            Log.d(TAG, "addConnectedDevice: " + device + ", profile:"
                    + BluetoothProfile.getProfileName(profile));
        }
        switch (profile) {
            case BluetoothProfile.A2DP:
@@ -318,7 +319,8 @@ public class SilenceDeviceManager {

    void removeConnectedDevice(BluetoothDevice device, int profile) {
        if (VERBOSE) {
            Log.d(TAG, "removeConnectedDevice: " + device + ", profile:" + profile);
            Log.d(TAG, "removeConnectedDevice: " + device + ", profile:"
                    + BluetoothProfile.getProfileName(profile));
        }
        switch (profile) {
            case BluetoothProfile.A2DP: