use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project platform_packages_apps_Settings by BlissRoms.
the class CachedStorageValuesHelperTest method getCachedPrivateStorageInfo_nullIfEmpty.
@Test
public void getCachedPrivateStorageInfo_nullIfEmpty() throws Exception {
PrivateStorageInfo info = mCachedValuesHelper.getCachedPrivateStorageInfo();
assertThat(info).isNull();
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project platform_packages_apps_Settings by BlissRoms.
the class VolumeSizesLoaderTest method getVolumeSize_getsValidSizes.
@Test
public void getVolumeSize_getsValidSizes() throws Exception {
VolumeInfo info = mock(VolumeInfo.class);
StorageVolumeProvider storageVolumeProvider = mock(StorageVolumeProvider.class);
when(storageVolumeProvider.getTotalBytes(any(), any())).thenReturn(10000L);
when(storageVolumeProvider.getFreeBytes(any(), any())).thenReturn(1000L);
PrivateStorageInfo storageInfo = VolumeSizesLoader.getVolumeSize(storageVolumeProvider, null, info);
assertThat(storageInfo.freeBytes).isEqualTo(1000L);
assertThat(storageInfo.totalBytes).isEqualTo(10000L);
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LowStorageSliceTest method getSlice_lowStorage_shouldNotHaveErrorHint.
@Test
@Config(shadows = ShadowPrivateStorageInfo.class)
public void getSlice_lowStorage_shouldNotHaveErrorHint() {
ShadowPrivateStorageInfo.setPrivateStorageInfo(new PrivateStorageInfo(10L, 100L));
final Slice slice = mLowStorageSlice.getSlice();
assertThat(slice.hasHint(HINT_ERROR)).isFalse();
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LowStorageSliceTest method getSlice_lowStorage_shouldHaveStorageFreeTitle.
@Test
@Config(shadows = ShadowPrivateStorageInfo.class)
public void getSlice_lowStorage_shouldHaveStorageFreeTitle() {
ShadowPrivateStorageInfo.setPrivateStorageInfo(new PrivateStorageInfo(10L, 100L));
final Slice slice = mLowStorageSlice.getSlice();
final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.storage_menu_free));
}
use of com.android.settingslib.deviceinfo.PrivateStorageInfo in project Resurrection_packages_apps_Settings by ResurrectionRemix.
the class LowStorageSliceTest method getSlice_storageFree_shouldHaveErrorHint.
@Test
@Config(shadows = ShadowPrivateStorageInfo.class)
public void getSlice_storageFree_shouldHaveErrorHint() {
ShadowPrivateStorageInfo.setPrivateStorageInfo(new PrivateStorageInfo(100L, 100L));
final Slice slice = mLowStorageSlice.getSlice();
assertThat(slice.hasHint(HINT_ERROR)).isTrue();
}
Aggregations