summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGaurav Asati <gasati@codeaurora.org>2014-11-06 10:59:53 +0530
committerGerrit - the friendly Code Review server <code-review@localhost>2014-11-06 23:03:21 -0800
commitd0a0bca6cc5bc0b0c0362b17d92f230c88a84fd2 (patch)
tree5e4150a7d91f79ee095478b9e53698f208abe344
parent4ee50302450ad34f44d3516323f36b4c6f1e25f0 (diff)
downloadandroid_packages_apps_BluetoothExt-d0a0bca6cc5bc0b0c0362b17d92f230c88a84fd2.tar.gz
android_packages_apps_BluetoothExt-d0a0bca6cc5bc0b0c0362b17d92f230c88a84fd2.tar.bz2
android_packages_apps_BluetoothExt-d0a0bca6cc5bc0b0c0362b17d92f230c88a84fd2.zip
Bluetooth: Check for device connection state.
- Before storing call states check for device connection state. - When no device are connected getCurrentCalls returns null Change-Id: I7211085fabb738267ca7e2524db976e8dc9a568e
-rw-r--r--bttestapp/src/org/codeaurora/bluetooth/bttestapp/HfpTestActivity.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/bttestapp/src/org/codeaurora/bluetooth/bttestapp/HfpTestActivity.java b/bttestapp/src/org/codeaurora/bluetooth/bttestapp/HfpTestActivity.java
index aaf1369..05e722b 100644
--- a/bttestapp/src/org/codeaurora/bluetooth/bttestapp/HfpTestActivity.java
+++ b/bttestapp/src/org/codeaurora/bluetooth/bttestapp/HfpTestActivity.java
@@ -389,8 +389,10 @@ public class HfpTestActivity extends MonkeyActivity implements IBluetoothConnect
if (mBluetoothHeadsetClient != null) {
mCalls.clear();
Integer id = 1;
+ int connState = mBluetoothHeadsetClient.getConnectionState(mDevice);
// save all calls status
- if (!mBluetoothHeadsetClient.getCurrentCalls(mDevice).isEmpty()) {
+ if (connState == BluetoothProfile.STATE_CONNECTED &&
+ !mBluetoothHeadsetClient.getCurrentCalls(mDevice).isEmpty()) {
for (BluetoothHeadsetClientCall call :
mBluetoothHeadsetClient.getCurrentCalls(mDevice)) {
mCalls.put(id, call);