Merge commit '9c38a6dc13ba55fccb9c66f347307a1b4ae68105' * commit '9c38a6dc13ba55fccb9c66f347307a1b4ae68105': Cleanup Netd to prevent getting hung.
This commit is contained in:
@@ -181,7 +181,8 @@ final class NativeDaemonConnector implements Runnable {
|
||||
}
|
||||
}
|
||||
|
||||
private void sendCommand(String command) {
|
||||
private void sendCommand(String command)
|
||||
throws NativeDaemonConnectorException {
|
||||
sendCommand(command, null);
|
||||
}
|
||||
|
||||
@@ -191,11 +192,13 @@ final class NativeDaemonConnector implements Runnable {
|
||||
* @param command The command to send to the daemon
|
||||
* @param argument The argument to send with the command (or null)
|
||||
*/
|
||||
private void sendCommand(String command, String argument) {
|
||||
private void sendCommand(String command, String argument)
|
||||
throws NativeDaemonConnectorException {
|
||||
synchronized (this) {
|
||||
if (LOCAL_LOGD) Slog.d(TAG, String.format("SND -> {%s} {%s}", command, argument));
|
||||
if (mOutputStream == null) {
|
||||
Slog.e(TAG, "No connection to daemon", new IllegalStateException());
|
||||
throw new NativeDaemonConnectorException("No output stream!");
|
||||
} else {
|
||||
StringBuilder builder = new StringBuilder(command);
|
||||
if (argument != null) {
|
||||
@@ -226,6 +229,7 @@ final class NativeDaemonConnector implements Runnable {
|
||||
|
||||
while (!complete) {
|
||||
try {
|
||||
// TODO - this should not block forever
|
||||
String line = mResponseQueue.take();
|
||||
if (LOCAL_LOGD) Slog.d(TAG, String.format("RSP <- {%s}", line));
|
||||
String[] tokens = line.split(" ");
|
||||
|
||||
Reference in New Issue
Block a user