use of com.android.settingslib.widget.BarChartPreference in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class PermissionBarChartPreferenceControllerTest method setUp.
@Before
public void setUp() {
MockitoAnnotations.initMocks(this);
final Context context = RuntimeEnvironment.application;
final UserManager userManager = context.getSystemService(UserManager.class);
final ShadowUserManager shadowUserManager = Shadow.extract(userManager);
final ShadowAccessibilityManager accessibilityManager = Shadow.extract(AccessibilityManager.getInstance(context));
accessibilityManager.setEnabledAccessibilityServiceList(new ArrayList<>());
shadowUserManager.addProfile(new UserInfo(123, null, 0));
when(FakeFeatureFactory.setupForTest().securityFeatureProvider.getLockPatternUtils(any(Context.class))).thenReturn(mLockPatternUtils);
mController = spy(new PermissionBarChartPreferenceController(context, "test_key"));
mFragment = spy(FragmentController.of(new PrivacyDashboardFragment()).create().start().get());
mController.setFragment(mFragment);
mPreference = spy(new BarChartPreference(context));
when(mScreen.findPreference(mController.getPreferenceKey())).thenReturn((BarChartPreference) mPreference);
}
Aggregations