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

Commit 8f07a630 authored by Will Brockman's avatar Will Brockman Committed by Android (Google) Code Review
Browse files

Merge "De-contextify volume/Events MetricsLogger calls."

parents 026bd122 1d716b29
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -296,7 +296,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
        mShowing = true;
        mShowing = true;
        clearAllAndSetupDefaultCarVolumeLineItem(mCurrentlyDisplayingGroupId);
        clearAllAndSetupDefaultCarVolumeLineItem(mCurrentlyDisplayingGroupId);
        mDialog.show();
        mDialog.show();
        Events.writeEvent(mContext, Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
        Events.writeEvent(Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
    }
    }


    private void clearAllAndSetupDefaultCarVolumeLineItem(int groupId) {
    private void clearAllAndSetupDefaultCarVolumeLineItem(int groupId) {
@@ -359,7 +359,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
                }, DISMISS_DELAY_IN_MILLIS))
                }, DISMISS_DELAY_IN_MILLIS))
                .start();
                .start();


        Events.writeEvent(mContext, Events.EVENT_DISMISS_DIALOG, reason);
        Events.writeEvent(Events.EVENT_DISMISS_DIALOG, reason);
    }
    }


    private void loadAudioUsageItems() {
    private void loadAudioUsageItems() {
+2 −2
Original line number Original line Diff line number Diff line
@@ -476,7 +476,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
                });
                });
        d.setOnDismissListener(dialogInterface -> {
        d.setOnDismissListener(dialogInterface -> {
            mUsbHighTempDialog = null;
            mUsbHighTempDialog = null;
            Events.writeEvent(mContext, Events.EVENT_DISMISS_USB_OVERHEAT_ALARM,
            Events.writeEvent(Events.EVENT_DISMISS_USB_OVERHEAT_ALARM,
                    Events.DISMISS_REASON_USB_OVERHEAD_ALARM_CHANGED,
                    Events.DISMISS_REASON_USB_OVERHEAD_ALARM_CHANGED,
                    mKeyguard.isKeyguardLocked());
                    mKeyguard.isKeyguardLocked());
        });
        });
@@ -485,7 +485,7 @@ public class PowerNotificationWarnings implements PowerUI.WarningsUI {
        d.show();
        d.show();
        mUsbHighTempDialog = d;
        mUsbHighTempDialog = d;


        Events.writeEvent(mContext, Events.EVENT_SHOW_USB_OVERHEAT_ALARM,
        Events.writeEvent(Events.EVENT_SHOW_USB_OVERHEAT_ALARM,
                Events.SHOW_REASON_USB_OVERHEAD_ALARM_CHANGED,
                Events.SHOW_REASON_USB_OVERHEAD_ALARM_CHANGED,
                mKeyguard.isKeyguardLocked());
                mKeyguard.isKeyguardLocked());
    }
    }
+20 −15
Original line number Original line Diff line number Diff line
@@ -16,7 +16,6 @@


package com.android.systemui.volume;
package com.android.systemui.volume;


