Skip to content
Snippets Groups Projects
Commit 2fd5af10 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "Definitely abort reconnecting to native daemon during shutdown"

parents 86316a4b be12b81b
No related branches found
No related tags found
No related merge requests found
......@@ -134,21 +134,23 @@ final class NativeDaemonConnector implements Runnable, Handler.Callback, Watchdo
mCallbackHandler = new Handler(mLooper, this);
while (true) {
if (isShuttingDown()) break;
try {
listenToSocket();
} catch (Exception e) {
loge("Error in NativeDaemonConnector: " + e);
String shutdownAct = SystemProperties.get(
ShutdownThread.SHUTDOWN_ACTION_PROPERTY, "");
if (shutdownAct != null && shutdownAct.length() > 0) {
// The device is in middle of shutdown.
break;
}
if (isShuttingDown()) break;
SystemClock.sleep(5000);
}
}
}
private static boolean isShuttingDown() {
String shutdownAct = SystemProperties.get(
ShutdownThread.SHUTDOWN_ACTION_PROPERTY, "");
return shutdownAct != null && shutdownAct.length() > 0;
}
@Override
public boolean handleMessage(Message msg) {
final String event = (String) msg.obj;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment