summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunjie Hu <junjie.hu@mediatek.com>2014-08-29 11:20:28 +0800
committerThe Android Automerger <android-build@google.com>2014-11-07 13:56:36 -0800
commit35df9145261bc2a27306cda88c5a259bb674bd8e (patch)
tree9c110f524af7791290e1842330f5e45ef07180a0
parentfa8bd10090e80c8f9a28ef552840135426742c17 (diff)
downloadcts-35df9145261bc2a27306cda88c5a259bb674bd8e.tar.gz
CTS Verifier:Fix timing issue for Ble Client Connect
Bug: 17449134 There's a timing issue to make the test case failure. The pre-condition is: 1. First time to connect. (It means it never do pairing or it has been unpaired) 2. The GATT connection between the two phones is using BR/EDR and using the the non-just work pairing approach. (Sometime, it will popup a dialog to do pairing ...) Scenario description: 1. Run the apk to let client to connect to server 2. Each side starts to pair (Due to use non-just work pairing approach) 3. Client side must pull the notification bar to focus the pairing dialog. 4. Both side click the yes button to pair. 5. The pass icon in the client side is not enabled. Reason: * Because the GATT connection callback is invoked when the client activity is paused, the receiver is unregistered and lost the intent. Solution: * Move the registeration/unregisteration of the receiver from onResume/onPause to onCreate/onDestroy Note: * Although MTK's BT stack changes the pairing approach to pass the CTS Verifier, it's highly recommended to apply our patch to make the CTS Verifier to have better compatibility. Change-Id: I462b268045dd7d84c989be62bb31f4adb1c5ae2e Signed-off-by: Junjie Hu <junjie.hu@mediatek.com>
-rwxr-xr-x[-rw-r--r--]apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java10
1 files changed, 3 insertions, 7 deletions
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
index a3a98301188..fb351b1de1d 100644..100755
--- a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
+++ b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
@@ -63,19 +63,15 @@ public class BleClientConnectActivity extends PassFailButtons.Activity {
}
}
});
- }
- @Override
- public void onResume() {
- super.onResume();
IntentFilter filter = new IntentFilter();
filter.addAction(BleClientService.BLE_BLUETOOTH_CONNECTED);
registerReceiver(onBroadcast, filter);
}
@Override
- public void onPause() {
- super.onPause();
+ protected void onDestroy(){
+ super.onDestroy();
unregisterReceiver(onBroadcast);
}
@@ -90,4 +86,4 @@ public class BleClientConnectActivity extends PassFailButtons.Activity {
getPassButton().setEnabled(true);
}
};
-} \ No newline at end of file
+}