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.

* Because the GATT connection callback is invoked when the client activity is paused,
   the receiver is unregistered and lost the intent.

* Move the registeration/unregisteration of the receiver
   from onResume/onPause to onCreate/onDestroy

* 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>
1 file changed