Skip to content

Commit 0cd3c97

Browse files
Christopher TateAndroid (Google) Code Review
authored andcommitted
Merge "Settings (and general) restore fixes" into jb-mr1-dev
2 parents 82b9464 + 5067685 commit 0cd3c97

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

libs/androidfw/BackupData.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -327,6 +327,7 @@ BackupDataReader::SkipEntityData()
327327
if (pos == -1) {
328328
return errno;
329329
}
330+
m_pos = pos;
330331
}
331332
SKIP_PADDING();
332333
return NO_ERROR;

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@ public class SettingsBackupAgent extends BackupAgentHelper {
6161
private static final boolean DEBUG = false;
6262
private static final boolean DEBUG_BACKUP = DEBUG || false;
6363

64+
/* Don't restore wifi config until we have new logic for parsing the
65+
* saved wifi config and configuring the new APs without having to
66+
* disable and re-enable wifi
67+
*/
68+
private static final boolean NAIVE_WIFI_RESTORE = false;
69+
6470
private static final String KEY_SYSTEM = "system";
6571
private static final String KEY_SECURE = "secure";
6672
private static final String KEY_GLOBAL = "global";
@@ -307,7 +313,7 @@ public void onRestore(BackupDataInput data, int appVersionCode,
307313
mSettingsHelper.applyAudioSettings();
308314
} else if (KEY_SECURE.equals(key)) {
309315
restoreSettings(data, Settings.Secure.CONTENT_URI, movedToGlobal);
310-
} else if (KEY_WIFI_SUPPLICANT.equals(key)) {
316+
} else if (NAIVE_WIFI_RESTORE && KEY_WIFI_SUPPLICANT.equals(key)) {
311317
int retainedWifiState = enableWifi(false);
312318
restoreWifiSupplicant(FILE_WIFI_SUPPLICANT, data);
313319
FileUtils.setPermissions(FILE_WIFI_SUPPLICANT,
@@ -321,7 +327,7 @@ public void onRestore(BackupDataInput data, int appVersionCode,
321327
byte[] localeData = new byte[size];
322328
data.readEntityData(localeData, 0, size);
323329
mSettingsHelper.setLocaleData(localeData, size);
324-
} else if (KEY_WIFI_CONFIG.equals(key)) {
330+
} else if (NAIVE_WIFI_RESTORE && KEY_WIFI_CONFIG.equals(key)) {
325331
restoreFileData(mWifiConfigFile, data);
326332
} else {
327333
data.skipEntityData();

0 commit comments

Comments
 (0)