Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit df13d6f7 authored by Shaowei Shen's avatar Shaowei Shen Committed by Android (Google) Code Review
Browse files

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

parents 09527e6c 348ff94a
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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();
+8 −0
Original line number Diff line number Diff line
@@ -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;
    }
+32 −0
Original line number Diff line number Diff line
@@ -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.
     *