Fixed Android 7.0- compatibility

pull/214/head
M66B 9 months ago
parent 620e82aedc
commit b09ec10cd3

@ -2837,14 +2837,18 @@ public class Helper {
}
static void secureDelete(File file) {
if (file.exists()) {
try {
if (file.exists()) {
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) {
if (!file.delete())
throw new FileNotFoundException(file.getAbsolutePath());
} else
Files.delete(Paths.get(file.getAbsolutePath()));
}
} catch (IOException ex) {
Log.e(ex);
}
}
}
static long getAvailableStorageSpace() {
StatFs stats = new StatFs(Environment.getDataDirectory().getAbsolutePath());

Loading…
Cancel
Save