summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIrfan Sheriff <isheriff@google.com>2011-01-18 14:40:18 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-01-18 14:40:18 -0800
commit4170b46329ed91e81cf22dba82e2dadc326b3e3d (patch)
treef27e69c123e5fbea6e4bf1be030f5a1926435b84 /services
parent41395459e676cf9ab4059e08446656f145662c2d (diff)
parent1cd94ef9570a1534e32b27d5b174dc690c9be6b9 (diff)
downloadframeworks_base-4170b46329ed91e81cf22dba82e2dadc326b3e3d.zip
frameworks_base-4170b46329ed91e81cf22dba82e2dadc326b3e3d.tar.gz
frameworks_base-4170b46329ed91e81cf22dba82e2dadc326b3e3d.tar.bz2
Merge "Do not add unsolicited events to queue" into gingerbread
Diffstat (limited to 'services')
-rw-r--r--services/java/com/android/server/NativeDaemonConnector.java12
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>();