Merge "[Output Swticher] [Metrics] logging mute/unmute event" into udc-qpr-dev

This commit is contained in:
Shaowei Shen
2023-08-18 06:59:13 +00:00
committed by Android (Google) Code Review
3 changed files with 42 additions and 0 deletions

View File

@@ -515,11 +515,13 @@ public abstract class MediaOutputBaseAdapter extends
mSeekBar.setOnTouchListener((v, event) -> false);
updateIconAreaClickListener((v) -> {
if (device.getCurrentVolume() == 0) {
mController.logInteractionUnmuteDevice(device);
mSeekBar.setVolume(UNMUTE_DEFAULT_VOLUME);
mController.adjustVolume(device, UNMUTE_DEFAULT_VOLUME);
updateUnmutedVolumeIcon();
mIconAreaLayout.setOnTouchListener(((iconV, event) -> false));
} else {
mController.logInteractionMuteDevice(device);
mSeekBar.resetVolume();
mController.adjustVolume(device, 0);
updateMutedVolumeIcon();

View File

@@ -843,6 +843,14 @@ public class MediaOutputController implements LocalMediaManager.DeviceCallback,
mMetricLogger.logInteractionAdjustVolume(device);
}
void logInteractionMuteDevice(MediaDevice device) {
mMetricLogger.logInteractionMute(device);
}
void logInteractionUnmuteDevice(MediaDevice device) {
mMetricLogger.logInteractionUnmute(device);
}
String getPackageName() {
return mPackageName;
}

View File

@@ -153,6 +153,38 @@ public class MediaOutputMetricLogger {
source.isSuggestedDevice());
}
/**
* Do the metric logging of muting device.
*/
public void logInteractionMute(MediaDevice source) {
if (DEBUG) {
Log.d(TAG, "logInteraction - Mute");
}
SysUiStatsLog.write(
SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT,
SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__MUTE,
getInteractionDeviceType(source),
getLoggingPackageName(),
source.isSuggestedDevice());
}
/**
* Do the metric logging of unmuting device.
*/
public void logInteractionUnmute(MediaDevice source) {
if (DEBUG) {
Log.d(TAG, "logInteraction - Unmute");
}
SysUiStatsLog.write(
SysUiStatsLog.MEDIAOUTPUT_OP_INTERACTION_REPORT,
SysUiStatsLog.MEDIA_OUTPUT_OP_INTERACTION_REPORTED__INTERACTION_TYPE__UNMUTE,
getInteractionDeviceType(source),
getLoggingPackageName(),
source.isSuggestedDevice());
}
/**
* Do the metric logging of content switching failure.
*