1"""Setup for Android Bluetooth device."""
2
3from mobly import test_runner
4from mobly.controllers import android_device
5from mobly.controllers.android_device_lib.services import sl4a_service
6from blueberry.utils import blueberry_base_test
7
8
9class BluetoothDeviceSetup(blueberry_base_test.BlueberryBaseTest):
10  """A class for Bluetooth device setup.
11
12  This is not a test, just used to do device quick setup for building a testbed.
13  """
14
15  def test_setup_device(self):
16    """Setup a Bluetooth device.
17
18    Executes logging setup and checks if MBS and SL4A can be used.
19    """
20    device = self.android_devices[0]
21    # Setup logging
22    self.set_bt_trc_level_verbose(device)
23    self.set_btsnooplogmode_full(device)
24    self.set_logger_buffer_size_16m(device)
25    device.reboot()
26    # Loads MBS and SL4A to make sure they work fine.
27    device.load_snippet('mbs', android_device.MBS_PACKAGE)
28    device.services.register('sl4a', sl4a_service.Sl4aService)
29
30
31if __name__ == '__main__':
32  test_runner.main()
33