summaryrefslogtreecommitdiff
path: root/cmds/bmgr
diff options
context:
space:
mode:
authorMakoto Onuki <omakoto@google.com>2017-04-12 10:10:22 -0700
committerMakoto Onuki <omakoto@google.com>2017-04-12 11:08:49 -0700
commita56ba60c944c82265906f40088fddecb65705733 (patch)
tree971e02a5b84befdaaccf5595d87589516b71f493 /cmds/bmgr
parent6acaa0382c86ac1e557c92e4d8dd83fb2c4972f2 (diff)
"bmgr restore" really should wait until operation finishes.
Test: manual test Bug 37246838 Change-Id: Ice381dc250e2d2a59cff48152dd3c8d6897d0804
Diffstat (limited to 'cmds/bmgr')
-rw-r--r--cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
index bfcad1bb5f96..1bcfb22fe2f2 100644
--- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
+++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java
@@ -580,6 +580,11 @@ public final class Bmgr {
}
}
+ /**
+ * Wait until either {@link #restoreFinished} or {@link #restoreStarting} is called.
+ * Once one is called, it clears the internal flag again, so that the same observer intance
+ * can be reused for a next operation.
+ */
public void waitForCompletion() {
// The restoreFinished() callback will throw the 'done' flag; we
// just sit and wait on that notification.
@@ -590,6 +595,7 @@ public final class Bmgr {
} catch (InterruptedException ex) {
}
}
+ done = false;
}
}
}