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

Commit 08e23d3c authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Allow customization of timeout value for expanded volume dialog" into...

Merge "Allow customization of timeout value for expanded volume dialog" into qt-qpr1-dev am: f40ed958

Change-Id: Ib2d24171d5c1b51a541f8ef123fc928a8b1e2ff1
parents 1bad2fbc f40ed958
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -37,4 +37,6 @@
    <!-- Timeout values in milliseconds for displaying volume dialog-->
    <integer name="car_volume_dialog_display_normal_timeout">3000</integer>
    <integer name="car_volume_dialog_display_hovering_timeout">16000</integer>
    <integer name="car_volume_dialog_display_expanded_normal_timeout">6000</integer>
    <integer name="car_volume_dialog_display_expanded_hovering_timeout">32000</integer>
</resources>
+12 −1
Original line number Diff line number Diff line
@@ -92,6 +92,8 @@ public class CarVolumeDialogImpl implements VolumeDialog {
    private final KeyguardManager mKeyguard;
    private final int mNormalTimeout;
    private final int mHoveringTimeout;
    private final int mExpNormalTimeout;
    private final int mExpHoveringTimeout;

    private Window mWindow;
    private CustomDialog mDialog;
@@ -180,6 +182,10 @@ public class CarVolumeDialogImpl implements VolumeDialog {
                R.integer.car_volume_dialog_display_normal_timeout);
        mHoveringTimeout = mContext.getResources().getInteger(
                R.integer.car_volume_dialog_display_hovering_timeout);
        mExpNormalTimeout = mContext.getResources().getInteger(
                R.integer.car_volume_dialog_display_expanded_normal_timeout);
        mExpHoveringTimeout = mContext.getResources().getInteger(
                R.integer.car_volume_dialog_display_expanded_hovering_timeout);
    }

    private static int getSeekbarValue(CarAudioManager carAudioManager, int volumeGroupId) {
@@ -328,8 +334,12 @@ public class CarVolumeDialogImpl implements VolumeDialog {
    }

    private int computeTimeoutH() {
        if (mExpanded) {
            return mHovering ? mExpHoveringTimeout : mExpNormalTimeout;
        } else {
            return mHovering ? mHoveringTimeout : mNormalTimeout;
        }
    }

    private void dismissH(int reason) {
        if (D.BUG) {
@@ -547,6 +557,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
        public void onClick(final View v) {
            mExpandIcon = v;
            toggleDialogExpansion(true);
            rescheduleTimeoutH();
        }
    }