am 4170b463: Merge "Do not add unsolicited events to queue" into gingerbread

* commit '4170b46329ed91e81cf22dba82e2dadc326b3e3d':
  Do not add unsolicited events to queue
This commit is contained in:
Irfan Sheriff
2011-01-18 14:43:04 -08:00
committed by Android Git Automerger

View File

@ -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>();