question: public void testConnectA2dp ( ) { int iterations = BluetoothTestRunner . sConnectA2dpIterations ; if ( iterations == 0 ) { return ; } BluetoothAdapter adapter = BluetoothAdapter . getDefaultAdapter ( ) ; BluetoothDevice device = adapter . getRemoteDevice ( BluetoothTestRunner . sDeviceAddress ) ; mTestUtils . disable ( adapter ) ; mTestUtils . enable ( adapter ) ; mTestUtils . unpair ( adapter , device ) ; mTestUtils . pair ( adapter , device , BluetoothTestRunner . sDevicePairPasskey , BluetoothTestRunner . sDevicePairPin ) ; mTestUtils . disconnectProfile ( adapter , device , BluetoothProfile . A2DP , null ) ; for ( int i = 0 ; i < iterations ; i ++ ) { mTestUtils . writeOutput ( "connectA2dp iteration " + ( i + 1 ) + " of " + iterations ) ; mTestUtils . connectProfile ( adapter , device , BluetoothProfile . A2DP , String . format ( "connectA2dp(device=%s)" , device ) ) ; mTestUtils . disconnectProfile ( adapter , device , BluetoothProfile . A2DP , String . format ( "disconnectA2dp(device=%s)" , device ) ) ; } mTestUtils . unpair ( adapter , device ) ; mTestUtils . disable ( adapter ) ; }
target:  Stress test for connecting and disconnecting with an A2DP source. <p> In this test, the local device plays the role of an A2DP sink, and initiates connections and disconnections with an A2DP source.