diff options
Diffstat (limited to 'services/java')
-rw-r--r-- | services/java/com/android/server/NativeDaemonConnector.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/services/java/com/android/server/NativeDaemonConnector.java b/services/java/com/android/server/NativeDaemonConnector.java index 7b68d68..cf87a9d 100644 --- a/services/java/com/android/server/NativeDaemonConnector.java +++ b/services/java/com/android/server/NativeDaemonConnector.java @@ -132,11 +132,12 @@ final class NativeDaemonConnector implements Runnable { Slog.e(TAG, String.format( "Error handling '%s'", event), ex); } - } - try { - mResponseQueue.put(event); - } catch (InterruptedException ex) { - Slog.e(TAG, "Failed to put response onto queue", ex); + } else { + try { + mResponseQueue.put(event); + } catch (InterruptedException ex) { + Slog.e(TAG, "Failed to put response onto queue", ex); + } } } catch (NumberFormatException nfe) { Slog.w(TAG, String.format("Bad msg (%s)", event)); @@ -219,6 +220,7 @@ final class NativeDaemonConnector implements Runnable { */ public synchronized ArrayList<String> doCommand(String cmd) throws NativeDaemonConnectorException { + mResponseQueue.clear(); sendCommand(cmd); ArrayList<String> response = new ArrayList<String>(); |