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:
@@ -15,6 +15,8 @@ import android.provider.Settings.Global;
|
||||
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
|
||||
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
@@ -22,8 +24,10 @@ import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = {ShadowInteractionJankMonitor.class})
|
||||
public class BatterySaverScheduleSeekBarControllerTest {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -10,6 +10,7 @@ import android.os.PowerManager;
|
||||
import android.provider.Settings;
|
||||
|
||||
import com.android.settings.testutils.FakeFeatureFactory;
|
||||
import com.android.settings.testutils.shadow.ShadowInteractionJankMonitor;
|
||||
import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
|
||||
|
||||
import org.junit.Before;
|
||||
@@ -17,8 +18,10 @@ import org.junit.Test;
|
||||
import org.junit.runner.RunWith;
|
||||
import org.robolectric.RobolectricTestRunner;
|
||||
import org.robolectric.RuntimeEnvironment;
|
||||
import org.robolectric.annotation.Config;
|
||||
|
||||
@RunWith(RobolectricTestRunner.class)
|
||||
@Config(shadows = {ShadowInteractionJankMonitor.class})
|
||||
public final class BatterySaverScheduleSettingsTest {
|
||||
|
||||
private Context mContext;
|
||||
|
||||
Reference in New Issue
Block a user