diff options
author | Siva Velusamy <vsiva@google.com> | 2012-08-02 12:53:57 -0700 |
---|---|---|
committer | Siva Velusamy <vsiva@google.com> | 2012-08-02 12:57:30 -0700 |
commit | 1dc373fdff1c400032cc58b337c1850b79837f37 (patch) | |
tree | f735be9d3c302b9e41648b297c5784d539210859 /ddms/libs | |
parent | a5f00e25dd0e8832172eb660f12e45415bb80659 (diff) | |
download | sdk-1dc373fdff1c400032cc58b337c1850b79837f37.zip sdk-1dc373fdff1c400032cc58b337c1850b79837f37.tar.gz sdk-1dc373fdff1c400032cc58b337c1850b79837f37.tar.bz2 |
uitest-automator: Use ddmlib for device communications.
Change-Id: I2983399832a8f64b8ac0447587233baba4774311
Diffstat (limited to 'ddms/libs')
-rw-r--r-- | ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java b/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java index cb4612f..80aa8e1 100644 --- a/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java +++ b/ddms/libs/ddmlib/src/com/android/ddmlib/CollectingOutputReceiver.java @@ -17,16 +17,24 @@ package com.android.ddmlib; import java.io.UnsupportedEncodingException; +import java.util.concurrent.CountDownLatch; /** * A {@link IShellOutputReceiver} which collects the whole shell output into one * {@link String}. */ public class CollectingOutputReceiver implements IShellOutputReceiver { - + private CountDownLatch mCompletionLatch; private StringBuffer mOutputBuffer = new StringBuffer(); private boolean mIsCanceled = false; + public CollectingOutputReceiver() { + } + + public CollectingOutputReceiver(CountDownLatch commandCompleteLatch) { + mCompletionLatch = commandCompleteLatch; + } + public String getOutput() { return mOutputBuffer.toString(); } @@ -68,6 +76,8 @@ public class CollectingOutputReceiver implements IShellOutputReceiver { */ @Override public void flush() { - // ignore + if (mCompletionLatch != null) { + mCompletionLatch.countDown(); + } } } |