Make an attempt to store/retrieve backups from removable storage

Fixes #7521
This commit is contained in:
Moxie Marlinspike
2018-04-04 03:59:12 -07:00
parent 7dd8baba5a
commit 3f3d7f549b
5 changed files with 35 additions and 13 deletions

View File

@@ -50,7 +50,7 @@ public class LocalBackupJob extends ContextJob {
try {
String backupPassword = TextSecurePreferences.getBackupPassphrase(context);
File backupDirectory = StorageUtil.getBackupDirectory();
File backupDirectory = StorageUtil.getBackupDirectory(context);
String timestamp = new SimpleDateFormat("yyyy-MM-dd-HH-mm-ss", Locale.US).format(new Date());
String fileName = String.format("signal-%s.backup", timestamp);
File backupFile = new File(backupDirectory, fileName);
@@ -76,7 +76,7 @@ public class LocalBackupJob extends ContextJob {
throw new IOException("Renaming temporary backup file failed!");
}
BackupUtil.deleteOldBackups();
BackupUtil.deleteOldBackups(context);
} finally {
GenericForegroundService.stopForegroundTask(context);
}