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

Commit 2d74df25 authored by Andy Hung's avatar Andy Hung Committed by Automerger Merge Worker
Browse files

Merge "AudioDeviceBroker: log BT device name" into rvc-dev am: a771b5b6

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/11762409

Change-Id: Idea1778862d93e8298a4ddfe8efe373ae34843ef
parents 091ae41a a771b5b6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.os.Message;
import android.os.PowerManager;
import android.os.RemoteException;
import android.os.SystemClock;
import android.text.TextUtils;
import android.util.Log;
import android.util.PrintWriterPrinter;

@@ -329,11 +330,13 @@ import java.util.concurrent.atomic.AtomicBoolean;
        final BtDeviceConnectionInfo info = new BtDeviceConnectionInfo(device, state, profile,
                suppressNoisyIntent, a2dpVolume);

        final String name = TextUtils.emptyIfNull(device.getName());
        new MediaMetrics.Item(MediaMetrics.Name.AUDIO_DEVICE + MediaMetrics.SEPARATOR
                + "postBluetoothA2dpDeviceConnectionStateSuppressNoisyIntent")
                .set(MediaMetrics.Property.STATE, state == BluetoothProfile.STATE_CONNECTED
                        ? MediaMetrics.Value.CONNECTED : MediaMetrics.Value.DISCONNECTED)
                .set(MediaMetrics.Property.INDEX, a2dpVolume)
                .set(MediaMetrics.Property.NAME, name)
                .record();

        // operations of removing and posting messages related to A2DP device state change must be