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>
diff --git a/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java b/apps/CtsVerifier/src/com/android/cts/verifier/bluetooth/BleClientConnectActivity.java
old mode 100644
new mode 100755
index a3a9830..fb351b1
--- 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 @@
                 }
             }
         });
-    }
 
-    @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 @@
             getPassButton().setEnabled(true);
         }
     };
-}
\ No newline at end of file
+}