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

Commit 3c6f25e1 authored by Jacqueline Bronger's avatar Jacqueline Bronger
Browse files

Don't animate volume slider on TV

Animation leads to high CPU usage during already resource intensive
video playback.

Bug: 329120328
Test: manual - change volume via remote control and observe
Flag: none

Change-Id: I5fbd44952d0a7f8d57a1c7e19f7c081a4a259da1
parent 0d819757
Loading
Loading
Loading
Loading
+9 −4
Original line number Diff line number Diff line
@@ -285,7 +285,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
    @GuardedBy("mSafetyWarningLock")
    private CsdWarningDialog mCsdDialog;
    private boolean mHovering = false;
    private final boolean mShowActiveStreamOnly;
    private final boolean mIsTv;
    private boolean mConfigChanged = false;
    private boolean mIsAnimatingDismiss = false;
    private boolean mHasSeenODICaptionsTooltip;
@@ -346,7 +346,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        mConfigurationController = configurationController;
        mMediaOutputDialogManager = mediaOutputDialogManager;
        mCsdWarningDialogFactory = csdWarningDialogFactory;
        mShowActiveStreamOnly = showActiveStreamOnly();
        mIsTv = isTv();
        mHasSeenODICaptionsTooltip =
                Prefs.getBoolean(context, Prefs.Key.HAS_SEEN_ODI_CAPTIONS_TOOLTIP, false);
        mShowLowMediaVolumeIcon =
@@ -1635,7 +1635,7 @@ public class VolumeDialogImpl implements VolumeDialog, Dumpable,
        Trace.endSection();
    }

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

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