Add the jank detection to Settings sliders

- Currently most the sliders are implemented by
   com.android.settings.widget.SeekBarPreference.
 - Volume ones are implemented by VolumeSeekBarPreference, which resets
   the OnSeekBarChangeListener, so need special handling.
 - PointerSpeedPreference is standalone, added separately.

Bug: 230285829
Test: Verify trace via jank developer guideline.
Change-Id: Ia2978df196676ad6675d2834f6af6cb2aa9094cf
This commit is contained in:
Chaohui Wang
2022-04-26 20:04:39 +08:00
parent 8f463f5c88
commit f311566b85
19 changed files with 77 additions and 4 deletions

View File

@@ -27,6 +27,7 @@ import androidx.preference.PreferenceScreen;
import androidx.test.core.app.ApplicationProvider;
import com.android.settings.display.PreviewPagerAdapter;
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
import com.android.settings.widget.LabeledSeekBarPreference;
import org.junit.Before;
@@ -45,7 +46,7 @@ import java.util.List;
* Tests for {@link TextReadingPreviewController}.
*/
@RunWith(RobolectricTestRunner.class)
@Config(shadows = ShadowChoreographer.class)
@Config(shadows = {ShadowChoreographer.class, ShadowInteractionJankMonitor.class})
public class TextReadingPreviewControllerTest {
private static final String PREVIEW_KEY = "preview";
private static final String FONT_SIZE_KEY = "font_size";