Merge "AudioDeviceBroker: log BT device name" into rvc-dev am: a771b5b6ed am: 6481eae378

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

Change-Id: I4f158cadf3c3669daa9f1eaa11adb70468ee2908
This commit is contained in:
Andy Hung
2020-06-08 21:31:54 +00:00
committed by Automerger Merge Worker

View File

@@ -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