Add the jank detection to Settings toggles

Add jank detection when click the following preferences,
 - SwitchPreference
   Single target, detect click in InstrumentedPreferenceFragment
 - PrimarySwitchPreference
   Two target, only detect click switch in switch's onClick()
 - MainSwitchPreference
   Single target, detect click in TogglePreferenceController
 - SettingsMainSwitchPreference
   Single target, detect click in its onSwitchChanged()

Bug: 230285829
Test: manual & robo tests
Change-Id: I97a13e05a601237b16cd2d903ba2fb6ec4a69a74
This commit is contained in:
Chaohui Wang
2022-05-06 01:17:20 +08:00
parent 72642fa03d
commit 692068d535
6 changed files with 46 additions and 4 deletions

View File

@@ -23,6 +23,10 @@ import com.android.internal.jank.InteractionJankMonitor;
import org.robolectric.annotation.Implementation;
import org.robolectric.annotation.Implements;
/**
* @deprecated use {@link com.android.settingslib.testutils.shadow.ShadowInteractionJankMonitor}
*/
@Deprecated
@Implements(InteractionJankMonitor.class)
public class ShadowInteractionJankMonitor {