From 5ab6e0bac2de1688f2f4bb0de2c9964a9b15a4e6 Mon Sep 17 00:00:00 2001 From: Jeff Sharkey Date: Mon, 15 Sep 2014 14:50:41 -0700 Subject: [PATCH] Whoops, wait around for pm result. poll() returns immediately; we want to take() to wait for the result to actually arrive. Bug: 17510699 Change-Id: I87669e79e9941480fed33e4cc8a38de793d59e90 --- cmds/pm/src/com/android/commands/pm/Pm.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cmds/pm/src/com/android/commands/pm/Pm.java b/cmds/pm/src/com/android/commands/pm/Pm.java index 3863bc7949b00..6d1213336eb72 100644 --- a/cmds/pm/src/com/android/commands/pm/Pm.java +++ b/cmds/pm/src/com/android/commands/pm/Pm.java @@ -1702,7 +1702,11 @@ public final class Pm { } public Intent getResult() { - return mResult.poll(); + try { + return mResult.take(); + } catch (InterruptedException e) { + throw new RuntimeException(e); + } } }