make settings export directory to the same as backup directory

This commit is contained in:
12aw 2022-07-08 15:17:27 +02:00
parent 641676a33a
commit d9265c1773
2 changed files with 6 additions and 4 deletions

View file

@ -11,9 +11,9 @@
"type": "SINGLE",
"filters": [],
"attributes": [],
"versionCode": 115,
"versionName": "1.5.4",
"outputFile": "monocles chat-1.5.4null-git-release.apk"
"versionCode": 116,
"versionName": "1.5.5",
"outputFile": "monocles chat-1.5.5null-git-release.apk"
}
],
"elementType": "File"

View file

@ -1,5 +1,6 @@
package eu.siacs.conversations.services;
import static eu.siacs.conversations.persistance.FileBackend.APP_DIRECTORY;
import static eu.siacs.conversations.services.NotificationService.EXPORT_BACKUP_NOTIFICATION_ID;
import static eu.siacs.conversations.utils.Compatibility.runsTwentySix;
import static eu.siacs.conversations.utils.StorageHelper.getAppLogsDirectory;
@ -17,6 +18,7 @@ import android.database.DatabaseUtils;
import android.database.sqlite.SQLiteDatabase;
import android.net.Uri;
import android.os.Bundle;
import android.os.Environment;
import android.os.IBinder;
import android.os.PowerManager;
import android.preference.PreferenceManager;
@ -417,7 +419,7 @@ public class ExportBackupService extends Service {
boolean success = false;
ObjectOutputStream output = null;
try {
final File file = new File(getBackupDirectory(null), "settings.dat");
final File file = new File(Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOCUMENTS) + File.separator + APP_DIRECTORY + File.separator + "Database" + File.separator, "settings.dat");
output = new ObjectOutputStream(new FileOutputStream(file));
SharedPreferences pref = PreferenceManager.getDefaultSharedPreferences(getApplicationContext());
output.writeObject(pref.getAll());