question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

getTotalDiskCapacity() do not get the same value as ”System Setting“ In android

See original GitHub issue

In 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:closed
  • Created 6 years ago
  • Comments:11

github_iconTop GitHub Comments

1reaction
mikehardycommented, Mar 10, 2019

@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

0reactions
rndi-botcommented, Aug 20, 2021

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found