use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by crdroidandroid.
the class StorageDashboardFragment method initializeCacheProvider.
private void initializeCacheProvider() {
mCachedStorageValuesHelper = new CachedStorageValuesHelper(getContext(), UserHandle.myUserId());
initializeCachedValues();
onReceivedSizes();
}
use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by crdroidandroid.
the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfAppsMissing.
@Test
public void test_cacheProviderDoesntProvideValuesIfAppsMissing() {
CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
when(helper.getCachedPrivateStorageInfo()).thenReturn(info);
mFragment.setCachedStorageValuesHelper(helper);
mFragment.initializeCachedValues();
assertThat(mFragment.getPrivateStorageInfo()).isNull();
assertThat(mFragment.getAppsStorageResult()).isNull();
}
use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by SudaMod.
the class StorageDashboardFragmentTest method test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing.
@Test
public void test_cacheProviderDoesntProvideValuesIfVolumeInfoMissing() {
CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
when(helper.getCachedAppsStorageResult()).thenReturn(result);
mFragment.setCachedStorageValuesHelper(helper);
mFragment.initializeCachedValues();
assertThat(mFragment.getPrivateStorageInfo()).isNull();
assertThat(mFragment.getAppsStorageResult()).isNull();
}
use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project android_packages_apps_Settings by DirtyUnicorns.
the class StorageDashboardFragmentTest method test_cacheProviderProvidesValuesIfBothCached.
@Test
public void test_cacheProviderProvidesValuesIfBothCached() {
CachedStorageValuesHelper helper = mock(CachedStorageValuesHelper.class);
PrivateStorageInfo info = new PrivateStorageInfo(0, 0);
when(helper.getCachedPrivateStorageInfo()).thenReturn(info);
SparseArray<StorageAsyncLoader.AppsStorageResult> result = new SparseArray<>();
when(helper.getCachedAppsStorageResult()).thenReturn(result);
mFragment.setCachedStorageValuesHelper(helper);
mFragment.initializeCachedValues();
assertThat(mFragment.getPrivateStorageInfo()).isEqualTo(info);
assertThat(mFragment.getAppsStorageResult()).isEqualTo(result);
}
use of com.android.settings.deviceinfo.storage.CachedStorageValuesHelper in project platform_packages_apps_Settings by BlissRoms.
the class StorageDashboardFragment method initializeCacheProvider.
private void initializeCacheProvider() {
mCachedStorageValuesHelper = new CachedStorageValuesHelper(getContext(), UserHandle.myUserId());
initializeCachedValues();
onReceivedSizes();
}
Aggregations