import android.content.Context;
import android.media.AudioManager;
import android.media.AudioManager;
import android.media.AudioSystem;
import android.media.AudioSystem;
import android.provider.Settings.Global;
import android.provider.Settings.Global;
@@ -125,7 +124,12 @@ public class Events {


    public static Callback sCallback;
    public static Callback sCallback;


    public static void writeEvent(Context context, int tag, Object... list) {
    /**
     * Logs an event to the system log and the event log.
     * @param tag One of the EVENT_* codes above.
     * @param list Any additional event-specific arguments, documented above.
     */
    public static void writeEvent(int tag, Object... list) {
        MetricsLogger logger = new MetricsLogger();
        MetricsLogger logger = new MetricsLogger();
        final long time = System.currentTimeMillis();
        final long time = System.currentTimeMillis();
        final StringBuilder sb = new StringBuilder("writeEvent ").append(EVENT_TAGS[tag]);
        final StringBuilder sb = new StringBuilder("writeEvent ").append(EVENT_TAGS[tag]);
@@ -133,33 +137,33 @@ public class Events {
            sb.append(" ");
            sb.append(" ");
            switch (tag) {
            switch (tag) {
                case EVENT_SHOW_DIALOG:
                case EVENT_SHOW_DIALOG:
                    MetricsLogger.visible(context, MetricsEvent.VOLUME_DIALOG);
                    logger.visible(MetricsEvent.VOLUME_DIALOG);
                    MetricsLogger.histogram(context, "volume_from_keyguard",
                    logger.histogram("volume_from_keyguard",
                            (Boolean) list[1] ? 1 : 0);
                            (Boolean) list[1] ? 1 : 0);
                    sb.append(SHOW_REASONS[(Integer) list[0]]).append(" keyguard=").append(list[1]);
                    sb.append(SHOW_REASONS[(Integer) list[0]]).append(" keyguard=").append(list[1]);
                    break;
                    break;
                case EVENT_EXPAND:
                case EVENT_EXPAND:
                    MetricsLogger.visibility(context, MetricsEvent.VOLUME_DIALOG_DETAILS,
                    logger.visibility(MetricsEvent.VOLUME_DIALOG_DETAILS,
                            (Boolean) list[0]);
                            (Boolean) list[0]);
                    sb.append(list[0]);
                    sb.append(list[0]);
                    break;
                    break;
                case EVENT_DISMISS_DIALOG:
                case EVENT_DISMISS_DIALOG:
                    MetricsLogger.hidden(context, MetricsEvent.VOLUME_DIALOG);
                    logger.hidden(MetricsEvent.VOLUME_DIALOG);
                    sb.append(DISMISS_REASONS[(Integer) list[0]]);
                    sb.append(DISMISS_REASONS[(Integer) list[0]]);
                    break;
                    break;
                case EVENT_ACTIVE_STREAM_CHANGED:
                case EVENT_ACTIVE_STREAM_CHANGED:
                    MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_STREAM,
                    logger.action(MetricsEvent.ACTION_VOLUME_STREAM,
                            (Integer) list[0]);
                            (Integer) list[0]);
                    sb.append(AudioSystem.streamToString((Integer) list[0]));
                    sb.append(AudioSystem.streamToString((Integer) list[0]));
                    break;
                    break;
                case EVENT_ICON_CLICK:
                case EVENT_ICON_CLICK:
                    MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_ICON,
                    logger.action(MetricsEvent.ACTION_VOLUME_ICON,
                            (Integer) list[0]);
                            (Integer) list[0]);
                    sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                    sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                            .append(iconStateToString((Integer) list[1]));
                            .append(iconStateToString((Integer) list[1]));
                    break;
                    break;
                case EVENT_TOUCH_LEVEL_DONE:
                case EVENT_TOUCH_LEVEL_DONE:
                    MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_SLIDER,
                    logger.action(MetricsEvent.ACTION_VOLUME_SLIDER,
                            (Integer) list[1]);
                            (Integer) list[1]);
                    // fall through
                    // fall through
                case EVENT_TOUCH_LEVEL_CHANGED:
                case EVENT_TOUCH_LEVEL_CHANGED:
@@ -169,7 +173,7 @@ public class Events {
                            .append(list[1]);
                            .append(list[1]);
                    break;
                    break;
                case EVENT_KEY:
                case EVENT_KEY:
                    MetricsLogger.action(context, MetricsEvent.ACTION_VOLUME_KEY,
                    logger.action(MetricsEvent.ACTION_VOLUME_KEY,
                            (Integer) list[0]);
                            (Integer) list[0]);
                    sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                    sb.append(AudioSystem.streamToString((Integer) list[0])).append(' ')
                            .append(list[1]);
                            .append(list[1]);
@@ -181,7 +185,7 @@ public class Events {
                    logger.action(MetricsEvent.ACTION_VOLUME_SETTINGS);
                    logger.action(MetricsEvent.ACTION_VOLUME_SETTINGS);
                    break;
                    break;
                case EVENT_EXTERNAL_RINGER_MODE_CHANGED:
                case EVENT_EXTERNAL_RINGER_MODE_CHANGED:
                    MetricsLogger.action(context, MetricsEvent.ACTION_RINGER_MODE,
                    logger.action(MetricsEvent.ACTION_RINGER_MODE,
                            (Integer) list[0]);
                            (Integer) list[0]);
                    // fall through
                    // fall through
                case EVENT_INTERNAL_RINGER_MODE_CHANGED:
                case EVENT_INTERNAL_RINGER_MODE_CHANGED:
@@ -194,14 +198,14 @@ public class Events {
                    sb.append(list[0]).append(' ').append(list[1]);
                    sb.append(list[0]).append(' ').append(list[1]);
                    break;
                    break;
                case EVENT_SHOW_USB_OVERHEAT_ALARM:
                case EVENT_SHOW_USB_OVERHEAT_ALARM:
                    MetricsLogger.visible(context, MetricsEvent.POWER_OVERHEAT_ALARM);
                    logger.visible(MetricsEvent.POWER_OVERHEAT_ALARM);
                    MetricsLogger.histogram(context, "show_usb_overheat_alarm",
                    logger.histogram("show_usb_overheat_alarm",
                            (Boolean) list[1] ? 1 : 0);
                            (Boolean) list[1] ? 1 : 0);
                    sb.append(SHOW_REASONS[(Integer) list[0]]).append(" keyguard=").append(list[1]);
                    sb.append(SHOW_REASONS[(Integer) list[0]]).append(" keyguard=").append(list[1]);
                    break;
                    break;
                case EVENT_DISMISS_USB_OVERHEAT_ALARM:
                case EVENT_DISMISS_USB_OVERHEAT_ALARM:
                    MetricsLogger.hidden(context, MetricsEvent.POWER_OVERHEAT_ALARM);
                    logger.hidden(MetricsEvent.POWER_OVERHEAT_ALARM);
                    MetricsLogger.histogram(context, "dismiss_usb_overheat_alarm",
                    logger.histogram("dismiss_usb_overheat_alarm",
                            (Boolean) list[1] ? 1 : 0);
                            (Boolean) list[1] ? 1 : 0);
                    sb.append(DISMISS_REASONS[(Integer) list[0]])
                    sb.append(DISMISS_REASONS[(Integer) list[0]])
                        .append(" keyguard=").append(list[1]);
                        .append(" keyguard=").append(list[1]);
@@ -255,4 +259,5 @@ public class Events {
        void writeEvent(long time, int tag, Object[] list);
        void writeEvent(long time, int tag, Object[] list);
        void writeState(long time, State state);
        void writeState(long time, State state);
    }
    }

}
}
+13 −13
Original line number Original line Diff line number Diff line
@@ -150,7 +150,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        mStatusBarOptionalLazy = statusBarOptionalLazy;
        mStatusBarOptionalLazy = statusBarOptionalLazy;
        mNotificationManager = (NotificationManager) mContext.getSystemService(
        mNotificationManager = (NotificationManager) mContext.getSystemService(
                Context.NOTIFICATION_SERVICE);
                Context.NOTIFICATION_SERVICE);
        Events.writeEvent(mContext, Events.EVENT_COLLECTION_STARTED);
        Events.writeEvent(Events.EVENT_COLLECTION_STARTED);
        mWorkerThread = new HandlerThread(VolumeDialogControllerImpl.class.getSimpleName());
        mWorkerThread = new HandlerThread(VolumeDialogControllerImpl.class.getSimpleName());
        mWorkerThread.start();
        mWorkerThread.start();
        mWorker = new W(mWorkerThread.getLooper());
        mWorker = new W(mWorkerThread.getLooper());
@@ -237,7 +237,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        if (D.BUG) Log.d(TAG, "destroy");
        if (D.BUG) Log.d(TAG, "destroy");
        if (mDestroyed) return;
        if (mDestroyed) return;
        mDestroyed = true;
        mDestroyed = true;
        Events.writeEvent(mContext, Events.EVENT_COLLECTION_STOPPED);
        Events.writeEvent(Events.EVENT_COLLECTION_STOPPED);
        mMediaSessions.destroy();
        mMediaSessions.destroy();
        mObserver.destroy();
        mObserver.destroy();
        mReceiver.destroy();
        mReceiver.destroy();
@@ -487,7 +487,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
            mCallbacks.onShowSilentHint();
            mCallbacks.onShowSilentHint();
        }
        }
        if (changed && fromKey) {
        if (changed && fromKey) {
            Events.writeEvent(mContext, Events.EVENT_KEY, stream, lastAudibleStreamVolume);
            Events.writeEvent(Events.EVENT_KEY, stream, lastAudibleStreamVolume);
        }
        }
        return changed;
        return changed;
    }
    }
