Loading core/java/android/app/BackupAgent.java +8 −3 Original line number Diff line number Diff line Loading @@ -78,11 +78,16 @@ public abstract class BackupAgent extends ContextWrapper { * * @param data An open, read-only ParcelFileDescriptor pointing to a full snapshot * of the application's data. * @param appVersionCode The android:versionCode value of the application that backed * up this particular data set. This makes it easier for an application's * agent to distinguish among several possible older data versions when * asked to perform the restore operation. * @param newState An open, read/write ParcelFileDescriptor pointing to an empty * file. The application should record the final backup state * here after restoring its data from dataFd. */ public abstract void onRestore(BackupDataInput data, ParcelFileDescriptor newState) public abstract void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException; Loading Loading @@ -121,13 +126,13 @@ public abstract class BackupAgent extends ContextWrapper { } } public void doRestore(ParcelFileDescriptor data, public void doRestore(ParcelFileDescriptor data, int appVersionCode, ParcelFileDescriptor newState) throws RemoteException { // !!! TODO - real implementation; for now just invoke the callbacks directly Log.v(TAG, "doRestore() invoked"); BackupDataInput input = new BackupDataInput(data.getFileDescriptor()); try { BackupAgent.this.onRestore(input, newState); BackupAgent.this.onRestore(input, appVersionCode, newState); } catch (IOException ex) { Log.d(TAG, "onRestore (" + BackupAgent.this.getClass().getName() + ") threw", ex); throw new RuntimeException(ex); Loading core/java/android/app/FullBackupAgent.java +1 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,6 @@ public class FullBackupAgent extends BackupAgent { } @Override public void onRestore(BackupDataInput data, ParcelFileDescriptor newState) { public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) { } } core/java/android/app/IBackupAgent.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -51,9 +51,14 @@ interface IBackupAgent { * app's backup. This is to be a <i>replacement</i> of the app's * current data, not to be merged into it. * * @param appVersionCode The android:versionCode attribute of the application * that created this data set. This can help the agent distinguish among * various historical backup content possibilities. * * @param newState Read-write file, empty when onRestore() is called, * that is to be written with the state description that holds after * the restore has been completed. */ void doRestore(in ParcelFileDescriptor data, in ParcelFileDescriptor newState); void doRestore(in ParcelFileDescriptor data, int appVersionCode, in ParcelFileDescriptor newState); } core/java/android/backup/BackupHelperAgent.java +2 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ public class BackupHelperAgent extends BackupAgent { } @Override public void onRestore(BackupDataInput data, ParcelFileDescriptor newState) public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException { mDispatcher.performRestore(data, newState); mDispatcher.performRestore(data, appVersionCode, newState); } public BackupHelperDispatcher getDispatcher() { Loading core/java/android/backup/BackupHelperDispatcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public class BackupHelperDispatcher { } } public void performRestore(BackupDataInput input, ParcelFileDescriptor newState) public void performRestore(BackupDataInput input, int appVersionCode, ParcelFileDescriptor newState) throws IOException { boolean alreadyComplained = false; Loading Loading
core/java/android/app/BackupAgent.java +8 −3 Original line number Diff line number Diff line Loading @@ -78,11 +78,16 @@ public abstract class BackupAgent extends ContextWrapper { * * @param data An open, read-only ParcelFileDescriptor pointing to a full snapshot * of the application's data. * @param appVersionCode The android:versionCode value of the application that backed * up this particular data set. This makes it easier for an application's * agent to distinguish among several possible older data versions when * asked to perform the restore operation. * @param newState An open, read/write ParcelFileDescriptor pointing to an empty * file. The application should record the final backup state * here after restoring its data from dataFd. */ public abstract void onRestore(BackupDataInput data, ParcelFileDescriptor newState) public abstract void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException; Loading Loading @@ -121,13 +126,13 @@ public abstract class BackupAgent extends ContextWrapper { } } public void doRestore(ParcelFileDescriptor data, public void doRestore(ParcelFileDescriptor data, int appVersionCode, ParcelFileDescriptor newState) throws RemoteException { // !!! TODO - real implementation; for now just invoke the callbacks directly Log.v(TAG, "doRestore() invoked"); BackupDataInput input = new BackupDataInput(data.getFileDescriptor()); try { BackupAgent.this.onRestore(input, newState); BackupAgent.this.onRestore(input, appVersionCode, newState); } catch (IOException ex) { Log.d(TAG, "onRestore (" + BackupAgent.this.getClass().getName() + ") threw", ex); throw new RuntimeException(ex); Loading
core/java/android/app/FullBackupAgent.java +1 −1 Original line number Diff line number Diff line Loading @@ -53,6 +53,6 @@ public class FullBackupAgent extends BackupAgent { } @Override public void onRestore(BackupDataInput data, ParcelFileDescriptor newState) { public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) { } }
core/java/android/app/IBackupAgent.aidl +6 −1 Original line number Diff line number Diff line Loading @@ -51,9 +51,14 @@ interface IBackupAgent { * app's backup. This is to be a <i>replacement</i> of the app's * current data, not to be merged into it. * * @param appVersionCode The android:versionCode attribute of the application * that created this data set. This can help the agent distinguish among * various historical backup content possibilities. * * @param newState Read-write file, empty when onRestore() is called, * that is to be written with the state description that holds after * the restore has been completed. */ void doRestore(in ParcelFileDescriptor data, in ParcelFileDescriptor newState); void doRestore(in ParcelFileDescriptor data, int appVersionCode, in ParcelFileDescriptor newState); }
core/java/android/backup/BackupHelperAgent.java +2 −2 Original line number Diff line number Diff line Loading @@ -39,9 +39,9 @@ public class BackupHelperAgent extends BackupAgent { } @Override public void onRestore(BackupDataInput data, ParcelFileDescriptor newState) public void onRestore(BackupDataInput data, int appVersionCode, ParcelFileDescriptor newState) throws IOException { mDispatcher.performRestore(data, newState); mDispatcher.performRestore(data, appVersionCode, newState); } public BackupHelperDispatcher getDispatcher() { Loading
core/java/android/backup/BackupHelperDispatcher.java +2 −1 Original line number Diff line number Diff line Loading @@ -46,7 +46,8 @@ public class BackupHelperDispatcher { } } public void performRestore(BackupDataInput input, ParcelFileDescriptor newState) public void performRestore(BackupDataInput input, int appVersionCode, ParcelFileDescriptor newState) throws IOException { boolean alreadyComplained = false; Loading