Fixed
Status Update
Comments
lb...@gmail.com <lb...@gmail.com> #2
Information redacted by Android Beta Feedback.
ku...@google.com <ku...@google.com>
js...@google.com <js...@google.com> #4
Please provide the requested information to proceed further. Unfortunately the issue will be closed within 7 days if there is no further update.
lb...@gmail.com <lb...@gmail.com> #5
@4 Incorrect. This can't be used for each StorageVolume. See comment here:
https://issuetracker.google.com/issues/133495915#comment4
"StorageStatsManager only offers statistics for internal or adoptable storage volumes; it doesn't offer statistics for portable vfat devices.
"
StorageStatsManager will not work on SD-cards.
I requested here to get the total and free space for each of the StorageVolume instances.
And it's possible for now only using workarounds.
One example is finding out the real path of each StorageVolume and using StatFs of each.
Maybe it will work for real SD-cards on real devices and not on emulator.
Maybe it's a bug on the emulator. Thing is that I can't create UUID out of the SD-card on the emulator (causes crash), which is what I've reported here:
https://issuetracker.google.com/issues/133495915
Because you didn't check that what you wrote doesn't really work, I've made a new request :
https://issuetracker.google.com/issues/137084500
"StorageStatsManager only offers statistics for internal or adoptable storage volumes; it doesn't offer statistics for portable vfat devices.
"
StorageStatsManager will not work on SD-cards.
I requested here to get the total and free space for each of the StorageVolume instances.
And it's possible for now only using workarounds.
One example is finding out the real path of each StorageVolume and using StatFs of each.
Maybe it will work for real SD-cards on real devices and not on emulator.
Maybe it's a bug on the emulator. Thing is that I can't create UUID out of the SD-card on the emulator (causes crash), which is what I've reported here:
Because you didn't check that what you wrote doesn't really work, I've made a new request :
hu...@gmail.com <hu...@gmail.com> #6
Unfortunately, this issue was marked as Fixed without actually being fixed. The new request filed by the OP to replace this one (linked above as https://issuetracker.google.com/issues/137084500 ) is inaccessible to me. So I have no way to know whether this issue is being worked on.
lb...@gmail.com <lb...@gmail.com> #7
@6 I can't reach it either, and I'm the one who created it.
Here, new one:
https://issuetracker.google.com/issues/301987440
Here, new one:
Description
val storageManager = getSystemService(Context.STORAGE_SERVICE) as StorageManager
val storageVolumes = storageManager.storageVolumes
AsyncTask.execute {
for (storageVolume in storageVolumes) {
val uuid: UUID = storageVolume.uuid?.let { UUID.fromString(it) } ?: StorageManager.UUID_DEFAULT
val allocatableBytes = storageManager.getAllocatableBytes(uuid)
Log.d("AppLog", "allocatableBytes:${android.text.format.Formatter.formatShortFileSize(this,allocatableBytes)}")
}
}
However, I can't find anything about getting the total size that is on the storageVolume.
And I'm not even sure if this is how it's done for getting the free space.
Please provide official way to get them both