diff options
| author | 2011-09-13 17:51:18 -0700 | |
|---|---|---|
| committer | 2011-09-13 17:51:18 -0700 | |
| commit | c58cf7dd02ad227a68d62a0204152cee62c13182 (patch) | |
| tree | 5e73b0f770f20d60a7a12a7b959cff289c0fb1b4 | |
| parent | 651cdfcbac6245f570475991588ddc2d30265e8d (diff) | |
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
4 files changed, 11 insertions, 2 deletions
diff --git a/packages/BackupRestoreConfirmation/AndroidManifest.xml b/packages/BackupRestoreConfirmation/AndroidManifest.xml index 19848f611e77..f3feee8ca6d7 100644 --- a/packages/BackupRestoreConfirmation/AndroidManifest.xml +++ b/packages/BackupRestoreConfirmation/AndroidManifest.xml @@ -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" > diff --git a/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml b/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml index 3522e7cb2ef8..2ee74fe4519b 100644 --- a/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml +++ b/packages/BackupRestoreConfirmation/res/layout/confirm_restore.xml @@ -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"> diff --git a/packages/BackupRestoreConfirmation/res/values/strings.xml b/packages/BackupRestoreConfirmation/res/values/strings.xml index f022e578d886..e207a98003d1 100644 --- a/packages/BackupRestoreConfirmation/res/values/strings.xml +++ b/packages/BackupRestoreConfirmation/res/values/strings.xml @@ -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> diff --git a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java index 5448e0b1dc9b..d053f2962d99 100644 --- a/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java +++ b/packages/BackupRestoreConfirmation/src/com/android/backupconfirm/BackupRestoreConfirmation.java @@ -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) |