use of com.android.settingslib.widget.UsageProgressBarPreference in project android_packages_apps_Settings by omnirom.
the class StorageUsageProgressBarPreferenceControllerTest method setUp.
@Before
public void setUp() throws Exception {
if (Looper.myLooper() == null) {
Looper.prepare();
}
MockitoAnnotations.initMocks(this);
mContext = spy(ApplicationProvider.getApplicationContext());
when(mContext.getSystemService(StorageStatsManager.class)).thenReturn(mStorageStatsManager);
mController = new FakeStorageUsageProgressBarPreferenceController(mContext, "key");
final PreferenceManager preferenceManager = new PreferenceManager(mContext);
mPreferenceScreen = preferenceManager.createPreferenceScreen(mContext);
final UsageProgressBarPreference usageProgressBarPreference = new UsageProgressBarPreference(mContext);
usageProgressBarPreference.setKey(mController.getPreferenceKey());
mPreferenceScreen.addPreference(usageProgressBarPreference);
}
Aggregations