diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 8169a7aa94..82fb08a47e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -44,7 +44,8 @@ android:name="com.battlelancer.seriesguide.SgApp" android:allowBackup="true" android:backupAgent="com.battlelancer.seriesguide.SgBackupAgent" - android:fullBackupContent="@xml/sg_full_backup_rules" + android:dataExtractionRules="@xml/sg_backup_rules_android_12" + android:fullBackupContent="@xml/sg_backup_rules" android:fullBackupOnly="true" android:hardwareAccelerated="true" android:icon="@mipmap/ic_launcher" diff --git a/app/src/main/java/com/battlelancer/seriesguide/dataliberation/AutoBackupTools.kt b/app/src/main/java/com/battlelancer/seriesguide/dataliberation/AutoBackupTools.kt index b42e3e7453..25a16dd264 100644 --- a/app/src/main/java/com/battlelancer/seriesguide/dataliberation/AutoBackupTools.kt +++ b/app/src/main/java/com/battlelancer/seriesguide/dataliberation/AutoBackupTools.kt @@ -11,6 +11,8 @@ import java.util.Calendar object AutoBackupTools { + private const val BACKUP_FOLDER_NAME = "Backups" + @Throws(AutoBackupException::class) fun getBackupDirectory(context: Context): File { val storage = context.getExternalFilesDir(null) @@ -20,7 +22,7 @@ object AutoBackupTools { throw AutoBackupException("Storage not mounted.") } - return File(storage, "Backups") + return File(storage, BACKUP_FOLDER_NAME) } fun deleteOldBackups(context: Context) { diff --git a/app/src/main/res/xml/sg_backup_rules.xml b/app/src/main/res/xml/sg_backup_rules.xml new file mode 100644 index 0000000000..0fe533e853 --- /dev/null +++ b/app/src/main/res/xml/sg_backup_rules.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + diff --git a/app/src/main/res/xml/sg_backup_rules_android_12.xml b/app/src/main/res/xml/sg_backup_rules_android_12.xml new file mode 100644 index 0000000000..ebacbc07c3 --- /dev/null +++ b/app/src/main/res/xml/sg_backup_rules_android_12.xml @@ -0,0 +1,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/app/src/main/res/xml/sg_full_backup_rules.xml b/app/src/main/res/xml/sg_full_backup_rules.xml deleted file mode 100644 index 23cba65f2a..0000000000 --- a/app/src/main/res/xml/sg_full_backup_rules.xml +++ /dev/null @@ -1,9 +0,0 @@ - - - - - - - - - \ No newline at end of file