Enforce min value on panel slices slider

We did not set the min value on slider slices when converting them
from preference to slices, which makes the slices all have min 0.
However, there are some slider which should have min value greater
than 0, for example, call and alarm.

We should get the min value and apply it to slider slice to make it
consistent with what we have in settings pref.

Test: Manual verification
Test: make -j40 RunSettingRobotests
Test: atest VolumeSeekBarPreferenceControllerTest
Fixes: 130439216
Fixes: 130358208
Change-Id: Ib4399c36c7da3ac41a6d46a6c150f0ec1b9b0b0f
This commit is contained in:
lindatseng
2019-04-15 15:51:07 -07:00
committed by Linda Tseng
parent 96b534951c
commit fadedb321c
14 changed files with 108 additions and 30 deletions

View File

@@ -92,13 +92,21 @@ public abstract class VolumeSeekBarPreferenceController extends
}
@Override
public int getMaxSteps() {
public int getMax() {
if (mPreference != null) {
return mPreference.getMax();
}
return mHelper.getMaxVolume(getAudioStream());
}
@Override
public int getMin() {
if (mPreference != null) {
return mPreference.getMin();
}
return mHelper.getMinVolume(getAudioStream());
}
protected abstract int getAudioStream();
protected abstract int getMuteIcon();