San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2007 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package com.android.server; |
| 18 | |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 19 | import android.net.LocalSocket; |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 20 | import android.net.LocalSocketAddress; |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 21 | import android.os.Handler; |
| 22 | import android.os.HandlerThread; |
| 23 | import android.os.Message; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 24 | import android.os.SystemClock; |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 25 | import android.util.Slog; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 26 | |
| 27 | import java.io.IOException; |
| 28 | import java.io.InputStream; |
| 29 | import java.io.OutputStream; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 30 | import java.util.ArrayList; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 31 | import java.util.concurrent.BlockingQueue; |
| 32 | import java.util.concurrent.LinkedBlockingQueue; |
| 33 | |
| 34 | /** |
| 35 | * Generic connector class for interfacing with a native |
| 36 | * daemon which uses the libsysutils FrameworkListener |
| 37 | * protocol. |
| 38 | */ |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 39 | final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdog.Monitor { |
San Mehat | 1ff4371 | 2010-02-04 15:09:02 -0800 | [diff] [blame] | 40 | private static final boolean LOCAL_LOGD = false; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 41 | |
| 42 | private BlockingQueue<String> mResponseQueue; |
| 43 | private OutputStream mOutputStream; |
| 44 | private String TAG = "NativeDaemonConnector"; |
| 45 | private String mSocket; |
| 46 | private INativeDaemonConnectorCallbacks mCallbacks; |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 47 | private Handler mCallbackHandler; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 48 | |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 49 | /** Lock held whenever communicating with native daemon. */ |
| 50 | private Object mDaemonLock = new Object(); |
| 51 | |
Kenny Root | 961aa8c | 2010-03-22 18:02:45 -0700 | [diff] [blame] | 52 | private final int BUFFER_SIZE = 4096; |
| 53 | |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 54 | class ResponseCode { |
| 55 | public static final int ActionInitiated = 100; |
| 56 | |
| 57 | public static final int CommandOkay = 200; |
| 58 | |
| 59 | // The range of 400 -> 599 is reserved for cmd failures |
| 60 | public static final int OperationFailed = 400; |
| 61 | public static final int CommandSyntaxError = 500; |
| 62 | public static final int CommandParameterError = 501; |
| 63 | |
| 64 | public static final int UnsolicitedInformational = 600; |
| 65 | |
| 66 | // |
| 67 | public static final int FailedRangeStart = 400; |
| 68 | public static final int FailedRangeEnd = 599; |
| 69 | } |
| 70 | |
| 71 | NativeDaemonConnector(INativeDaemonConnectorCallbacks callbacks, |
| 72 | String socket, int responseQueueSize, String logTag) { |
| 73 | mCallbacks = callbacks; |
| 74 | if (logTag != null) |
| 75 | TAG = logTag; |
| 76 | mSocket = socket; |
| 77 | mResponseQueue = new LinkedBlockingQueue<String>(responseQueueSize); |
| 78 | } |
| 79 | |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 80 | @Override |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 81 | public void run() { |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 82 | HandlerThread thread = new HandlerThread(TAG + ".CallbackHandler"); |
| 83 | thread.start(); |
| 84 | mCallbackHandler = new Handler(thread.getLooper(), this); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 85 | |
| 86 | while (true) { |
| 87 | try { |
| 88 | listenToSocket(); |
| 89 | } catch (Exception e) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 90 | Slog.e(TAG, "Error in NativeDaemonConnector", e); |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 91 | SystemClock.sleep(5000); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 92 | } |
| 93 | } |
| 94 | } |
| 95 | |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 96 | @Override |
| 97 | public boolean handleMessage(Message msg) { |
| 98 | String event = (String) msg.obj; |
| 99 | try { |
| 100 | if (!mCallbacks.onEvent(msg.what, event, event.split(" "))) { |
| 101 | Slog.w(TAG, String.format( |
| 102 | "Unhandled event '%s'", event)); |
| 103 | } |
| 104 | } catch (Exception e) { |
| 105 | Slog.e(TAG, String.format( |
| 106 | "Error handling '%s'", event), e); |
| 107 | } |
| 108 | return true; |
| 109 | } |
| 110 | |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 111 | private void listenToSocket() throws IOException { |
Kenny Root | 961aa8c | 2010-03-22 18:02:45 -0700 | [diff] [blame] | 112 | LocalSocket socket = null; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 113 | |
| 114 | try { |
| 115 | socket = new LocalSocket(); |
| 116 | LocalSocketAddress address = new LocalSocketAddress(mSocket, |
| 117 | LocalSocketAddress.Namespace.RESERVED); |
| 118 | |
| 119 | socket.connect(address); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 120 | |
| 121 | InputStream inputStream = socket.getInputStream(); |
| 122 | mOutputStream = socket.getOutputStream(); |
| 123 | |
anga | 030bc88 | 2011-02-01 14:10:25 +0100 | [diff] [blame] | 124 | mCallbacks.onDaemonConnected(); |
| 125 | |
Kenny Root | 961aa8c | 2010-03-22 18:02:45 -0700 | [diff] [blame] | 126 | byte[] buffer = new byte[BUFFER_SIZE]; |
| 127 | int start = 0; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 128 | |
| 129 | while (true) { |
Kenny Root | 961aa8c | 2010-03-22 18:02:45 -0700 | [diff] [blame] | 130 | int count = inputStream.read(buffer, start, BUFFER_SIZE - start); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 131 | if (count < 0) break; |
| 132 | |
Kenny Root | 12da9d7 | 2010-09-02 22:18:14 -0700 | [diff] [blame] | 133 | // Add our starting point to the count and reset the start. |
| 134 | count += start; |
| 135 | start = 0; |
| 136 | |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 137 | for (int i = 0; i < count; i++) { |
| 138 | if (buffer[i] == 0) { |
| 139 | String event = new String(buffer, start, i - start); |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 140 | if (LOCAL_LOGD) Slog.d(TAG, String.format("RCV <- {%s}", event)); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 141 | |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 142 | String[] tokens = event.split(" ", 2); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 143 | try { |
| 144 | int code = Integer.parseInt(tokens[0]); |
| 145 | |
| 146 | if (code >= ResponseCode.UnsolicitedInformational) { |
Chia-chi Yeh | e5750a3 | 2011-08-03 14:42:11 -0700 | [diff] [blame] | 147 | mCallbackHandler.sendMessage( |
| 148 | mCallbackHandler.obtainMessage(code, event)); |
Irfan Sheriff | 1cd94ef | 2011-01-16 14:31:55 -0800 | [diff] [blame] | 149 | } else { |
| 150 | try { |
| 151 | mResponseQueue.put(event); |
| 152 | } catch (InterruptedException ex) { |
| 153 | Slog.e(TAG, "Failed to put response onto queue", ex); |
| 154 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 155 | } |
| 156 | } catch (NumberFormatException nfe) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 157 | Slog.w(TAG, String.format("Bad msg (%s)", event)); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 158 | } |
| 159 | start = i + 1; |
| 160 | } |
| 161 | } |
Kenny Root | 12da9d7 | 2010-09-02 22:18:14 -0700 | [diff] [blame] | 162 | |
| 163 | // We should end at the amount we read. If not, compact then |
| 164 | // buffer and read again. |
Kenny Root | 961aa8c | 2010-03-22 18:02:45 -0700 | [diff] [blame] | 165 | if (start != count) { |
| 166 | final int remaining = BUFFER_SIZE - start; |
| 167 | System.arraycopy(buffer, start, buffer, 0, remaining); |
| 168 | start = remaining; |
| 169 | } else { |
| 170 | start = 0; |
| 171 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 172 | } |
| 173 | } catch (IOException ex) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 174 | Slog.e(TAG, "Communications error", ex); |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 175 | throw ex; |
| 176 | } finally { |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 177 | synchronized (mDaemonLock) { |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 178 | if (mOutputStream != null) { |
| 179 | try { |
| 180 | mOutputStream.close(); |
| 181 | } catch (IOException e) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 182 | Slog.w(TAG, "Failed closing output stream", e); |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 183 | } |
| 184 | mOutputStream = null; |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 185 | } |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 186 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 187 | |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 188 | try { |
| 189 | if (socket != null) { |
| 190 | socket.close(); |
| 191 | } |
| 192 | } catch (IOException ex) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 193 | Slog.w(TAG, "Failed closing socket", ex); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 194 | } |
| 195 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 196 | } |
| 197 | |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 198 | private void sendCommandLocked(String command) throws NativeDaemonConnectorException { |
| 199 | sendCommandLocked(command, null); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 200 | } |
| 201 | |
| 202 | /** |
| 203 | * Sends a command to the daemon with a single argument |
| 204 | * |
| 205 | * @param command The command to send to the daemon |
| 206 | * @param argument The argument to send with the command (or null) |
| 207 | */ |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 208 | private void sendCommandLocked(String command, String argument) |
| 209 | throws NativeDaemonConnectorException { |
Jeff Sharkey | b0aec07 | 2011-10-14 18:32:24 -0700 | [diff] [blame] | 210 | if (command != null && command.indexOf('\0') >= 0) { |
| 211 | throw new IllegalArgumentException("unexpected command: " + command); |
| 212 | } |
| 213 | if (argument != null && argument.indexOf('\0') >= 0) { |
| 214 | throw new IllegalArgumentException("unexpected argument: " + argument); |
| 215 | } |
| 216 | |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 217 | if (LOCAL_LOGD) Slog.d(TAG, String.format("SND -> {%s} {%s}", command, argument)); |
| 218 | if (mOutputStream == null) { |
| 219 | Slog.e(TAG, "No connection to daemon", new IllegalStateException()); |
| 220 | throw new NativeDaemonConnectorException("No output stream!"); |
| 221 | } else { |
| 222 | StringBuilder builder = new StringBuilder(command); |
| 223 | if (argument != null) { |
| 224 | builder.append(argument); |
| 225 | } |
| 226 | builder.append('\0'); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 227 | |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 228 | try { |
| 229 | mOutputStream.write(builder.toString().getBytes()); |
| 230 | } catch (IOException ex) { |
| 231 | Slog.e(TAG, "IOException in sendCommand", ex); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 232 | } |
| 233 | } |
| 234 | } |
| 235 | |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 236 | /** |
| 237 | * Issue a command to the native daemon and return the responses |
| 238 | */ |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 239 | public ArrayList<String> doCommand(String cmd) throws NativeDaemonConnectorException { |
| 240 | synchronized (mDaemonLock) { |
| 241 | return doCommandLocked(cmd); |
| 242 | } |
| 243 | } |
| 244 | |
| 245 | private ArrayList<String> doCommandLocked(String cmd) throws NativeDaemonConnectorException { |
Irfan Sheriff | 1cd94ef | 2011-01-16 14:31:55 -0800 | [diff] [blame] | 246 | mResponseQueue.clear(); |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 247 | sendCommandLocked(cmd); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 248 | |
| 249 | ArrayList<String> response = new ArrayList<String>(); |
| 250 | boolean complete = false; |
| 251 | int code = -1; |
| 252 | |
| 253 | while (!complete) { |
| 254 | try { |
Robert Greenwalt | e5c3afb | 2010-09-22 14:32:35 -0700 | [diff] [blame] | 255 | // TODO - this should not block forever |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 256 | String line = mResponseQueue.take(); |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 257 | if (LOCAL_LOGD) Slog.d(TAG, String.format("RSP <- {%s}", line)); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 258 | String[] tokens = line.split(" "); |
| 259 | try { |
| 260 | code = Integer.parseInt(tokens[0]); |
| 261 | } catch (NumberFormatException nfe) { |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 262 | throw new NativeDaemonConnectorException( |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 263 | String.format("Invalid response from daemon (%s)", line)); |
| 264 | } |
| 265 | |
San Mehat | ec4caa0 | 2010-02-03 10:48:21 -0800 | [diff] [blame] | 266 | if ((code >= 200) && (code < 600)) { |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 267 | complete = true; |
San Mehat | ec4caa0 | 2010-02-03 10:48:21 -0800 | [diff] [blame] | 268 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 269 | response.add(line); |
| 270 | } catch (InterruptedException ex) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 271 | Slog.e(TAG, "Failed to process response", ex); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 272 | } |
| 273 | } |
| 274 | |
| 275 | if (code >= ResponseCode.FailedRangeStart && |
| 276 | code <= ResponseCode.FailedRangeEnd) { |
San Mehat | ec4caa0 | 2010-02-03 10:48:21 -0800 | [diff] [blame] | 277 | /* |
| 278 | * Note: The format of the last response in this case is |
| 279 | * "NNN <errmsg>" |
| 280 | */ |
| 281 | throw new NativeDaemonConnectorException( |
| 282 | code, cmd, response.get(response.size()-1).substring(4)); |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 283 | } |
| 284 | return response; |
| 285 | } |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 286 | |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 287 | /** |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 288 | * Issues a list command and returns the cooked list |
| 289 | */ |
| 290 | public String[] doListCommand(String cmd, int expectedResponseCode) |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 291 | throws NativeDaemonConnectorException { |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 292 | |
| 293 | ArrayList<String> rsp = doCommand(cmd); |
| 294 | String[] rdata = new String[rsp.size()-1]; |
| 295 | int idx = 0; |
| 296 | |
San Mehat | 1ff4371 | 2010-02-04 15:09:02 -0800 | [diff] [blame] | 297 | for (int i = 0; i < rsp.size(); i++) { |
| 298 | String line = rsp.get(i); |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 299 | try { |
| 300 | String[] tok = line.split(" "); |
| 301 | int code = Integer.parseInt(tok[0]); |
| 302 | if (code == expectedResponseCode) { |
San Mehat | 80120b4 | 2010-01-26 12:48:39 -0800 | [diff] [blame] | 303 | rdata[idx++] = line.substring(tok[0].length() + 1); |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 304 | } else if (code == NativeDaemonConnector.ResponseCode.CommandOkay) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 305 | if (LOCAL_LOGD) Slog.d(TAG, String.format("List terminated with {%s}", line)); |
San Mehat | 4086f75 | 2010-02-17 09:03:29 -0800 | [diff] [blame] | 306 | int last = rsp.size() -1; |
| 307 | if (i != last) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 308 | Slog.w(TAG, String.format("Recv'd %d lines after end of list {%s}", (last-i), cmd)); |
San Mehat | 4086f75 | 2010-02-17 09:03:29 -0800 | [diff] [blame] | 309 | for (int j = i; j <= last ; j++) { |
Joe Onorato | 8a9b220 | 2010-02-26 18:56:32 -0800 | [diff] [blame] | 310 | Slog.w(TAG, String.format("ExtraData <%s>", rsp.get(i))); |
San Mehat | 4086f75 | 2010-02-17 09:03:29 -0800 | [diff] [blame] | 311 | } |
San Mehat | 1ff4371 | 2010-02-04 15:09:02 -0800 | [diff] [blame] | 312 | } |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 313 | return rdata; |
| 314 | } else { |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 315 | throw new NativeDaemonConnectorException( |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 316 | String.format("Expected list response %d, but got %d", |
| 317 | expectedResponseCode, code)); |
| 318 | } |
| 319 | } catch (NumberFormatException nfe) { |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 320 | throw new NativeDaemonConnectorException( |
| 321 | String.format("Error reading code '%s'", line)); |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 322 | } |
| 323 | } |
San Mehat | 4c27e0e | 2010-01-29 05:22:17 -0800 | [diff] [blame] | 324 | throw new NativeDaemonConnectorException("Got an empty response"); |
San Mehat | deba693 | 2010-01-20 15:14:31 -0800 | [diff] [blame] | 325 | } |
Jeff Sharkey | fa23c5a | 2011-08-09 21:44:24 -0700 | [diff] [blame] | 326 | |
| 327 | /** {@inheritDoc} */ |
| 328 | public void monitor() { |
| 329 | synchronized (mDaemonLock) { } |
| 330 | } |
San Mehat | 67bd2cd | 2010-01-12 12:18:49 -0800 | [diff] [blame] | 331 | } |