1
0
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:
James Cotton 2012-10-02 23:36:49 -05:00
parent ab291ae1e4
commit 955c030c0f
2 changed files with 2 additions and 1 deletions

View File

@ -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);

View File

@ -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;