@@ -495,7 +495,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
    private boolean updateActiveStreamW(int activeStream) {
    private boolean updateActiveStreamW(int activeStream) {
        if (activeStream == mState.activeStream) return false;
        if (activeStream == mState.activeStream) return false;
        mState.activeStream = activeStream;
        mState.activeStream = activeStream;
        Events.writeEvent(mContext, Events.EVENT_ACTIVE_STREAM_CHANGED, activeStream);
        Events.writeEvent(Events.EVENT_ACTIVE_STREAM_CHANGED, activeStream);
        if (D.BUG) Log.d(TAG, "updateActiveStreamW " + activeStream);
        if (D.BUG) Log.d(TAG, "updateActiveStreamW " + activeStream);
        final int s = activeStream < DYNAMIC_STREAM_START_INDEX ? activeStream : -1;
        final int s = activeStream < DYNAMIC_STREAM_START_INDEX ? activeStream : -1;
        if (D.BUG) Log.d(TAG, "forceVolumeControlStream " + s);
        if (D.BUG) Log.d(TAG, "forceVolumeControlStream " + s);
@@ -544,7 +544,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        if (ss.level == level) return false;
        if (ss.level == level) return false;
        ss.level = level;
        ss.level = level;
        if (isLogWorthy(stream)) {
        if (isLogWorthy(stream)) {
            Events.writeEvent(mContext, Events.EVENT_LEVEL_CHANGED, stream, level);
            Events.writeEvent(Events.EVENT_LEVEL_CHANGED, stream, level);
        }
        }
        return true;
        return true;
    }
    }
