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

Commit 3f92a5be 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 am: 08e23d3c

Change-Id: Id1f7f972d3dd27cd2ed2373689d944419dbcda10
parents ee7d195f 08e23d3c
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -32,4 +32,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
@@ -90,6 +90,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;
@@ -176,6 +178,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);
    }

    /** Sets a {@link CarServiceProvider} which connects to the audio service. */
@@ -313,8 +319,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) {
@@ -532,6 +542,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
        public void onClick(final View v) {
            mExpandIcon = v;
            toggleDialogExpansion(true);
            rescheduleTimeoutH();
        }
    }