diff options
author | Christopher Tate <ctate@android.com> | 2009-08-07 11:35:35 -0700 |
---|---|---|
committer | Christopher Tate <ctate@android.com> | 2009-08-07 11:35:35 -0700 |
commit | 08e40b858e8a3266c5519a83fda6f7505f1c14db (patch) | |
tree | 1d88e375aa6d464e0f221e86429a0909dec0569c /cmds/bmgr | |
parent | 8851e163fc5bc17d139bf29cd2ec2f3926d342bc (diff) | |
download | frameworks_base-08e40b858e8a3266c5519a83fda6f7505f1c14db.zip frameworks_base-08e40b858e8a3266c5519a83fda6f7505f1c14db.tar.gz frameworks_base-08e40b858e8a3266c5519a83fda6f7505f1c14db.tar.bz2 |
Fix Bmgr's logic around restore completion
The caller needs to wait for the restore observer to be informed that the
restore has finished processing before it can safely shut down the restore
session.
Diffstat (limited to 'cmds/bmgr')
-rw-r--r-- | cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java index ee3ec1a..027c367 100644 --- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java @@ -327,21 +327,24 @@ public final class Bmgr { printRestoreSets(sets); } } + + // now wait for it to be done + synchronized (observer) { + while (!observer.done) { + try { + observer.wait(); + } catch (InterruptedException ex) { + } + } + } + + // once the restore has finished, close down the session and we're done mRestore.endRestoreSession(); } catch (RemoteException e) { System.err.println(e.toString()); System.err.println(BMGR_NOT_RUNNING_ERR); } - // now wait for it to be done - synchronized (observer) { - while (!observer.done) { - try { - observer.wait(); - } catch (InterruptedException ex) { - } - } - } System.out.println("done"); } |