@@ -567,7 +567,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        if (ss.muted == muted) return false;
        if (ss.muted == muted) return false;
        ss.muted = muted;
        ss.muted = muted;
        if (isLogWorthy(stream)) {
        if (isLogWorthy(stream)) {
            Events.writeEvent(mContext, Events.EVENT_MUTE_CHANGED, stream, muted);
            Events.writeEvent(Events.EVENT_MUTE_CHANGED, stream, muted);
        }
        }
        if (muted && isRinger(stream)) {
        if (muted && isRinger(stream)) {
            updateRingerModeInternalW(mAudio.getRingerModeInternal());
            updateRingerModeInternalW(mAudio.getRingerModeInternal());
@@ -583,7 +583,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        if (Objects.equals(mState.effectsSuppressor, effectsSuppressor)) return false;
        if (Objects.equals(mState.effectsSuppressor, effectsSuppressor)) return false;
        mState.effectsSuppressor = effectsSuppressor;
        mState.effectsSuppressor = effectsSuppressor;
        mState.effectsSuppressorName = getApplicationName(mContext, mState.effectsSuppressor);
        mState.effectsSuppressorName = getApplicationName(mContext, mState.effectsSuppressor);
        Events.writeEvent(mContext, Events.EVENT_SUPPRESSOR_CHANGED, mState.effectsSuppressor,
        Events.writeEvent(Events.EVENT_SUPPRESSOR_CHANGED, mState.effectsSuppressor,
                mState.effectsSuppressorName);
                mState.effectsSuppressorName);
        return true;
        return true;
    }
    }
@@ -607,7 +607,7 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
                Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
                Settings.Global.ZEN_MODE, Settings.Global.ZEN_MODE_OFF);
        if (mState.zenMode == zen) return false;
        if (mState.zenMode == zen) return false;
        mState.zenMode = zen;
        mState.zenMode = zen;
        Events.writeEvent(mContext, Events.EVENT_ZEN_MODE_CHANGED, zen);
        Events.writeEvent(Events.EVENT_ZEN_MODE_CHANGED, zen);
        return true;
        return true;
    }
    }


