Loading cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +4 −30 Original line number Diff line number Diff line Loading @@ -704,34 +704,11 @@ public final class Bmgr { return; } } System.out.println("done"); } private void doRestorePackage(String pkg) { try { mRestore = mBmgr.beginRestoreSession(pkg, null); if (mRestore == null) { System.err.println(BMGR_NOT_RUNNING_ERR); return; } RestoreObserver observer = new RestoreObserver(); // TODO implement monitor here int err = mRestore.restorePackage(pkg, observer, null ); if (err == 0) { // Off and running -- wait for the restore to complete observer.waitForCompletion(); } else { System.err.println("Unable to restore package " + pkg); } // And finally shut down the session mRestore.endRestoreSession(); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); } System.err.println("The syntax 'restore <package>' is no longer supported, please use "); System.err.println("'restore <token> <package>'."); } private void doRestoreAll(long token, HashSet<String> filter) { Loading Loading @@ -784,6 +761,8 @@ public final class Bmgr { // once the restore has finished, close down the session and we're done mRestore.endRestoreSession(); System.out.println("done"); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); Loading Loading @@ -823,7 +802,6 @@ public final class Bmgr { System.err.println(" bmgr transport WHICH|-c WHICH_COMPONENT"); System.err.println(" bmgr restore TOKEN"); System.err.println(" bmgr restore TOKEN PACKAGE..."); System.err.println(" bmgr restore PACKAGE"); System.err.println(" bmgr run"); System.err.println(" bmgr wipe TRANSPORT PACKAGE"); System.err.println(" bmgr fullbackup PACKAGE..."); Loading Loading @@ -867,10 +845,6 @@ public final class Bmgr { System.err.println("'restore' operation supplying only a token, but applies a filter to the"); System.err.println("set of applications to be restored."); System.err.println(""); System.err.println("The 'restore' command when given just a package name intiates a restore of"); System.err.println("just that one package according to the restore set selection algorithm"); System.err.println("used by the RestoreSession.restorePackage() method."); System.err.println(""); System.err.println("The 'run' command causes any scheduled backup operation to be initiated"); System.err.println("immediately, without the usual waiting period for batching together"); System.err.println("data changes."); Loading core/java/android/app/backup/RestoreSession.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,10 +17,6 @@ package android.app.backup; import android.annotation.SystemApi; import android.app.backup.RestoreObserver; import android.app.backup.RestoreSet; import android.app.backup.IRestoreObserver; import android.app.backup.IRestoreSession; import android.content.Context; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -199,6 +195,10 @@ public class RestoreSession { * backup dataset has no matching data. If no backup data exists for this package * in either source, a nonzero value will be returned. * * <p class="caution">Note: Unlike other restore operations, this method doesn't terminate the * application after the restore. The application continues running to receive the * {@link RestoreObserver} callbacks on the {@code observer} argument. * * @return Zero on success; nonzero on error. The observer will only receive * progress callbacks if this method returned zero. * @param packageName The name of the package whose data to restore. If this is Loading Loading
cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +4 −30 Original line number Diff line number Diff line Loading @@ -704,34 +704,11 @@ public final class Bmgr { return; } } System.out.println("done"); } private void doRestorePackage(String pkg) { try { mRestore = mBmgr.beginRestoreSession(pkg, null); if (mRestore == null) { System.err.println(BMGR_NOT_RUNNING_ERR); return; } RestoreObserver observer = new RestoreObserver(); // TODO implement monitor here int err = mRestore.restorePackage(pkg, observer, null ); if (err == 0) { // Off and running -- wait for the restore to complete observer.waitForCompletion(); } else { System.err.println("Unable to restore package " + pkg); } // And finally shut down the session mRestore.endRestoreSession(); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); } System.err.println("The syntax 'restore <package>' is no longer supported, please use "); System.err.println("'restore <token> <package>'."); } private void doRestoreAll(long token, HashSet<String> filter) { Loading Loading @@ -784,6 +761,8 @@ public final class Bmgr { // once the restore has finished, close down the session and we're done mRestore.endRestoreSession(); System.out.println("done"); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); Loading Loading @@ -823,7 +802,6 @@ public final class Bmgr { System.err.println(" bmgr transport WHICH|-c WHICH_COMPONENT"); System.err.println(" bmgr restore TOKEN"); System.err.println(" bmgr restore TOKEN PACKAGE..."); System.err.println(" bmgr restore PACKAGE"); System.err.println(" bmgr run"); System.err.println(" bmgr wipe TRANSPORT PACKAGE"); System.err.println(" bmgr fullbackup PACKAGE..."); Loading Loading @@ -867,10 +845,6 @@ public final class Bmgr { System.err.println("'restore' operation supplying only a token, but applies a filter to the"); System.err.println("set of applications to be restored."); System.err.println(""); System.err.println("The 'restore' command when given just a package name intiates a restore of"); System.err.println("just that one package according to the restore set selection algorithm"); System.err.println("used by the RestoreSession.restorePackage() method."); System.err.println(""); System.err.println("The 'run' command causes any scheduled backup operation to be initiated"); System.err.println("immediately, without the usual waiting period for batching together"); System.err.println("data changes."); Loading
core/java/android/app/backup/RestoreSession.java +4 −4 Original line number Diff line number Diff line Loading @@ -17,10 +17,6 @@ package android.app.backup; import android.annotation.SystemApi; import android.app.backup.RestoreObserver; import android.app.backup.RestoreSet; import android.app.backup.IRestoreObserver; import android.app.backup.IRestoreSession; import android.content.Context; import android.os.Bundle; import android.os.Handler; Loading Loading @@ -199,6 +195,10 @@ public class RestoreSession { * backup dataset has no matching data. If no backup data exists for this package * in either source, a nonzero value will be returned. * * <p class="caution">Note: Unlike other restore operations, this method doesn't terminate the * application after the restore. The application continues running to receive the * {@link RestoreObserver} callbacks on the {@code observer} argument. * * @return Zero on success; nonzero on error. The observer will only receive * progress callbacks if this method returned zero. * @param packageName The name of the package whose data to restore. If this is Loading