mirror of
https://github.com/oxen-io/session-android.git
synced 2025-01-11 16:33:39 +00:00
Add uncaught exception handler to message retrieval thread
Related #6644 // FREEBIE
This commit is contained in:
parent
711740d156
commit
5672701a60
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user