mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2024-11-30 08:24:11 +01:00
Android Telemetry: Start the service explicitly before binding.
This ensures it continues running while the tablet rotates or changes activities.
This commit is contained in:
parent
ab291ae1e4
commit
955c030c0f
@ -256,6 +256,7 @@ public abstract class ObjectManagerActivity extends Activity {
|
||||
// Bind to the telemetry service (which will start it)
|
||||
Intent intent = new Intent(getApplicationContext(),
|
||||
org.openpilot.androidgcs.telemetry.OPTelemetryService.class);
|
||||
startService(intent);
|
||||
if (DEBUG)
|
||||
Log.d(TAG, "Attempting to bind: " + intent);
|
||||
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||
|
@ -143,7 +143,7 @@ public class BluetoothUAVTalk extends TelemetryTask {
|
||||
socket = null;
|
||||
|
||||
try {
|
||||
socket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);
|
||||
socket = device.createRfcommSocketToServiceRecord(MY_UUID);
|
||||
} catch (IOException e) {
|
||||
if (ERROR) Log.e(TAG,"Unable to create Rfcomm socket");
|
||||
return false;
|
||||
|
Loading…
Reference in New Issue
Block a user