@@ -633,23 +633,23 @@ public class VolumeDialogControllerImpl implements VolumeDialogController, Dumpa
        mState.disallowMedia = disallowMedia;
        mState.disallowMedia = disallowMedia;
        mState.disallowSystem = disallowSystem;
        mState.disallowSystem = disallowSystem;
        mState.disallowRinger = disallowRinger;
        mState.disallowRinger = disallowRinger;
        Events.writeEvent(mContext, Events.EVENT_ZEN_CONFIG_CHANGED, "disallowAlarms=" +
        Events.writeEvent(Events.EVENT_ZEN_CONFIG_CHANGED, "disallowAlarms="
                disallowAlarms + " disallowMedia=" + disallowMedia + " disallowSystem=" +
                + disallowAlarms + " disallowMedia=" + disallowMedia + " disallowSystem="
                disallowSystem + " disallowRinger=" + disallowRinger);
                + disallowSystem + " disallowRinger=" + disallowRinger);
        return true;
        return true;
    }
    }


    private boolean updateRingerModeExternalW(int rm) {
    private boolean updateRingerModeExternalW(int rm) {
        if (rm == mState.ringerModeExternal) return false;
        if (rm == mState.ringerModeExternal) return false;
        mState.ringerModeExternal = rm;
        mState.ringerModeExternal = rm;
        Events.writeEvent(mContext, Events.EVENT_EXTERNAL_RINGER_MODE_CHANGED, rm);
        Events.writeEvent(Events.EVENT_EXTERNAL_RINGER_MODE_CHANGED, rm);
        return true;
        return true;
    }
    }


    private boolean updateRingerModeInternalW(int rm) {
    private boolean updateRingerModeInternalW(int rm) {
        if (rm == mState.ringerModeInternal) return false;
        if (rm == mState.ringerModeInternal) return false;
        mState.ringerModeInternal = rm;
        mState.ringerModeInternal = rm;
        Events.writeEvent(mContext, Events.EVENT_INTERNAL_RINGER_MODE_CHANGED, rm);
        Events.writeEvent(Events.EVENT_INTERNAL_RINGER_MODE_CHANGED, rm);


        if (mState.ringerModeInternal == RINGER_MODE_NORMAL) {
        if (mState.ringerModeInternal == RINGER_MODE_NORMAL) {
            playTouchFeedback();
            playTouchFeedback();
+9 −9
Original line number Original line Diff line number Diff line
@@ -429,7 +429,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        row.icon.setImageResource(iconRes);
        row.icon.setImageResource(iconRes);
        if (row.stream != AudioSystem.STREAM_ACCESSIBILITY) {
        if (row.stream != AudioSystem.STREAM_ACCESSIBILITY) {
            row.icon.setOnClickListener(v -> {
            row.icon.setOnClickListener(v -> {
                Events.writeEvent(mContext, Events.EVENT_ICON_CLICK, row.stream, row.iconState);
                Events.writeEvent(Events.EVENT_ICON_CLICK, row.stream, row.iconState);
                mController.setActiveStream(row.stream);
                mController.setActiveStream(row.stream);
                if (row.stream == AudioManager.STREAM_RING) {
                if (row.stream == AudioManager.STREAM_RING) {
                    final boolean hasVibrator = mController.hasVibrator();
                    final boolean hasVibrator = mController.hasVibrator();
@@ -468,7 +468,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        }
        }
        if (mSettingsIcon != null) {
        if (mSettingsIcon != null) {
            mSettingsIcon.setOnClickListener(v -> {
            mSettingsIcon.setOnClickListener(v -> {
                Events.writeEvent(mContext, Events.EVENT_SETTINGS_CLICK);
                Events.writeEvent(Events.EVENT_SETTINGS_CLICK);
                Intent intent = new Intent(Settings.Panel.ACTION_VOLUME);
                Intent intent = new Intent(Settings.Panel.ACTION_VOLUME);
                dismissH(DISMISS_REASON_SETTINGS_CLICKED);
                dismissH(DISMISS_REASON_SETTINGS_CLICKED);
                Dependency.get(ActivityStarter.class).startActivity(intent,
                Dependency.get(ActivityStarter.class).startActivity(intent,
@@ -504,7 +504,7 @@ public class VolumeDialogImpl implements VolumeDialog,
                        mController.setStreamVolume(AudioManager.STREAM_RING, 1);
                        mController.setStreamVolume(AudioManager.STREAM_RING, 1);
                    }
                    }
                }
                }
                Events.writeEvent(mContext, Events.EVENT_RINGER_TOGGLE, newRingerMode);
                Events.writeEvent(Events.EVENT_RINGER_TOGGLE, newRingerMode);
                incrementManualToggleCount();
                incrementManualToggleCount();
                updateRingerH();
                updateRingerH();
                provideTouchFeedbackH(newRingerMode);
                provideTouchFeedbackH(newRingerMode);
@@ -519,7 +519,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        if (mODICaptionsIcon != null) {
        if (mODICaptionsIcon != null) {
            mODICaptionsIcon.setOnConfirmedTapListener(() -> {
            mODICaptionsIcon.setOnConfirmedTapListener(() -> {
                onCaptionIconClicked();
                onCaptionIconClicked();
                Events.writeEvent(mContext, Events.EVENT_ODI_CAPTIONS_CLICK);
                Events.writeEvent(Events.EVENT_ODI_CAPTIONS_CLICK);
            }, mHandler);
            }, mHandler);
        }
        }


@@ -541,7 +541,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            mODICaptionsTooltipView = mODICaptionsTooltipViewStub.inflate();
            mODICaptionsTooltipView = mODICaptionsTooltipViewStub.inflate();
            mODICaptionsTooltipView.findViewById(R.id.dismiss).setOnClickListener(v -> {
            mODICaptionsTooltipView.findViewById(R.id.dismiss).setOnClickListener(v -> {
                hideCaptionsTooltip();
                hideCaptionsTooltip();
                Events.writeEvent(mContext, Events.EVENT_ODI_CAPTIONS_TOOLTIP_CLICK);
                Events.writeEvent(Events.EVENT_ODI_CAPTIONS_TOOLTIP_CLICK);
            });
            });
            mODICaptionsTooltipViewStub = null;
            mODICaptionsTooltipViewStub = null;
            rescheduleTimeoutH();
            rescheduleTimeoutH();
@@ -694,7 +694,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        initSettingsH();
        initSettingsH();
        mShowing = true;
        mShowing = true;
        mDialog.show();
        mDialog.show();
        Events.writeEvent(mContext, Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
        Events.writeEvent(Events.EVENT_SHOW_DIALOG, reason, mKeyguard.isKeyguardLocked());
        mController.notifyVisible(true);
        mController.notifyVisible(true);
        mController.getCaptionsComponentState(false);
        mController.getCaptionsComponentState(false);
        checkODICaptionsTooltip(false);
        checkODICaptionsTooltip(false);
@@ -741,7 +741,7 @@ public class VolumeDialogImpl implements VolumeDialog,
        if (mShowing) {
        if (mShowing) {
            mShowing = false;
            mShowing = false;
            // Only logs when the volume dialog visibility is changed.
            // Only logs when the volume dialog visibility is changed.
            Events.writeEvent(mContext, Events.EVENT_DISMISS_DIALOG, reason);
            Events.writeEvent(Events.EVENT_DISMISS_DIALOG, reason);
        }
        }
        mDialogView.setTranslationX(0);
        mDialogView.setTranslationX(0);
        mDialogView.setAlpha(1);
        mDialogView.setAlpha(1);
@@ -1400,7 +1400,7 @@ public class VolumeDialogImpl implements VolumeDialog,
                    mController.setActiveStream(mRow.stream);
                    mController.setActiveStream(mRow.stream);
                    mController.setStreamVolume(mRow.stream, userLevel);
                    mController.setStreamVolume(mRow.stream, userLevel);
                    mRow.requestedLevel = userLevel;
                    mRow.requestedLevel = userLevel;
                    Events.writeEvent(mContext, Events.EVENT_TOUCH_LEVEL_CHANGED, mRow.stream,
                    Events.writeEvent(Events.EVENT_TOUCH_LEVEL_CHANGED, mRow.stream,
                            userLevel);
                            userLevel);
                }
                }
            }
            }
@@ -1419,7 +1419,7 @@ public class VolumeDialogImpl implements VolumeDialog,
            mRow.tracking = false;
            mRow.tracking = false;
            mRow.userAttempt = SystemClock.uptimeMillis();
            mRow.userAttempt = SystemClock.uptimeMillis();
            final int userLevel = getImpliedLevel(seekBar, seekBar.getProgress());
            final int userLevel = getImpliedLevel(seekBar, seekBar.getProgress());
            Events.writeEvent(mContext, Events.EVENT_TOUCH_LEVEL_DONE, mRow.stream, userLevel);
            Events.writeEvent(Events.EVENT_TOUCH_LEVEL_DONE, mRow.stream, userLevel);
            if (mRow.ss.level != userLevel) {
            if (mRow.ss.level != userLevel) {
                mHandler.sendMessageDelayed(mHandler.obtainMessage(H.RECHECK, mRow),
                mHandler.sendMessageDelayed(mHandler.obtainMessage(H.RECHECK, mRow),
                        USER_ATTEMPT_GRACE_PERIOD);
                        USER_ATTEMPT_GRACE_PERIOD);