Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c58cf7dd authored by Christopher Tate's avatar Christopher Tate
Browse files

Give backup/restore confirmation a proper window title

Since the confirmation uses the same Activity but different layouts
for the backup vs restore cases, we have to do the title in code.

Along the way, fix the restore layout's padding [the backup layout
was already right].

Fixes bug 5164470

Change-Id: I4d636f666d97fc377e9cf36abf08d1625a05577f
parent 651cdfcb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@
                 android:permission="android.permission.CONFIRM_FULL_BACKUP" >

        <activity android:name=".BackupRestoreConfirmation" 
                  android:title=""
                  android:windowSoftInputMode="stateAlwaysHidden"
                  android:excludeFromRecents="true"
                  android:exported="true" >
+2 −2
Original line number Diff line number Diff line
@@ -21,10 +21,10 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
              android:layout_width="match_parent" 
              android:layout_height="match_parent"
              android:orientation="vertical"
              android:padding="16dp" >
              android:orientation="vertical">

    <ScrollView 
            android:padding="16dp"
            android:layout_height="0dp"
            android:layout_weight="1"
            android:layout_width="match_parent">
+4 −0
Original line number Diff line number Diff line
@@ -14,6 +14,10 @@
     limitations under the License.
-->
<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
    <!-- Title of the activity when a full backup has been requested and must be confirmed -->
    <string name="backup_confirm_title">Full backup</string>
    <!-- Title of the activity when a full restore has been requested and must be confirmed -->
    <string name="restore_confirm_title">Full restore</string>

    <!-- Text for message to user that a full backup has been requested, and must be confirmed. -->
    <string name="backup_confirm_text">A full backup of all data to a connected desktop computer has been requested.  Do you want to allow this to happen\?\n\nIf you did not request the backup yourself, do not allow the operation to proceed.</string>
+4 −0
Original line number Diff line number Diff line
@@ -131,10 +131,13 @@ public class BackupRestoreConfirmation extends Activity {
        final String action = intent.getAction();

        final int layoutId;
        final int titleId;
        if (action.equals(FullBackup.FULL_BACKUP_INTENT_ACTION)) {
            layoutId = R.layout.confirm_backup;
            titleId = R.string.backup_confirm_title;
        } else if (action.equals(FullBackup.FULL_RESTORE_INTENT_ACTION)) {
            layoutId = R.layout.confirm_restore;
            titleId = R.string.restore_confirm_title;
        } else {
            Slog.w(TAG, "Backup/restore confirmation activity launched with invalid action!");
            finish();
@@ -159,6 +162,7 @@ public class BackupRestoreConfirmation extends Activity {
            mObserver.setHandler(mHandler);
        }

        setTitle(titleId);
        setContentView(layoutId);

        // Same resource IDs for each layout variant (backup / restore)