Skip to content

Commit 73755c9

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Fix settings restore" into jb-mr1-dev
2 parents 5075f8e + 3543beb commit 73755c9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

packages/SettingsProvider/src/com/android/providers/settings/SettingsBackupAgent.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ public void onBackup(ParcelFileDescriptor oldState, BackupDataOutput data,
284284
stateChecksums[STATE_SECURE] =
285285
writeIfChanged(stateChecksums[STATE_SECURE], KEY_SECURE, secureSettingsData, data);
286286
stateChecksums[STATE_GLOBAL] =
287-
writeIfChanged(stateChecksums[STATE_GLOBAL], KEY_GLOBAL, secureSettingsData, data);
287+
writeIfChanged(stateChecksums[STATE_GLOBAL], KEY_GLOBAL, globalSettingsData, data);
288288
stateChecksums[STATE_LOCALE] =
289289
writeIfChanged(stateChecksums[STATE_LOCALE], KEY_LOCALE, locale, data);
290290
stateChecksums[STATE_WIFI_SUPPLICANT] =
@@ -313,6 +313,8 @@ public void onRestore(BackupDataInput data, int appVersionCode,
313313
mSettingsHelper.applyAudioSettings();
314314
} else if (KEY_SECURE.equals(key)) {
315315
restoreSettings(data, Settings.Secure.CONTENT_URI, movedToGlobal);
316+
} else if (KEY_GLOBAL.equals(key)) {
317+
restoreSettings(data, Settings.Global.CONTENT_URI, null);
316318
} else if (NAIVE_WIFI_RESTORE && KEY_WIFI_SUPPLICANT.equals(key)) {
317319
int retainedWifiState = enableWifi(false);
318320
restoreWifiSupplicant(FILE_WIFI_SUPPLICANT, data);
@@ -605,7 +607,7 @@ private void restoreSettings(byte[] settings, int bytes, Uri contentUri,
605607
continue;
606608
}
607609

608-
final Uri destination = (movedToGlobal.contains(key))
610+
final Uri destination = (movedToGlobal != null && movedToGlobal.contains(key))
609611
? Settings.Global.CONTENT_URI
610612
: contentUri;
611613

0 commit comments

Comments
 (0)