Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -573,6 +573,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } boolean addDeviceToPlayMedia(MediaDevice device) { boolean addDeviceToPlayMedia(MediaDevice device) { mMetricLogger.logInteractionExpansion(device); return mLocalMediaManager.addDeviceToPlayMedia(device); return mLocalMediaManager.addDeviceToPlayMedia(device); } } Loading Loading @@ -613,6 +614,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } void releaseSession() { void releaseSession() { mMetricLogger.logInteractionStopCasting(); mLocalMediaManager.releaseSession(); mLocalMediaManager.releaseSession(); } } Loading @@ -627,6 +629,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } void adjustVolume(MediaDevice device, int volume) { void adjustVolume(MediaDevice device, int volume) { mMetricLogger.logInteractionAdjustVolume(device); ThreadUtils.postOnBackgroundThread(() -> { ThreadUtils.postOnBackgroundThread(() -> { device.requestSetVolume(volume); device.requestSetVolume(volume); }); }); Loading packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java +64 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,49 @@ public class MediaOutputMetricLogger { mAppliedDeviceCountWithinRemoteGroup); mAppliedDeviceCountWithinRemoteGroup); } } /** * Do the metric logging of volume adjustment. * @param source the device been adjusted */ public void logInteractionAdjustVolume(MediaDevice source) { if (DEBUG) { Log.d(TAG, "logInteraction - AdjustVolume"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__ADJUST_VOLUME, getInteractionDeviceType(source)); } /** * Do the metric logging of stop casting. */ public void logInteractionStopCasting() { if (DEBUG) { Log.d(TAG, "logInteraction - Stop casting"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__STOP_CASTING, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__UNKNOWN_TYPE); } /** * Do the metric logging of device expansion. */ public void logInteractionExpansion(MediaDevice source) { if (DEBUG) { Log.d(TAG, "logInteraction - Expansion"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__EXPANSION, getInteractionDeviceType(source)); } /** /** * Do the metric logging of content switching failure. * Do the metric logging of content switching failure. * @param deviceList media device list for device count updating * @param deviceList media device list for device count updating Loading Loading @@ -185,6 +228,27 @@ public class MediaOutputMetricLogger { } } } } private int getInteractionDeviceType(MediaDevice device) { switch (device.getDeviceType()) { case MediaDevice.MediaDeviceType.TYPE_PHONE_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__BUILTIN_SPEAKER; case MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE: return SysUiStatsLog .MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__WIRED_3POINT5_MM_AUDIO; case MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__USB_C_AUDIO; case MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__BLUETOOTH; case MediaDevice.MediaDeviceType.TYPE_CAST_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__REMOTE_SINGLE; case MediaDevice.MediaDeviceType.TYPE_CAST_GROUP_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__REMOTE_GROUP; default: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__UNKNOWN_TYPE; } } private int getLoggingSwitchOpSubResult(int reason) { private int getLoggingSwitchOpSubResult(int reason) { switch (reason) { switch (reason) { case REASON_REJECTED: case REASON_REJECTED: Loading Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputController.java +3 −0 Original line number Original line Diff line number Diff line Loading @@ -573,6 +573,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } boolean addDeviceToPlayMedia(MediaDevice device) { boolean addDeviceToPlayMedia(MediaDevice device) { mMetricLogger.logInteractionExpansion(device); return mLocalMediaManager.addDeviceToPlayMedia(device); return mLocalMediaManager.addDeviceToPlayMedia(device); } } Loading Loading @@ -613,6 +614,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } void releaseSession() { void releaseSession() { mMetricLogger.logInteractionStopCasting(); mLocalMediaManager.releaseSession(); mLocalMediaManager.releaseSession(); } } Loading @@ -627,6 +629,7 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback, } } void adjustVolume(MediaDevice device, int volume) { void adjustVolume(MediaDevice device, int volume) { mMetricLogger.logInteractionAdjustVolume(device); ThreadUtils.postOnBackgroundThread(() -> { ThreadUtils.postOnBackgroundThread(() -> { device.requestSetVolume(volume); device.requestSetVolume(volume); }); }); Loading
packages/SystemUI/src/com/android/systemui/media/dialog/MediaOutputMetricLogger.java +64 −0 Original line number Original line Diff line number Diff line Loading @@ -95,6 +95,49 @@ public class MediaOutputMetricLogger { mAppliedDeviceCountWithinRemoteGroup); mAppliedDeviceCountWithinRemoteGroup); } } /** * Do the metric logging of volume adjustment. * @param source the device been adjusted */ public void logInteractionAdjustVolume(MediaDevice source) { if (DEBUG) { Log.d(TAG, "logInteraction - AdjustVolume"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__ADJUST_VOLUME, getInteractionDeviceType(source)); } /** * Do the metric logging of stop casting. */ public void logInteractionStopCasting() { if (DEBUG) { Log.d(TAG, "logInteraction - Stop casting"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__STOP_CASTING, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__UNKNOWN_TYPE); } /** * Do the metric logging of device expansion. */ public void logInteractionExpansion(MediaDevice source) { if (DEBUG) { Log.d(TAG, "logInteraction - Expansion"); } SysUiStatsLog.write( SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT, SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__EXPANSION, getInteractionDeviceType(source)); } /** /** * Do the metric logging of content switching failure. * Do the metric logging of content switching failure. * @param deviceList media device list for device count updating * @param deviceList media device list for device count updating Loading Loading @@ -185,6 +228,27 @@ public class MediaOutputMetricLogger { } } } } private int getInteractionDeviceType(MediaDevice device) { switch (device.getDeviceType()) { case MediaDevice.MediaDeviceType.TYPE_PHONE_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__BUILTIN_SPEAKER; case MediaDevice.MediaDeviceType.TYPE_3POINT5_MM_AUDIO_DEVICE: return SysUiStatsLog .MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__WIRED_3POINT5_MM_AUDIO; case MediaDevice.MediaDeviceType.TYPE_USB_C_AUDIO_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__USB_C_AUDIO; case MediaDevice.MediaDeviceType.TYPE_BLUETOOTH_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__BLUETOOTH; case MediaDevice.MediaDeviceType.TYPE_CAST_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__REMOTE_SINGLE; case MediaDevice.MediaDeviceType.TYPE_CAST_GROUP_DEVICE: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__REMOTE_GROUP; default: return SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__TARGET__UNKNOWN_TYPE; } } private int getLoggingSwitchOpSubResult(int reason) { private int getLoggingSwitchOpSubResult(int reason) { switch (reason) { switch (reason) { case REASON_REJECTED: case REASON_REJECTED: Loading