package baidu.com.commontools.utils;


import android.os.Build;
import android.os.Environment;
import android.os.StatFs;

public class StorageUtils {

    /**
     * Get the internal storage directory (ROM)
     */
    public static String getInternalStorageDirectory() {
        return Environment.getDataDirectory().getAbsolutePath();
    }

    /**
     * Get the available internal storage size (ROM).
     */
    @SuppressWarnings("unused")
    public static long getInternalStorageAvailableSize() {
        StatFs stat = new StatFs(getInternalStorageDirectory());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN_MR2) {
            return stat.getBlockSizeLong() * stat.getAvailableBlocksLong();
        } else {
            return (long) stat.getBlockSize() * (long) stat.getAvailableBlocks();
        }
    }

    /**
     * Check if the external storage exists (SD Card)
     * @return true if the external storage exists, otherwise false
     */
    public static boolean isExternalStorageAvailable() {
        return Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED);
    }

    /**
     * Get the external storage directory (SD Card)
     */
    @SuppressWarnings("unused")
    public static String getExternalStorageDirectory() {
        return Environment.getExternalStorageDirectory().getAbsolutePath();
    }
}

@@ -425,32 +425,48 @@
 essWarnings(
+%7B%22deprecation%22, 
 %22unused%22
 )%0A    public
@@ -445,32 +445,33 @@
 ation%22, %22unused%22
+%7D
 )%0A    public sta

change : fix lint issue.