Stop the ringtone when other seek bar is adjust

- Stop the ringtone when other seek bar is adjust.
- Add test to verify when onStartTrackingTouch() is called,
  will call stopSample().

Bug: 80194851
Test: make -j42 RunSettingsRoboTests
Change-Id: I2300f0f56340c3698f62cc911bda7b7a94d23a7a
This commit is contained in:
Hugh Chen
2020-08-26 14:32:53 +08:00
parent b96878a81a
commit 432d0737e0
2 changed files with 20 additions and 4 deletions

View File

@@ -204,10 +204,6 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
@Override
public void onSampleStarting(SeekBarVolumizer sbv) {
if (mCurrent != null && mCurrent != sbv) {
mCurrent.stopSample();
}
mCurrent = sbv;
if (mCurrent != null) {
mHandler.removeMessages(STOP_SAMPLE);
mHandler.sendEmptyMessageDelayed(STOP_SAMPLE, SAMPLE_CUTOFF);
@@ -222,6 +218,15 @@ public class SoundSettings extends DashboardFragment implements OnActivityResult
}
}
@Override
public void onStartTrackingTouch(SeekBarVolumizer sbv) {
// stop the ringtone when other seek bar is adjust
if (mCurrent != null && mCurrent != sbv) {
mCurrent.stopSample();
}
mCurrent = sbv;
}
public void stopSample() {
if (mCurrent != null) {
mCurrent.stopSample();