Disable SDcard permission from AndroidAppSettigns.cfg
This commit is contained in:
@@ -72,6 +72,7 @@ import android.hardware.SensorEventListener;
|
||||
import android.hardware.SensorEvent;
|
||||
import android.hardware.Sensor;
|
||||
import android.widget.Toast;
|
||||
import android.content.pm.PackageManager;
|
||||
|
||||
|
||||
// TODO: too much code here, split into multiple files, possibly auto-generated menus?
|
||||
@@ -391,6 +392,11 @@ 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 )
|
||||
{
|
||||
Log.i("SDL", "libSDL: We don't have permission to write to SD card, switching to the internal storage.");
|
||||
Globals.DownloadToSdcard = false;
|
||||
}
|
||||
Globals.DataDir = Globals.DownloadToSdcard ?
|
||||
SdcardAppPath.getPath(p) :
|
||||
p.getFilesDir().getAbsolutePath();
|
||||
|
||||
Reference in New Issue
Block a user