Home
last modified time | relevance | path

Searched refs:VolumeInfo (Results 1 – 25 of 102) sorted by relevance

12345

/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/storage/
DStorageUtilsTest.java19 import static android.os.storage.VolumeInfo.STATE_MOUNTED;
27 import android.os.storage.VolumeInfo;
51 VolumeInfo volumeInfo = new VolumeInfo("id", VolumeInfo.TYPE_PRIVATE, null, "id"); in maybeInitializeVolume_mounted_shouldReturnVolumeInfo()
54 when(mStorageManager.findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL)).thenReturn(volumeInfo); in maybeInitializeVolume_mounted_shouldReturnVolumeInfo()
56 VolumeInfo expected = StorageUtils.maybeInitializeVolume(mStorageManager, null); in maybeInitializeVolume_mounted_shouldReturnVolumeInfo()
63 VolumeInfo volumeInfo = new VolumeInfo("id", VolumeInfo.TYPE_PRIVATE, null, "id"); in maybeInitializeVolume_notMounted_shouldNotReturnVolumeInfo()
65 when(mStorageManager.findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL)).thenReturn(volumeInfo); in maybeInitializeVolume_notMounted_shouldNotReturnVolumeInfo()
67 VolumeInfo expected = StorageUtils.maybeInitializeVolume(mStorageManager, null); in maybeInitializeVolume_notMounted_shouldNotReturnVolumeInfo()
74 VolumeInfo volumeInfo = new VolumeInfo("id", VolumeInfo.TYPE_EMULATED, null, "id"); in maybeInitializeVolume_differentType_shouldNotReturnVolumeInfo()
76 when(mStorageManager.findVolumeById(VolumeInfo.ID_PRIVATE_INTERNAL)).thenReturn(volumeInfo); in maybeInitializeVolume_differentType_shouldNotReturnVolumeInfo()
[all …]
/packages/apps/Settings/src/com/android/settings/deviceinfo/
DStorageSettings.java33 import android.os.storage.VolumeInfo;
121 public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
133 private static boolean isInteresting(VolumeInfo vol) { in isInteresting()
135 case VolumeInfo.TYPE_PRIVATE: in isInteresting()
136 case VolumeInfo.TYPE_PUBLIC: in isInteresting()
137 case VolumeInfo.TYPE_STUB: in isInteresting()
158 final List<VolumeInfo> volumes = mStorageManager.getVolumes(); in refresh()
159 Collections.sort(volumes, VolumeInfo.getDescriptionComparator()); in refresh()
161 for (VolumeInfo vol : volumes) { in refresh()
162 if (vol.getType() == VolumeInfo.TYPE_PRIVATE) { in refresh()
[all …]
DStorageVolumePreference.java25 import android.os.storage.VolumeInfo;
51 private final VolumeInfo mVolume;
57 public StorageVolumePreference(Context context, VolumeInfo volume, long totalBytes) { in StorageVolumePreference()
70 if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(volume.getId())) { in StorageVolumePreference()
82 if (volume.getType() == VolumeInfo.TYPE_PRIVATE) { in StorageVolumePreference()
123 if (volume.getType() == VolumeInfo.TYPE_PUBLIC in StorageVolumePreference()
137 if (mVolume.getType() == VolumeInfo.TYPE_PRIVATE && mUsedPercent != -1) { in onBindViewHolder()
DPrivateVolumeOptionMenuController.java22 import android.os.storage.VolumeInfo;
43 private VolumeInfo mVolumeInfo;
47 Context context, VolumeInfo volumeInfo, PackageManager packageManager) { in PrivateVolumeOptionMenuController()
65 final VolumeInfo privateVol = mPm.getPrimaryStorageCurrentVolume(); in onPrepareOptionsMenu()
69 && (privateVol.getType() == VolumeInfo.TYPE_PRIVATE) in onPrepareOptionsMenu()
79 intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolumeInfo.getId()); in onOptionsItemSelected()
DPrivateVolumeSettings.java35 import android.os.storage.VolumeInfo;
113 private VolumeInfo mVolume;
114 private VolumeInfo mSharedVolume;
133 return (mVolume != null) && (mVolume.getType() == VolumeInfo.TYPE_PRIVATE) in isVolumeValid()
155 mVolumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
397 if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolume.getId())) { in onPrepareOptionsMenu()
405 rename.setVisible(mVolume.getType() == VolumeInfo.TYPE_PRIVATE); in onPrepareOptionsMenu()
406 mount.setVisible(mVolume.getState() == VolumeInfo.STATE_UNMOUNTED); in onPrepareOptionsMenu()
415 final VolumeInfo privateVol = getActivity().getPackageManager() in onPrepareOptionsMenu()
418 && (privateVol.getType() == VolumeInfo.TYPE_PRIVATE) in onPrepareOptionsMenu()
[all …]
/packages/services/Car/tests/CarDeveloperOptions/src/com/android/car/developeroptions/deviceinfo/
DStorageSettings.java33 import android.os.storage.VolumeInfo;
121 public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
133 private static boolean isInteresting(VolumeInfo vol) { in isInteresting()
135 case VolumeInfo.TYPE_PRIVATE: in isInteresting()
136 case VolumeInfo.TYPE_PUBLIC: in isInteresting()
137 case VolumeInfo.TYPE_STUB: in isInteresting()
158 final List<VolumeInfo> volumes = mStorageManager.getVolumes(); in refresh()
159 Collections.sort(volumes, VolumeInfo.getDescriptionComparator()); in refresh()
161 for (VolumeInfo vol : volumes) { in refresh()
162 if (vol.getType() == VolumeInfo.TYPE_PRIVATE) { in refresh()
[all …]
DPrivateVolumeOptionMenuController.java22 import android.os.storage.VolumeInfo;
43 private VolumeInfo mVolumeInfo;
47 Context context, VolumeInfo volumeInfo, PackageManager packageManager) { in PrivateVolumeOptionMenuController()
65 final VolumeInfo privateVol = mPm.getPrimaryStorageCurrentVolume(); in onPrepareOptionsMenu()
69 && (privateVol.getType() == VolumeInfo.TYPE_PRIVATE) in onPrepareOptionsMenu()
79 intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, mVolumeInfo.getId()); in onOptionsItemSelected()
DStorageVolumePreference.java25 import android.os.storage.VolumeInfo;
51 private final VolumeInfo mVolume;
57 public StorageVolumePreference(Context context, VolumeInfo volume, long totalBytes) { in StorageVolumePreference()
70 if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(volume.getId())) { in StorageVolumePreference()
82 if (volume.getType() == VolumeInfo.TYPE_PRIVATE) { in StorageVolumePreference()
123 if (volume.getType() == VolumeInfo.TYPE_PUBLIC in StorageVolumePreference()
138 if (mVolume.getType() == VolumeInfo.TYPE_PRIVATE && mUsedPercent != -1) { in onBindViewHolder()
DPrivateVolumeSettings.java35 import android.os.storage.VolumeInfo;
113 private VolumeInfo mVolume;
114 private VolumeInfo mSharedVolume;
133 return (mVolume != null) && (mVolume.getType() == VolumeInfo.TYPE_PRIVATE) in isVolumeValid()
155 mVolumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
397 if (VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolume.getId())) { in onPrepareOptionsMenu()
405 rename.setVisible(mVolume.getType() == VolumeInfo.TYPE_PRIVATE); in onPrepareOptionsMenu()
406 mount.setVisible(mVolume.getState() == VolumeInfo.STATE_UNMOUNTED); in onPrepareOptionsMenu()
415 final VolumeInfo privateVol = getActivity().getPackageManager() in onPrepareOptionsMenu()
418 && (privateVol.getType() == VolumeInfo.TYPE_PRIVATE) in onPrepareOptionsMenu()
[all …]
DStorageWizardBase.java20 import static android.os.storage.VolumeInfo.EXTRA_VOLUME_ID;
34 import android.os.storage.VolumeInfo;
64 protected VolumeInfo mVolume;
236 protected VolumeInfo findFirstVolume(int type) { in findFirstVolume()
240 protected VolumeInfo findFirstVolume(int type, int attempts) { in findFirstVolume()
242 final List<VolumeInfo> vols = mStorage.getVolumes(); in findFirstVolume()
243 for (VolumeInfo vol : vols) { in findFirstVolume()
245 && (vol.getState() == VolumeInfo.STATE_MOUNTED)) { in findFirstVolume()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/device/storage/
DDiskReceiver.java28 import android.os.storage.VolumeInfo;
67 if (TextUtils.equals(intent.getAction(), VolumeInfo.ACTION_VOLUME_STATE_CHANGED)) { in onReceive()
68 final int state = intent.getIntExtra(VolumeInfo.EXTRA_VOLUME_STATE, -1); in onReceive()
69 if (state == VolumeInfo.STATE_MOUNTED in onReceive()
70 || state == VolumeInfo.STATE_MOUNTED_READ_ONLY) { in onReceive()
72 } else if (state == VolumeInfo.STATE_UNMOUNTED in onReceive()
73 || state == VolumeInfo.STATE_BAD_REMOVAL) { in onReceive()
83 final String volumeId = intent.getStringExtra(VolumeInfo.EXTRA_VOLUME_ID); in handleMount()
85 final List<VolumeInfo> volumeInfos = mStorageManager.getVolumes(); in handleMount()
86 for (final VolumeInfo info : volumeInfos) { in handleMount()
[all …]
DSettingsStorageService.java24 import android.os.storage.VolumeInfo;
68 intent.putExtra(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in unmount()
105 final String volumeId = intent.getStringExtra(VolumeInfo.EXTRA_VOLUME_ID); in onHandleIntent()
119 final List<VolumeInfo> volumes = storageManager.getVolumes(); in formatAsPublic()
120 for (final VolumeInfo volume : volumes) { in formatAsPublic()
122 volume.getType() == VolumeInfo.TYPE_PRIVATE) { in formatAsPublic()
148 final VolumeInfo privateVol = findPrivateVolume(storageManager, diskId); in formatAsPrivate()
171 private VolumeInfo findPrivateVolume(@NonNull StorageManager storageManager, in findPrivateVolume()
173 final List<VolumeInfo> vols = storageManager.getVolumes(); in findPrivateVolume()
174 for (final VolumeInfo vol : vols) { in findPrivateVolume()
[all …]
DFormatActivity.java29 import android.os.storage.VolumeInfo;
126 final VolumeInfo volumeInfo = findVolume(mFormatAsPrivateDiskId); in onResume()
127 if (volumeInfo != null && volumeInfo.getType() == VolumeInfo.TYPE_PRIVATE) { in onResume()
141 private VolumeInfo findVolume(String diskId) { in findVolume()
142 final List<VolumeInfo> vols = mStorageManager.getVolumes(); in findVolume()
143 for (final VolumeInfo vol : vols) { in findVolume()
145 && (vol.getType() == VolumeInfo.TYPE_PRIVATE)) { in findVolume()
246 final List<VolumeInfo> volumes = mStorageManager.getVolumes(); in onRequestFormatAsPrivate()
247 for (final VolumeInfo volume : volumes) { in onRequestFormatAsPrivate()
248 if ((volume.getType() == VolumeInfo.TYPE_PRIVATE || in onRequestFormatAsPrivate()
[all …]
DStorageFragment.java24 import android.os.storage.VolumeInfo;
61 private VolumeInfo mVolumeInfo;
79 public static void prepareArgs(Bundle bundle, VolumeInfo volumeInfo) { in prepareArgs()
80 bundle.putString(VolumeInfo.EXTRA_VOLUME_ID, volumeInfo.getId()); in prepareArgs()
89 getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID)); in onCreate()
105 getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID)); in onResume()
142 final VolumeInfo currentExternal = mPackageManager.getPrimaryStorageCurrentVolume(); in refresh()
147 final List<VolumeInfo> candidates = in refresh()
149 for (final VolumeInfo candidate : candidates) { in refresh()
163 final boolean privateInternal = VolumeInfo.ID_PRIVATE_INTERNAL.equals(mVolumeInfo.getId()); in refresh()
[all …]
DNewStorageActivity.java28 import android.os.storage.VolumeInfo;
56 i.putExtra(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in getNewStorageLaunchIntent()
87 final String volumeId = getIntent().getStringExtra(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
119 public void onVolumeStateChanged(VolumeInfo vol, int oldState, int newState) {
126 b.putString(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in newInstance()
136 mVolumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
143 final VolumeInfo info = storageManager.findVolumeById(mVolumeId); in onCreate()
247 final List<VolumeInfo> volumeInfos = storageManager.getVolumes(); in checkForUnmount()
249 for (VolumeInfo volumeInfo : volumeInfos) { in checkForUnmount()
270 if (TextUtils.equals(intent.getAction(), VolumeInfo.ACTION_VOLUME_STATE_CHANGED)) {
[all …]
DMigrateStorageActivity.java26 import android.os.storage.VolumeInfo;
54 private VolumeInfo mTargetVolumeInfo;
55 private VolumeInfo mVolumeInfo;
79 i.putExtra(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in getLaunchIntent()
89 final String volumeId = intent.getStringExtra(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
140 private void onChoose(VolumeInfo volumeInfo) { in onChoose()
240 private List<VolumeInfo> mCandidateVolumes;
242 public static ChooseStorageStepFragment newInstance(VolumeInfo currentVolumeInfo) { in newInstance()
244 args.putString(VolumeInfo.EXTRA_VOLUME_ID, currentVolumeInfo.getId()); in newInstance()
268 final String volumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID); in onCreateActions()
[all …]
DUnmountActivity.java28 import android.os.storage.VolumeInfo;
59 i.putExtra(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in getIntent()
68 mUnmountVolumeId = getIntent().getStringExtra(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
76 final VolumeInfo volumeInfo = storageManager.findVolumeById(mUnmountVolumeId); in onCreate()
84 if (volumeInfo.getType() == VolumeInfo.TYPE_PRIVATE) { in onCreate()
120 final VolumeInfo volumeInfo = in onResume()
134 && TextUtils.equals(intent.getStringExtra(VolumeInfo.EXTRA_VOLUME_ID), in onReceive()
159 b.putString(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in newInstance()
DBackupAppsStepFragment.java25 import android.os.storage.VolumeInfo;
66 b.putString(VolumeInfo.EXTRA_VOLUME_ID, volumeId); in newInstance()
77 mVolumeId = getArguments().getString(VolumeInfo.EXTRA_VOLUME_ID); in onCreate()
78 final VolumeInfo info = mStorageManager.findVolumeById(mVolumeId); in onCreate()
124 final VolumeInfo volumeInfo = mStorageManager.findVolumeById(mVolumeId); in onCreateGuidance()
155 final VolumeInfo currentExternal = mPackageManager.getPrimaryStorageCurrentVolume(); in getAppActions()
160 final List<VolumeInfo> candidates = in getAppActions()
162 for (final VolumeInfo candidate : candidates) { in getAppActions()
/packages/apps/TvSettings/Settings/src/com/android/tv/settings/device/
DStorageSummaryFragment.java24 import android.os.storage.VolumeInfo;
118 final List<VolumeInfo> volumes = mStorageManager.getVolumes(); in refresh()
119 volumes.sort(VolumeInfo.getDescriptionComparator()); in refresh()
121 final List<VolumeInfo> privateVolumes = new ArrayList<>(volumes.size()); in refresh()
122 final List<VolumeInfo> publicVolumes = new ArrayList<>(volumes.size()); in refresh()
125 for (final VolumeInfo vol : volumes) { in refresh()
126 if (vol.getType() == VolumeInfo.TYPE_PRIVATE) { in refresh()
128 } else if (vol.getType() == VolumeInfo.TYPE_PUBLIC) { in refresh()
140 if (record.getType() == VolumeInfo.TYPE_PRIVATE in refresh()
161 for (final VolumeInfo volumeInfo : privateVolumes) { in refresh()
[all …]
/packages/apps/TvSettings/Settings/tests/robotests/src/com/android/tv/settings/device/storage/
DSettingsStorageServiceTest.java33 import android.os.storage.VolumeInfo;
70 final VolumeInfo volumeInfo = mock(VolumeInfo.class); in testFormatAsPublic_success_fromPrivate()
72 doReturn(VolumeInfo.TYPE_PRIVATE).when(volumeInfo).getType(); in testFormatAsPublic_success_fromPrivate()
75 final List<VolumeInfo> volumeInfos = new ArrayList<>(1); in testFormatAsPublic_success_fromPrivate()
100 final VolumeInfo volumeInfo = mock(VolumeInfo.class); in testFormatAsPublic_success_fromNonPrivate()
102 doReturn(VolumeInfo.TYPE_PUBLIC).when(volumeInfo).getType(); in testFormatAsPublic_success_fromNonPrivate()
105 final List<VolumeInfo> volumeInfos = new ArrayList<>(1); in testFormatAsPublic_success_fromNonPrivate()
130 final List<VolumeInfo> volumeInfos = new ArrayList<>(0); in testFormatAsPublic_failure()
156 final VolumeInfo volumeInfo = mock(VolumeInfo.class); in testFormatAsPrivate_success()
157 doReturn(VolumeInfo.TYPE_PRIVATE).when(volumeInfo).getType(); in testFormatAsPrivate_success()
[all …]
/packages/apps/Car/Settings/src/com/android/car/settings/storage/
DStorageUtils.java22 import android.os.storage.VolumeInfo;
34 public static VolumeInfo maybeInitializeVolume(StorageManager sm, @Nullable Bundle bundle) { in maybeInitializeVolume()
35 String volumeId = VolumeInfo.ID_PRIVATE_INTERNAL; in maybeInitializeVolume()
37 volumeId = bundle.getString(VolumeInfo.EXTRA_VOLUME_ID, in maybeInitializeVolume()
38 VolumeInfo.ID_PRIVATE_INTERNAL); in maybeInitializeVolume()
41 VolumeInfo volume = sm.findVolumeById(volumeId); in maybeInitializeVolume()
45 private static boolean isVolumeValid(VolumeInfo volume) { in isVolumeValid()
46 return (volume != null) && (volume.getType() == VolumeInfo.TYPE_PRIVATE) in isVolumeValid()
/packages/apps/Settings/tests/robotests/src/com/android/settings/deviceinfo/
DStorageSettingsTest.java28 import android.os.storage.VolumeInfo;
50 private List<VolumeInfo> mVolumes;
56 mVolumes.add(mock(VolumeInfo.class, RETURNS_DEEP_STUBS)); in setUp()
62 VolumeInfo volumeInfo = mock(VolumeInfo.class, RETURNS_DEEP_STUBS); in handlePublicVolumeClick_startsANonNullActivityWhenVolumeHasNoBrowse()
72 VolumeInfo volumeInfo = mock(VolumeInfo.class, RETURNS_DEEP_STUBS); in handleStubVolumeClick_startsANonNullActivityWhenVolumeHasNoBrowse()
DTopLevelStoragePreferenceControllerTest.java29 import android.os.storage.VolumeInfo;
55 private List<VolumeInfo> mVolumes;
63 mVolumes.add(mock(VolumeInfo.class, RETURNS_DEEP_STUBS)); in setUp()
71 final VolumeInfo volumeInfo = mVolumes.get(0); in updateSummary_shouldDisplayUsedPercentAndFreeSpace()
73 when(volumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE); in updateSummary_shouldDisplayUsedPercentAndFreeSpace()
75 .getTotalBytes(nullable(StorageStatsManager.class), nullable(VolumeInfo.class))) in updateSummary_shouldDisplayUsedPercentAndFreeSpace()
78 .getFreeBytes(nullable(StorageStatsManager.class), nullable(VolumeInfo.class))) in updateSummary_shouldDisplayUsedPercentAndFreeSpace()
/packages/apps/StorageManager/robotests/src/com/android/storagemanager/automatic/
DAutomaticStorageManagementJobServiceTest.java40 import android.os.storage.VolumeInfo;
66 @Mock private VolumeInfo mVolumeInfo;
76 private List<VolumeInfo> mVolumes;
91 when(mVolumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE); in setUp()
221 VolumeInfo nonPrivateVolume = mock(VolumeInfo.class); in testNonPrivateDrivesIgnoredForFreeSpaceCalculation()
223 when(nonPrivateVolume.getType()).thenReturn(VolumeInfo.TYPE_PUBLIC); in testNonPrivateDrivesIgnoredForFreeSpaceCalculation()
243 VolumeInfo privateVolumeInfo = mock(VolumeInfo.class); in testMultiplePrivateVolumesCountedForASMActivationThreshold()
245 when(privateVolumeInfo.getType()).thenReturn(VolumeInfo.TYPE_PRIVATE); in testMultiplePrivateVolumesCountedForASMActivationThreshold()
/packages/apps/Car/Settings/tests/robotests/src/com/android/car/settings/testutils/
DShadowStorageManagerVolumeProvider.java19 import android.os.storage.VolumeInfo;
30 private static VolumeInfo sVolumeInfo;
38 protected VolumeInfo findEmulatedForPrivate(VolumeInfo privateVolume) { in findEmulatedForPrivate()
42 public static void setVolumeInfo(VolumeInfo volumeInfo) { in setVolumeInfo()

12345