mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-05 21:52:10 +01:00
AndroidGCS: Somehow multiple disconnects were triggered.
This commit is contained in:
parent
91a8186e54
commit
7c6b81517e
@ -128,14 +128,15 @@ public class OPTelemetryService extends Service {
|
|||||||
case MSG_DISCONNECT:
|
case MSG_DISCONNECT:
|
||||||
Toast.makeText(getApplicationContext(), "Disconnect requested", Toast.LENGTH_SHORT).show();
|
Toast.makeText(getApplicationContext(), "Disconnect requested", Toast.LENGTH_SHORT).show();
|
||||||
terminate = true;
|
terminate = true;
|
||||||
activeTelem.interrupt();
|
if (activeTelem != null) {
|
||||||
try {
|
activeTelem.interrupt();
|
||||||
activeTelem.join();
|
try {
|
||||||
} catch (InterruptedException e) {
|
activeTelem.join();
|
||||||
e.printStackTrace();
|
} catch (InterruptedException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
activeTelem = null;
|
||||||
}
|
}
|
||||||
activeTelem = null;
|
|
||||||
|
|
||||||
Intent intent = new Intent();
|
Intent intent = new Intent();
|
||||||
intent.setAction(INTENT_ACTION_DISCONNECTED);
|
intent.setAction(INTENT_ACTION_DISCONNECTED);
|
||||||
sendBroadcast(intent,null);
|
sendBroadcast(intent,null);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user