Add logging for output chooser.
Show, hide, connect, and disconnect
Test: compare eventlog to action history
Fixes: 72999809
Change-Id: I545916c66b82703eb769b3264a7e920dde9c40ee
diff --git a/packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java b/packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java
index 46c43c2..6ed07f8 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java
@@ -49,6 +49,8 @@
import android.view.Window;
import android.view.WindowManager;
+import com.android.internal.logging.MetricsLogger;
+import com.android.internal.logging.nano.MetricsProto;
import com.android.settingslib.Utils;
import com.android.settingslib.bluetooth.CachedBluetoothDevice;
import com.android.systemui.Dependency;
@@ -202,6 +204,7 @@
@Override
public void show() {
super.show();
+ Dependency.get(MetricsLogger.class).visible(MetricsProto.MetricsEvent.OUTPUT_CHOOSER);
mHardwareLayout.setTranslationX(getAnimTranslation());
mHardwareLayout.setAlpha(0);
mHardwareLayout.animate()
@@ -215,6 +218,7 @@
@Override
public void dismiss() {
+ Dependency.get(MetricsLogger.class).hidden(MetricsProto.MetricsEvent.OUTPUT_CHOOSER);
mHardwareLayout.setTranslationX(0);
mHardwareLayout.setAlpha(1);
mHardwareLayout.animate()
@@ -237,11 +241,15 @@
if (item.deviceType == OutputChooserLayout.Item.DEVICE_TYPE_BT) {
final CachedBluetoothDevice device = (CachedBluetoothDevice) item.tag;
if (device.getMaxConnectionState() == BluetoothProfile.STATE_DISCONNECTED) {
+ Dependency.get(MetricsLogger.class).action(
+ MetricsProto.MetricsEvent.ACTION_OUTPUT_CHOOSER_CONNECT);
mBluetoothController.connect(device);
}
} else if (item.deviceType == OutputChooserLayout.Item.DEVICE_TYPE_MEDIA_ROUTER) {
final MediaRouter.RouteInfo route = (MediaRouter.RouteInfo) item.tag;
if (route.isEnabled()) {
+ Dependency.get(MetricsLogger.class).action(
+ MetricsProto.MetricsEvent.ACTION_OUTPUT_CHOOSER_CONNECT);
route.select();
}
}
@@ -252,8 +260,12 @@
if (item == null || item.tag == null) return;
if (item.deviceType == OutputChooserLayout.Item.DEVICE_TYPE_BT) {
final CachedBluetoothDevice device = (CachedBluetoothDevice) item.tag;
+ Dependency.get(MetricsLogger.class).action(
+ MetricsProto.MetricsEvent.ACTION_OUTPUT_CHOOSER_DISCONNECT);
mBluetoothController.disconnect(device);
} else if (item.deviceType == OutputChooserLayout.Item.DEVICE_TYPE_MEDIA_ROUTER) {
+ Dependency.get(MetricsLogger.class).action(
+ MetricsProto.MetricsEvent.ACTION_OUTPUT_CHOOSER_DISCONNECT);
mRouter.unselect(UNSELECT_REASON_DISCONNECTED);
}
}
diff --git a/proto/src/metrics_constants.proto b/proto/src/metrics_constants.proto
index f232feb..ae5e133 100644
--- a/proto/src/metrics_constants.proto
+++ b/proto/src/metrics_constants.proto
@@ -5201,6 +5201,18 @@
// OS: P
ACCESSIBILITY_VIBRATION_TOUCH = 1294;
+ // OPEN: Volume panel > output chooser dialog
+ // OS: P
+ OUTPUT_CHOOSER = 1295;
+
+ // Action: Volume panel > output chooser dialog > tap on device
+ // OS: P
+ ACTION_OUTPUT_CHOOSER_CONNECT = 1296;
+
+ // Action: Volume panel > output chooser dialog > tap on X next to connected device
+ // OS: P
+ ACTION_OUTPUT_CHOOSER_DISCONNECT = 1297;
+
// ---- End P Constants, all P constants go above this line ----
// Add new aosp constants above this line.
// END OF AOSP CONSTANTS