@SuppressWarnings("ExternalStorageUse")
  private void ensureInitialized() {
    if (!mInitialized) {
      lock.lock();
      try {
        if (!mInitialized) {
          mInternalPath = Environment.getDataDirectory();

          // Whitelisted use of external storage Android changes in Target SDK 29 and above as it
          // only used for getting the available space
          mExternalPath = Environment.getExternalStorageDirectory();
          updateStats();
          mInitialized = true;
        }
      } finally {
        lock.unlock();
      }
    }
  }
Initialization code that can sometimes take a long time.
fbcore/src/main/java/com/facebook/common/statfs/StatFsHelper.java