mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-26 19:05:23 +01:00
Fixed Android 7.0- compatibility
This commit is contained in:
@@ -2837,12 +2837,16 @@ public class Helper {
|
||||
}
|
||||
|
||||
static void secureDelete(File file) {
|
||||
if (file.exists()) {
|
||||
try {
|
||||
Files.delete(Paths.get(file.getAbsolutePath()));
|
||||
} catch (IOException ex) {
|
||||
Log.e(ex);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user