Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/AndroidManifest.xml b/AndroidManifest.xml
- index a10f1a4..2ae3673 100644
- --- a/AndroidManifest.xml
- +++ b/AndroidManifest.xml
- @@ -257,6 +257,19 @@
- </intent-filter>
- </activity>
- + <activity android:name=".backup.RestoreIntroActivity"
- + android:label="@string/activity_label_empty"
- + android:excludeFromRecents="true"
- + android:configChanges="mcc|mnc"
- + android:immersive="true"
- + android:exported="false"
- + android:windowSoftInputMode="stateAlwaysHidden">
- + <intent-filter>
- + <action android:name="org.lineageos.setupwizard.LINEAGE_RESTORE_BACKUP"/>
- + <category android:name="android.intent.category.DEFAULT"/>
- + </intent-filter>
- + </activity>
- +
- <activity android:name=".FinishActivity"
- android:label="@string/activity_label_empty"
- android:excludeFromRecents="true"
- diff --git a/res/raw/lineage_wizard_script.xml b/res/raw/lineage_wizard_script.xml
- index d997994..4185a2b 100644
- --- a/res/raw/lineage_wizard_script.xml
- +++ b/res/raw/lineage_wizard_script.xml
- @@ -66,6 +66,14 @@
- </WizardAction>
- <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_LOCKSCREEN_SETTINGS;end" id="lockscreen_settings">
- + <result wizard:action="wait_install_apps" />
- + </WizardAction>
- +
- + <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_WAIT_INSTALL_APPS;end" id="wait_install_apps">
- + <result wizard:action="restore" />
- + </WizardAction>
- +
- + <WizardAction wizard:uri="intent:#Intent;action=org.lineageos.setupwizard.LINEAGE_RESTORE_BACKUP;end" id="restore">
- <result wizard:action="finish" />
- </WizardAction>
- diff --git a/res/values/strings.xml b/res/values/strings.xml
- index 0bb3b88..bdd302e 100644
- --- a/res/values/strings.xml
- +++ b/res/values/strings.xml
- @@ -98,4 +98,16 @@
- <string name="lockscreen_setup_summary"><b>Protect this device</b> and require a PIN, pattern, or password to unlock the screen</string>
- <string name="lockscreen_setup_screen_lock_setup">Set up</string>
- + <!-- App install -->
- + <string name="calyx_fdroid_repo_location" translatable="false">/product/fdroid/repo</string>
- + <string name="install_apps_title">Additional Apps</string>
- + <string name="install_apps_subtitle"><b>Review additional apps.</b> You can install them later as well.</string>
- + <string name="install_apps_select_all">All of the following apps</string>
- + <string name="waiting_for_apps">Please wait while we finish setting up your device.</string>
- +
- + <!-- Backup Restore -->
- + <string name="intro_restore_title">Restore apps and data</string>
- + <string name="intro_restore_subtitle">If you have a backup from your last phone, you can restore it here.</string>
- + <string name="intro_restore_button">Restore from backup</string>
- +
- </resources>
- diff --git a/src/org/lineageos/setupwizard/SetupWizardApp.java b/src/org/lineageos/setupwizard/SetupWizardApp.java
- index 538c298..45d3773 100644
- --- a/src/org/lineageos/setupwizard/SetupWizardApp.java
- +++ b/src/org/lineageos/setupwizard/SetupWizardApp.java
- @@ -42,6 +42,7 @@ public class SetupWizardApp extends Application {
- public static final String ACTION_EMERGENCY_DIAL = "com.android.phone.EmergencyDialer.DIAL";
- public static final String ACTION_NEXT = "com.android.wizard.NEXT";
- public static final String ACTION_LOAD = "com.android.wizard.LOAD";
- + public static final String ACTION_RESTORE_FROM_BACKUP = "com.stevesoltys.seedvault.RESTORE_BACKUP";
- public static final String EXTRA_FIRST_RUN = "firstRun";
- @@ -69,6 +70,7 @@ public class SetupWizardApp extends Application {
- public static final int REQUEST_CODE_SETUP_BLUETOOTH= 5;
- public static final int REQUEST_CODE_SETUP_FINGERPRINT = 7;
- public static final int REQUEST_CODE_SETUP_LOCKSCREEN = 9;
- + public static final int REQUEST_CODE_RESTORE = 10;
- public static final int RADIO_READY_TIMEOUT = 10 * 1000;
- diff --git a/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java b/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java
- index e69de29..e131b74 100644
- --- a/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java
- +++ b/src/org/lineageos/setupwizard/backup/RestoreIntroActivity.java
- @@ -0,0 +1,43 @@
- +package org.lineageos.setupwizard.backup;
- +
- +import android.content.Intent;
- +import org.lineageos.setupwizard.R;
- +import org.lineageos.setupwizard.SubBaseActivity;
- +
- +import static org.lineageos.setupwizard.SetupWizardApp.*;
- +
- +public class RestoreIntroActivity extends SubBaseActivity {
- +
- + @Override
- + protected void onStartSubactivity() {
- + setNextAllowed(true);
- +
- + findViewById(R.id.intro_restore_button).setOnClickListener(v -> launchRestore());
- + }
- +
- + @Override
- + protected int getLayoutResId() {
- + return R.layout.intro_restore_activity;
- + }
- +
- + @Override
- + protected int getTitleResId() {
- + return R.string.intro_restore_title;
- + }
- +
- + @Override
- + protected int getIconResId() {
- + return R.drawable.ic_restore;
- + }
- +
- + @Override
- + protected int getSubactivityNextTransition() {
- + return TRANSITION_ID_SLIDE;
- + }
- +
- + private void launchRestore() {
- + Intent intent = new Intent(ACTION_RESTORE_FROM_BACKUP);
- + startSubactivity(intent, REQUEST_CODE_RESTORE);
- + }
- +
- +}
Advertisement
Add Comment
Please, Sign In to add comment