Volume: Force focused state to disambig multiple sliders.
And fix volume policy so that a focused slider at the top
of the screen does not cause the window to pan.
Bug: 21476764
Change-Id: I4a52270ca5ecf9b9bd6e787ef580ecbd32e62625
diff --git a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
index 5b2eb84..065523f 100644
--- a/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
+++ b/packages/SystemUI/src/com/android/systemui/volume/VolumeDialog.java
@@ -155,6 +155,7 @@
lp.y = res.getDimensionPixelSize(R.dimen.volume_offset_top);
lp.gravity = Gravity.TOP;
window.setAttributes(lp);
+ window.setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_ADJUST_NOTHING);
mActiveSliderTint = loadColorStateList(R.color.system_accent_color);
mInactiveSliderTint = loadColorStateList(R.color.volume_slider_inactive);
@@ -670,6 +671,14 @@
}
private void updateVolumeRowSliderTintH(VolumeRow row, boolean isActive) {
+ if (isActive && mExpanded) {
+ row.slider.setFocusable(true);
+ row.slider.setFocusableInTouchMode(true);
+ row.slider.requestFocus();
+ } else {
+ row.slider.setFocusableInTouchMode(false);
+ row.slider.setFocusable(false);
+ }
final ColorStateList tint = isActive && row.slider.isEnabled() ? mActiveSliderTint
: mInactiveSliderTint;
if (tint == row.cachedSliderTint) return;