WifiManager: Add new API to restore old backup data

Add a new API to restore the old backups containing the raw data from
wpa_supplicant.conf & ipconfig.txt files.
This helps clean up all the existing wifi configuration parsing
logic from SettingsBackupAgent.

BUG: 29075035
Change-Id: I8c7b93ef7c9e2decc8e4f9e5d7038939cf0ef196
This commit is contained in:
Roshan Pius
2016-06-02 09:22:20 -07:00
parent 06fe328c4f
commit 08131593a8
2 changed files with 15 additions and 0 deletions

View File

@@ -173,5 +173,7 @@ interface IWifiManager
byte[] retrieveBackupData();
void restoreBackupData(in byte[] data);
void restoreSupplicantBackupData(in byte[] supplicantData, in byte[] ipConfigData);
}

View File

@@ -2761,4 +2761,17 @@ public class WifiManager {
throw e.rethrowFromSystemServer();
}
}
/**
* Restore state from the older version of back up data.
* The old backup data was essentially a backup of wpa_supplicant.conf & ipconfig.txt file.
* @hide
*/
public void restoreSupplicantBackupData(byte[] supplicantData, byte[] ipConfigData) {
try {
mService.restoreSupplicantBackupData(supplicantData, ipConfigData);
} catch (RemoteException e) {
throw e.rethrowFromSystemServer();
}
}
}