Merge pull request #588 from purplecabbage/AndroidCacheLocal

[Android] Cache images in device storage, devices have enough space now.
This commit is contained in:
Jesse MacFadyen 2020-04-30 10:46:21 -07:00 committed by GitHub
commit e9aba07926
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,17 +220,7 @@ public class CameraLauncher extends CordovaPlugin implements MediaScannerConnect
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
private String getTempDirectoryPath() { private String getTempDirectoryPath() {
File cache = null; File cache = cordova.getActivity().getCacheDir();
// SD Card Mounted
if (Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED)) {
cache = cordova.getActivity().getExternalCacheDir();
}
// Use internal storage
else {
cache = cordova.getActivity().getCacheDir();
}
// Create the cache directory if it doesn't exist // Create the cache directory if it doesn't exist
cache.mkdirs(); cache.mkdirs();
return cache.getAbsolutePath(); return cache.getAbsolutePath();