Skip to content

Commit

Permalink
Merge pull request #723 from grote/allow-restore
Browse files Browse the repository at this point in the history
Allow restore whenever the user feels like it
  • Loading branch information
grote committed Sep 5, 2024
2 parents b8602fd + 1b9dc25 commit dc9391d
Show file tree
Hide file tree
Showing 6 changed files with 3 additions and 62 deletions.
2 changes: 0 additions & 2 deletions app/src/debug/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources>
<bool name="show_restore_in_settings">true</bool>

<string-array name="storage_authority_whitelist">
<item>com.android.externalstorage.documents</item>
<item>org.nextcloud.documents</item>
Expand Down
12 changes: 0 additions & 12 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -154,18 +154,6 @@
</intent-filter>
</receiver>

<receiver
android:name=".SecretCodeReceiver"
android:exported="true">
<intent-filter>
<action android:name="android.telephony.action.SECRET_CODE" />
<!-- *#*#RESTORE#*#* -->
<data
android:host="7378673"
android:scheme="android_secret_code" />
</intent-filter>
</receiver>

<!-- Used by Workmanager to schedule our workers -->
<service
android:name="androidx.work.impl.foreground.SystemForegroundService"
Expand Down
28 changes: 0 additions & 28 deletions app/src/main/java/com/stevesoltys/seedvault/SecretCodeReceiver.kt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -209,9 +209,6 @@ class SettingsFragment : PreferenceFragmentCompat() {
inflater.inflate(R.menu.settings_menu, menu)
menuBackupNow = menu.findItem(R.id.action_backup)
menuRestore = menu.findItem(R.id.action_restore)
if (resources.getBoolean(R.bool.show_restore_in_settings)) {
menuRestore?.isVisible = true
}
viewModel.backupPossible.observe(viewLifecycleOwner) { possible ->
menuBackupNow?.isEnabled = possible
menuRestore?.isEnabled = possible
Expand Down
10 changes: 3 additions & 7 deletions app/src/main/res/menu/settings_menu.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
<?xml version="1.0" encoding="utf-8"?><!--
SPDX-FileCopyrightText: 2020 The Calyx Institute
SPDX-License-Identifier: Apache-2.0
-->
<menu xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
xmlns:app="http://schemas.android.com/apk/res-auto">

<item
android:id="@+id/action_backup"
Expand All @@ -17,9 +15,7 @@
android:id="@+id/action_restore"
android:enabled="false"
android:title="@string/restore_backup_button"
android:visible="false"
app:showAsAction="never"
tools:visible="true" />
app:showAsAction="never" />

<item
android:id="@+id/action_settings_expert"
Expand Down
10 changes: 0 additions & 10 deletions app/src/main/res/values/config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@
SPDX-License-Identifier: Apache-2.0
-->
<resources xmlns:tools="http://schemas.android.com/tools">
<!--
Normally, restoring from backup is only available during initial device setup.
You can make it always available at your own risk.
Keep in mind that the Auto-Restore feature works independently from this.
Launch an intent with the action "com.stevesoltys.seedvault.RESTORE_BACKUP"
to trigger restore during device setup.
-->
<bool name="show_restore_in_settings">false</bool>

<!--
Add only storage here that is also available
when restoring from backup (e.g. initial device setup)
Expand Down

0 comments on commit dc9391d

Please sign in to comment.