|
|
|
@ -182,10 +182,14 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|
|
|
|
return pipe;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private class MessageRetrievalThread extends Thread {
|
|
|
|
|
private class MessageRetrievalThread extends Thread implements Thread.UncaughtExceptionHandler {
|
|
|
|
|
|
|
|
|
|
private AtomicBoolean stopThread = new AtomicBoolean(false);
|
|
|
|
|
|
|
|
|
|
MessageRetrievalThread() {
|
|
|
|
|
setUncaughtExceptionHandler(this);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void run() {
|
|
|
|
|
while (!stopThread.get()) {
|
|
|
|
@ -235,5 +239,11 @@ public class MessageRetrievalService extends Service implements InjectableType,
|
|
|
|
|
public void stopThread() {
|
|
|
|
|
stopThread.set(true);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void uncaughtException(Thread t, Throwable e) {
|
|
|
|
|
Log.w(TAG, "*** Uncaught exception!");
|
|
|
|
|
Log.w(TAG, e);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|