mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-28 17:54:15 +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)
|
// Bind to the telemetry service (which will start it)
|
||||||
Intent intent = new Intent(getApplicationContext(),
|
Intent intent = new Intent(getApplicationContext(),
|
||||||
org.openpilot.androidgcs.telemetry.OPTelemetryService.class);
|
org.openpilot.androidgcs.telemetry.OPTelemetryService.class);
|
||||||
|
startService(intent);
|
||||||
if (DEBUG)
|
if (DEBUG)
|
||||||
Log.d(TAG, "Attempting to bind: " + intent);
|
Log.d(TAG, "Attempting to bind: " + intent);
|
||||||
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
bindService(intent, mConnection, Context.BIND_AUTO_CREATE);
|
||||||
|
@ -143,7 +143,7 @@ public class BluetoothUAVTalk extends TelemetryTask {
|
|||||||
socket = null;
|
socket = null;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
socket = device.createInsecureRfcommSocketToServiceRecord(MY_UUID);
|
socket = device.createRfcommSocketToServiceRecord(MY_UUID);
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
if (ERROR) Log.e(TAG,"Unable to create Rfcomm socket");
|
if (ERROR) Log.e(TAG,"Unable to create Rfcomm socket");
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user