Loading packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java +12 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ import android.util.Pair; 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; Loading Loading @@ -202,6 +204,7 @@ public class OutputChooserDialog extends Dialog @Override public void show() { super.show(); Dependency.get(MetricsLogger.class).visible(MetricsProto.MetricsEvent.OUTPUT_CHOOSER); mHardwareLayout.setTranslationX(getAnimTranslation()); mHardwareLayout.setAlpha(0); mHardwareLayout.animate() Loading @@ -215,6 +218,7 @@ public class OutputChooserDialog extends Dialog @Override public void dismiss() { Dependency.get(MetricsLogger.class).hidden(MetricsProto.MetricsEvent.OUTPUT_CHOOSER); mHardwareLayout.setTranslationX(0); mHardwareLayout.setAlpha(1); mHardwareLayout.animate() Loading @@ -237,11 +241,15 @@ public class OutputChooserDialog extends Dialog 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(); } } Loading @@ -252,8 +260,12 @@ public class OutputChooserDialog extends Dialog 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); } } Loading proto/src/metrics_constants.proto +12 −0 Original line number Diff line number Diff line Loading @@ -5201,6 +5201,18 @@ message MetricsEvent { // 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 Loading Loading
packages/SystemUI/src/com/android/systemui/volume/OutputChooserDialog.java +12 −0 Original line number Diff line number Diff line Loading @@ -49,6 +49,8 @@ import android.util.Pair; 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; Loading Loading @@ -202,6 +204,7 @@ public class OutputChooserDialog extends Dialog @Override public void show() { super.show(); Dependency.get(MetricsLogger.class).visible(MetricsProto.MetricsEvent.OUTPUT_CHOOSER); mHardwareLayout.setTranslationX(getAnimTranslation()); mHardwareLayout.setAlpha(0); mHardwareLayout.animate() Loading @@ -215,6 +218,7 @@ public class OutputChooserDialog extends Dialog @Override public void dismiss() { Dependency.get(MetricsLogger.class).hidden(MetricsProto.MetricsEvent.OUTPUT_CHOOSER); mHardwareLayout.setTranslationX(0); mHardwareLayout.setAlpha(1); mHardwareLayout.animate() Loading @@ -237,11 +241,15 @@ public class OutputChooserDialog extends Dialog 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(); } } Loading @@ -252,8 +260,12 @@ public class OutputChooserDialog extends Dialog 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); } } Loading
proto/src/metrics_constants.proto +12 −0 Original line number Diff line number Diff line Loading @@ -5201,6 +5201,18 @@ message MetricsEvent { // 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 Loading