summaryrefslogtreecommitdiffstats
path: root/pxp-monitor
diff options
context:
space:
mode:
authorSatish kumar sugasi <ssugas@codeaurora.org>2014-05-16 19:42:06 -0700
committerSatish kumar sugasi <ssugas@codeaurora.org>2014-05-20 15:51:46 -0700
commit0de1c7b89ab704d59ed5996b8e7d1e5b2356edba (patch)
tree96f31f5bbeeda553623a49fd757645194c61e3b9 /pxp-monitor
parent14fcd5f671f07ac20bd061cb014304b8f5609679 (diff)
downloadandroid_packages_apps_BluetoothExt-0de1c7b89ab704d59ed5996b8e7d1e5b2356edba.tar.gz
android_packages_apps_BluetoothExt-0de1c7b89ab704d59ed5996b8e7d1e5b2356edba.tar.bz2
android_packages_apps_BluetoothExt-0de1c7b89ab704d59ed5996b8e7d1e5b2356edba.zip
Bluetooth: allows pxp service to persist even pxpmonitor destroyed
This allows pxpservice to maintain gatt links and deviceproperties list even if pxp test app were to get destroyed for any reason. CRs-Fixed: 628507 Change-Id: I73f4c6199becad51eff969e15c6d6ff274bbb313
Diffstat (limited to 'pxp-monitor')
-rw-r--r--pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/MainActivity.java12
-rw-r--r--pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PxpServiceProxy.java8
2 files changed, 9 insertions, 11 deletions
diff --git a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/MainActivity.java b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/MainActivity.java
index 0e2b239..0bb7f6f 100644
--- a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/MainActivity.java
+++ b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/MainActivity.java
@@ -102,9 +102,11 @@ public class MainActivity extends Activity implements ConnectToDeviceDialogListe
Log.d(TAG, "On create: new intent BluetoothService");
Intent gattServiceIntent = new Intent(this, PxpServiceProxy.class);
- if (bindService(gattServiceIntent, mConnection, BIND_AUTO_CREATE) == false) {
+ if (bindService(gattServiceIntent, mConnection, 0) == false) {
Log.e(TAG, "Unable to bind");
}
+ else
+ startService(gattServiceIntent);
}
}
@@ -120,9 +122,11 @@ public class MainActivity extends Activity implements ConnectToDeviceDialogListe
Intent gattServiceIntent = new Intent(this, PxpServiceProxy.class);
Log.d(TAG, "On create: new intent BluetoothService");
- if (bindService(gattServiceIntent, mConnection, BIND_AUTO_CREATE) == false) {
+ if (bindService(gattServiceIntent, mConnection,0) == false) {
Log.e(TAG, "Unable to bind");
}
+ else
+ startService(gattServiceIntent);
}
}
@@ -134,9 +138,7 @@ public class MainActivity extends Activity implements ConnectToDeviceDialogListe
@Override
protected void onDestroy() {
- if (mPxpServiceProxy != null) {
- mPxpServiceProxy.disconnectDevices();
- }
+ Log.v(TAG, "onDestroy ");
unbindService(mConnection);
mPxpServiceProxy = null;
diff --git a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PxpServiceProxy.java b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PxpServiceProxy.java
index 8707ec7..3864ca2 100644
--- a/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PxpServiceProxy.java
+++ b/pxp-monitor/src/org/codeaurora/bluetooth/pxpmonitor/PxpServiceProxy.java
@@ -136,7 +136,8 @@ public class PxpServiceProxy extends Service {
Log.d(TAG, "On create: new intent BluetoothService");
Intent gattServiceIntent = new Intent();
gattServiceIntent.setAction("org.codeaurora.bluetooth.pxpservice.PxpMonitorService");
- bindService(gattServiceIntent, mConnection, BIND_AUTO_CREATE);
+ bindService(gattServiceIntent, mConnection,0);
+ startService(gattServiceIntent);
mAlertHistory = new ArrayList<AlertInformation>();
@@ -156,12 +157,7 @@ public class PxpServiceProxy extends Service {
public void onDestroy() {
Log.d(TAG, "onDestroy");
super.onDestroy();
-
unregisterReceiver(mDataReceiver);
-
- Log.d(TAG, "UnbindService()");
- unbindService(mConnection);
- mPxpMonitorService = null;
}
@Override