getTotalDiskCapacity() do not get the same value as ”System Setting“ In android
See original GitHub issueIn Android, getTotalDiskCapacity() do not get the right value。 So I change the Java code as follow:
public Long getTotalDiskCapacity() {
try {
StatFs root = new StatFs(Environment.getRootDirectory().getAbsolutePath());
return root.getBlockCountLong() * root.getBlockSizeLong();
} catch (Exception e) {
e.printStackTrace();
}
return null;
}
But the function returns 4.3GB, but the System Setting show 8.0GB. The Android device is “SM-T719C - 6.0.1”. Can anyone tell me why? Thanks! @crafterm @doochik @DracoBlue @stevemoser @jeveloper
Issue Analytics
- State:
- Created 6 years ago
- Comments:11
Top Results From Across the Web
TextClock - Android Developers
This view honors the 24-hour format system setting. As such, it is possible and recommended to provide two different formatting patterns: one to...
Read more >Diff - platform/tools/tradefederation - Google Git
keySet()) { + for (String value : mSystemSettings.get(key)) { + CLog.d("Changing system setting %s to %s", key, value); + device.
Read more >Android studio isn't opening on Windows - Stack Overflow
On some systems the launcher script does not find where Java is installed. Workaround is to set a ... Click on Advanced System...
Read more >Pega Platform 8.7.4 Patch Resolved Issues | Support Center
... been updated to source the TLS version from the system setting "Pega-IntegrationArchitect pyLowestAllowableTLSVersion", which will match ...
Read more >fio(1): flexible I/O tester - Linux man page
If not set, fio will use the full size of the given files or devices. If the the files do not ... Must...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@machour this one is actually not fixed - I fixed integer overflow with a very focused change, and this one will need a separate change to use different native APIs in a thoughtful way. I didn’t attempt it in the integer overflow fix
Hello 👋, this issue has been opened for more than 2 months with no activity on it. If the issue is sti ll here, please keep in mind that we need community support and help to fix it! Just comment something like still searching for solu tions and if you found one, please open a pull request! You have 7 days until this gets closed automatically