Merge "Allow customization of timeout value for expanded volume dialog" into qt-qpr1-dev am: f40ed95801
Change-Id: Ib2d24171d5c1b51a541f8ef123fc928a8b1e2ff1
This commit is contained in:
@@ -37,4 +37,6 @@
|
|||||||
<!-- Timeout values in milliseconds for displaying volume dialog-->
|
<!-- Timeout values in milliseconds for displaying volume dialog-->
|
||||||
<integer name="car_volume_dialog_display_normal_timeout">3000</integer>
|
<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_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>
|
</resources>
|
||||||
|
|||||||
@@ -92,6 +92,8 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
|||||||
private final KeyguardManager mKeyguard;
|
private final KeyguardManager mKeyguard;
|
||||||
private final int mNormalTimeout;
|
private final int mNormalTimeout;
|
||||||
private final int mHoveringTimeout;
|
private final int mHoveringTimeout;
|
||||||
|
private final int mExpNormalTimeout;
|
||||||
|
private final int mExpHoveringTimeout;
|
||||||
|
|
||||||
private Window mWindow;
|
private Window mWindow;
|
||||||
private CustomDialog mDialog;
|
private CustomDialog mDialog;
|
||||||
@@ -180,6 +182,10 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
|||||||
R.integer.car_volume_dialog_display_normal_timeout);
|
R.integer.car_volume_dialog_display_normal_timeout);
|
||||||
mHoveringTimeout = mContext.getResources().getInteger(
|
mHoveringTimeout = mContext.getResources().getInteger(
|
||||||
R.integer.car_volume_dialog_display_hovering_timeout);
|
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) {
|
private static int getSeekbarValue(CarAudioManager carAudioManager, int volumeGroupId) {
|
||||||
@@ -328,8 +334,12 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private int computeTimeoutH() {
|
private int computeTimeoutH() {
|
||||||
|
if (mExpanded) {
|
||||||
|
return mHovering ? mExpHoveringTimeout : mExpNormalTimeout;
|
||||||
|
} else {
|
||||||
return mHovering ? mHoveringTimeout : mNormalTimeout;
|
return mHovering ? mHoveringTimeout : mNormalTimeout;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private void dismissH(int reason) {
|
private void dismissH(int reason) {
|
||||||
if (D.BUG) {
|
if (D.BUG) {
|
||||||
@@ -547,6 +557,7 @@ public class CarVolumeDialogImpl implements VolumeDialog {
|
|||||||
public void onClick(final View v) {
|
public void onClick(final View v) {
|
||||||
mExpandIcon = v;
|
mExpandIcon = v;
|
||||||
toggleDialogExpansion(true);
|
toggleDialogExpansion(true);
|
||||||
|
rescheduleTimeoutH();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user