mikailoral / android-rcs-ims-stack

Automatically exported from code.google.com/p/android-rcs-ims-stack
0 stars 0 forks source link

Folder to save files must not be set to Environment.getExternalStorageDirectory() #259

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I think that folders to save files must not be set to 
Environment.getExternalStorageDirectory().
If we remove the SD card of a device this path can be unavailable...

I think the subpath must calculate each time with something like :

        if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
            Log.v(TAG, "External storage available");
            path = context.getExternalFilesDir(null);
        }
        if (path == null) {
            Log.w(TAG, "External storage unavailable - using local memory");
            path = context.getFilesDir();
        }

Attention to the calculation of the remaining space.

Original issue reported on code.google.com by benoit.j...@gmail.com on 4 Apr 2014 at 3:40

GoogleCodeExporter commented 9 years ago

Original comment by benoit.j...@gmail.com on 7 Apr 2014 at 8:29