SDL: we always have permission to write to our own dir on SD card on KitKat

This commit is contained in:
pelya
2016-03-13 22:51:55 +02:00
parent ea3919b9b6
commit 033be3ee53

View File

@@ -418,7 +418,8 @@ class Settings
Log.i("SDL", "libSDL: SD card or external storage is not mounted (state " + Environment.getExternalStorageState() + "), switching to the internal storage.");
Globals.DownloadToSdcard = false;
}
if( p.getPackageManager().checkPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, p.getPackageName()) != PackageManager.PERMISSION_GRANTED )
if( p.getPackageManager().checkPermission(android.Manifest.permission.WRITE_EXTERNAL_STORAGE, p.getPackageName()) != PackageManager.PERMISSION_GRANTED &&
android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.KITKAT )
{
Log.i("SDL", "libSDL: We don't have permission to write to SD card, switching to the internal storage.");
Globals.DownloadToSdcard = false;