WifiManager: Add new API's for backup/restore
Expose new API's to retrieve data to be backed up for Wifi
configurations and to restore configurations from the data.
BackupSettingsAgent will invoke these API's to backup/restore wifi
settings.
BUG: 28967335
Change-Id: I64e2f37a29d538d976bcc53dd2165653073b5862
(cherry picked from commit 7bc0adbced)
This commit is contained in:
committed by
Mitchell Wills
parent
820f592220
commit
ffe0abf103
@@ -169,5 +169,9 @@ interface IWifiManager
|
||||
void factoryReset();
|
||||
|
||||
Network getCurrentNetwork();
|
||||
|
||||
byte[] retrieveBackupData();
|
||||
|
||||
void restoreBackupData(in byte[] data);
|
||||
}
|
||||
|
||||
|
||||
@@ -2737,4 +2737,28 @@ public class WifiManager {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the data to be backed to save the current state.
|
||||
* @hide
|
||||
*/
|
||||
public byte[] retrieveBackupData() {
|
||||
try {
|
||||
return mService.retrieveBackupData();
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Restore state from the backed up data.
|
||||
* @hide
|
||||
*/
|
||||
public void restoreBackupData(byte[] data) {
|
||||
try {
|
||||
mService.restoreBackupData(data);
|
||||
} catch (RemoteException e) {
|
||||
throw e.rethrowFromSystemServer();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user