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

Commit 63c2e779 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Don't animate volume slider on TV" into main

parents 6b591573 3c6f25e1
Loading
Loading
Loading
Loading
+9 −4
Original line number Original line Diff line number Diff line
@@ -282,7 +282,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
    @GuardedBy("mSafetyWarningLock")
    @GuardedBy("mSafetyWarningLock")
    private CsdWarningDialog mCsdDialog;
    private CsdWarningDialog mCsdDialog;
    private boolean mHovering = false;
    private boolean mHovering = false;
    private final boolean mShowActiveStreamOnly;
    private final boolean mIsTv;
    private boolean mConfigChanged = false;
    private boolean mConfigChanged = false;
    private boolean mIsAnimatingDismiss = false;
    private boolean mIsAnimatingDismiss = false;
    private boolean mHasSeenODICaptionsTooltip;
    private boolean mHasSeenODICaptionsTooltip;
@@ -343,7 +343,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        mConfigurationController = configurationController;
        mConfigurationController = configurationController;
        mMediaOutputDialogManager = mediaOutputDialogManager;
        mMediaOutputDialogManager = mediaOutputDialogManager;
        mCsdWarningDialogFactory = csdWarningDialogFactory;
        mCsdWarningDialogFactory = csdWarningDialogFactory;
        mShowActiveStreamOnly = showActiveStreamOnly();
        mIsTv = isTv();
        mHasSeenODICaptionsTooltip =
        mHasSeenODICaptionsTooltip =
                Prefs.getBoolean(context, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false);
                Prefs.getBoolean(context, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false);
        mShowLowMediaVolumeIcon =
        mShowLowMediaVolumeIcon =
@@ -1632,7 +1632,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        Trace.endSection();
        Trace.endSection();
    }
    }


    private boolean showActiveStreamOnly() {
    private boolean isTv() {
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
        return mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_LEANBACK)
                || mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
                || mContext.getPackageManager().hasSystemFeature(PackageManager.FEATURE_TELEVISION);
    }
    }
@@ -1644,7 +1644,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
            return true;
            return true;
        }
        }


        if (!mShowActiveStreamOnly) {
        if (!mIsTv) {
            if (row.stream == AudioSystem.STREAM_ACCESSIBILITY) {
            if (row.stream == AudioSystem.STREAM_ACCESSIBILITY) {
                return mShowA11yStream;
                return mShowA11yStream;
            }
            }
@@ -2089,6 +2089,11 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        }
        }
        final int newProgress = getProgressFromVolume(row.ss, row.slider, vlevel);
        final int newProgress = getProgressFromVolume(row.ss, row.slider, vlevel);
        if (progress != newProgress) {
        if (progress != newProgress) {
            if (mIsTv) {
                // don't animate slider on TVs
                row.slider.setProgress(newProgress, false);
                return;
            }
            if (mShowing && rowVisible) {
            if (mShowing && rowVisible) {
                // animate!
                // animate!
                if (row.anim != null && row.anim.isRunning()
                if (row.anim != null && row.anim.isRunning()