sdk/src/main/java/com/bugsnag/android/DeviceData.java
@Nullable
    @SuppressWarnings("deprecation") // ignore blockSizeLong suggestions for now (requires API 18)
    private Long calculateFreeDisk() {
        try {
            StatFs externalStat = new StatFs(Environment.getExternalStorageDirectory().getPath());
            long externalBytesAvailable =
                (long) externalStat.getBlockSize() * (long) externalStat.getBlockCount();

            StatFs internalStat = new StatFs(Environment.getDataDirectory().getPath());
            long internalBytesAvailable =
                (long) internalStat.getBlockSize() * (long) internalStat.getBlockCount();

            return Math.min(internalBytesAvailable, externalBytesAvailable);
        } catch (Exception exception) {
            Logger.warn("Could not get freeDisk");
        }
        return null;
    }
/**
     * Get the free disk space on the smallest disk
     */
Get the free disk space on the smallest disk
Get the free disk space on the smallest disk
@Nullable
    @SuppressWarnings("deprecation") 
    private Long calculateFreeDisk() {
        try {
            StatFs externalStat = new StatFs(Environment.getExternalStorageDirectory().getPath());
            long externalBytesAvailable =
                (long) externalStat.getBlockSize() * (long) externalStat.getBlockCount();
            StatFs internalStat = new StatFs(Environment.getDataDirectory().getPath());
            long internalBytesAvailable =
                (long) internalStat.getBlockSize() * (long) internalStat.getBlockCount();
            return Math.min(internalBytesAvailable, externalBytesAvailable);
        } catch (Exception exception) {
            Logger.warn("Could not get freeDisk");
        }
        return null;
    }
@ Nullable @ SuppressWarnings ( "deprecation" ) private Long calculateFreeDisk ( ) { try { StatFs externalStat = new StatFs ( Environment . getExternalStorageDirectory ( ) . getPath ( ) ) ; long externalBytesAvailable = ( long ) externalStat . getBlockSize ( ) * ( long ) externalStat . getBlockCount ( ) ; StatFs internalStat = new StatFs ( Environment . getDataDirectory ( ) . getPath ( ) ) ; long internalBytesAvailable = ( long ) internalStat . getBlockSize ( ) * ( long ) internalStat . getBlockCount ( ) ; return Math . min ( internalBytesAvailable , externalBytesAvailable ) ; } catch ( Exception exception ) { Logger . warn ( "Could not get freeDisk" ) ; } return null ; }
Get the free disk space on the smallest disk
Get the free disk space on the smallest disk
// ignore blockSizeLong suggestions for now (requires API 18)