[Output Swticher] [Metrics] logging mute/unmute event
Bug: 268428968 Test: N/A Change-Id: I03ed725b5234a683ded9055d41e0145267c5208e
This commit is contained in:
committed by
Shaowei Shen
parent
73efdc9664
commit
348ff94aa8
@@ -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();
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user