Search in sources :

Example 1 with UsageProgressBarPreference

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);
}
Also used : UsageProgressBarPreference(com.android.settingslib.widget.UsageProgressBarPreference) PreferenceManager(androidx.preference.PreferenceManager) Before(org.junit.Before)

Aggregations

PreferenceManager (androidx.preference.PreferenceManager)1 UsageProgressBarPreference (com.android.settingslib.widget.UsageProgressBarPreference)1 Before (org.junit.Before)1