Ctsverifier Bluetooth Le secure client server test tests pass, but passbutton cannot be selected


[problem description]

Ctsverifier Bluetooth Le secure client server test tests pass but cannot select pass button
Tool version: 9.0-r11
Other information:
The last version is normal, and the verifier version is the same
In the analysis process, combined with the code consulting test, it is confirmed that only the client cannot be selected, and the server is normal


The Bluetooth driver has been modified and brought in. It has been positioned and fallback. It needs to be further modified by BSP

The test process of verifier is as follows:
After the client tests pass, it makes a decision to close first mAdapter.disable Open after () mAdapter.enable The action of (),
After combing the process of Bluetooth box, it is found that the timeout of opening Bluetooth again after closing failed, resulting in that the activity of verifier cannot receive the broadcast, and the button is set as optional enable

Authblog: Autumn Cityhttps://www.cnblogs.com/houser0323

[detailed analysis]


Process Overview
1. Start blesecureclientstartactivity
The test page is just an activity UI. The main method implementation and process actions are in the parent class activity, focusing on the parent class.
2. Call oncreate() of the parent class bleclienttestbaseactivity to complete:
Page display
Set the monitor of the bottom pass fail button
Setting pass button to disable is not optional
Initialize the test item listview of the page
Return to subclass and continue oncreate():
Dialog displaying info prompt information
Start bleclientservice to prepare for testing

3. Call onresume() of parent bleclienttestbaseactivity:
Register broadcast receiver m broadcast of bleclientservice

4. Start the test
This test is a server client pairing test for two devices. It is triggered automatically and abridged. It is related to Bluetooth communication between servers
At the end of each test in listview, a broadcast will be sent out. After receiving the broadcast, mpased will do or operation. If everything goes well, the result of mpased operation is pass_ FLAG_ ALL
This means that all the test items have passed

private static final int PASS_FLAG_ALL = 0x3FFFF;

Then the client side turns off Bluetooth mAdapter.disable () open again mAdapter.enable (), the activity will set the pass button to be optional only after opening successfully
Due to a problem with the driver code, enable() failed and the optional button cannot be set

Test code
1. Test activity and provide UI without business code
2. The parent class of (1) above, test result processing
3. Test service, real test item execution

Key logs

Test all pass

04-21 16:52:05.901 D/BluetoothGatt( 6338): onClientConnectionState() - status=0 clientIf=6 device=7B:D0:42:AC:47:B6
04-21 16:52:05.901 D/BleClientService( 6338): onConnectionStateChange: status= 0, newState= 0
04-21 16:52:05.901 D/BluetoothGatt( 6338): close()
04-21 16:52:05.901 D/BluetoothGatt( 6338): unregisterApp() - mClientIf=6
04-21 16:52:05.915 D/BleClientTestBase( 6338): Processing com.android.cts.verifier.bluetooth.BLE_BLUETOOTH_DISCONNECTED
04-21 16:52:05.921 D/BleClientTestBase( 6338): Passed Flags has changed from 0x0003FDFF to 0x0003FFFF. Delta=0x00000200
04-21 16:52:05.921 D/BleClientTestBase( 6338): All Tests Passed.

Bluetooth is off normally

04-21 16:52:06.931 D/AdapterProperties( 3406): Setting state to TURNING_OFF
04-21 16:52:07.038 I/AdapterState( 3406): BLE_TURNING_OFF : entered 
04-21 16:52:07.057 I/bt_btif_core( 3406): btif_disable_bluetooth finished

Bluetooth on timeout

04-21 16:52:17.051 D/BluetoothManagerService( 3297): enable(com.android.cts.verifier):  mBluetooth =null mBinding = false mState = OFF
04-21 16:52:17.288 D/BluetoothAdapterService( 7058): bleOnProcessStart()
04-21 16:52:17.290 D/BluetoothManagerService( 3297): MESSAGE_BLUETOOTH_STATE_CHANGE: OFF > BLE_TURNING_ON
04-21 16:52:17.290 D/BluetoothManagerService( 3297): Sending BLE State Change: OFF > BLE_TURNING_ON
04-21 16:52:21.292 E/AdapterState( 7058): BLE_TURNING_ON : BLE_START_TIMEOUT
04-21 16:52:21.293 I/AdapterState( 7058): BLE_TURNING_OFF : entered

Recommended Today

Deeply analyze the principle and practice of RSA key

1、 Preface After experiencing many dark moments in life, when you read this article, you will regret and even be angry: why didn’t you write this article earlier?! Your darkest moments include: 1. Your project needs to be connected with the bank, and the other party needs you to provide an encryption certificate. You have […]