IllegalThreadStateException when starting contact exchange task
- Android version: 8.1.0
- Briar version: 1.1.5 (8f4c3c45)
- Phone model: OnePlus A0001 (bacon)
- User feedback: "Tried to connect @ 35C3 during the event."
java.lang.IllegalThreadStateException at java.lang.Thread.start(Thread.java:724) at org.briarproject.bramble.contact.ContactExchangeTaskImpl.startExchange(ContactExchangeTaskImpl.java:113) at org.briarproject.briar.android.keyagreement.ContactExchangeActivity.lambda$startContactExchange$0(ContactExchangeActivity.java:66) at org.briarproject.briar.android.keyagreement.-$$Lambda$ContactExchangeActivity$fyog59L3yYwzJYBvp0hzYrpHYRo.run(Unknown Source:4) at org.briarproject.briar.android.controller.DbControllerImpl.lambda$runOnDbThread$0(DbControllerImpl.java:35) at org.briarproject.briar.android.controller.-$$Lambda$DbControllerImpl$SwC9ndeQwlnMM-VN8yvqCJG1ESc.run(Unknown Source:4) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1162) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:636) at java.lang.Thread.run(Thread.java:764)
This exception is thrown if start() is called when the thread isn't in the initial state. A couple of guesses about how this could have happened:
- A ContactExchangeTask instance was reused across multiple contacts
- A ContactExchangeActivity instance received multiple KeyAgreementFinishedEvents, possibly relating to different contacts, each of which cause it to start its ContactExchangeTask
Assigning to myself as I'm refactoring this code for remote contacts.
To upload designs, you'll need to enable LFS. More information