Add a clarifying comment

Bug: 130332550
Test: no test
Change-Id: If6dea9b5deab35f8c2da1019c17be80bbf1c5fd8
This commit is contained in:
Alexey Kuzmin
2019-05-17 16:51:18 +01:00
parent 1a82d653f7
commit 14d8412455

View File

@@ -129,6 +129,13 @@ public abstract class VibrationPreferenceFragment extends RadioButtonPickerFragm
Settings.System.putInt(getContext().getContentResolver(), Settings.System.putInt(getContext().getContentResolver(),
getVibrationIntensitySetting(), candidate.getIntensity()); getVibrationIntensitySetting(), candidate.getIntensity());
} else { } else {
// We can't play preview effect here for all cases because that causes a data race
// (VibratorService may access intensity settings before these settings are updated).
// But we can't just play it in intensity settings update observer, because the
// intensity settings are not changed if we turn the vibration off, then on.
//
// In this case we sould play the preview here.
// To be refactored in b/132952771
playVibrationPreview(); playVibrationPreview();
} }
} }