tools/cygprofile/orderfile_generator_backend.py
def _SetDevice(self):
    """ Selects the device to be used by the script.

    Returns:
      (Device with given serial ID) : if the --device flag is set.
      (Device running Android[K,L]) : if --use-legacy-chrome-apk flag is set or
                                      no device running Android N+ was found.
      (Device running Android N+) : Otherwise.

    Raises Error:
      If no device meeting the requirements has been found.
    """
    devices = None
    if self._options.device:
      devices = [device_utils.DeviceUtils(self._options.device)]
    else:
      devices = device_utils.DeviceUtils.HealthyDevices()

    assert devices, 'Expected at least one connected device'

    if self._options.use_legacy_chrome_apk:
      self._monochrome = False
      for device in devices:
        device_version = device.build_version_sdk
        if (device_version >= version_codes.KITKAT
            and device_version <= version_codes.LOLLIPOP_MR1):
          return device

    assert not self._options.use_legacy_chrome_apk, \
      'No device found running suitable android version for Chrome.apk.'

    preferred_device = None
    for device in devices:
      if device.build_version_sdk >= version_codes.NOUGAT:
        preferred_device = device
        break

    self._monochrome = preferred_device is not None

    return preferred_device if preferred_device else devices[0]
 Selects the device to be used by the script.

    Returns:
      (Device with given serial ID) : if the --device flag is set.
      (Device running Android[K,L]) : if --use-legacy-chrome-apk flag is set or
                                      no device running Android N+ was found.
      (Device running Android N+) : Otherwise.

    Raises Error:
      If no device meeting the requirements has been found.
    
Selects the device to be used by the script.
Selects the device to be used by the script .
def _SetDevice(self):
    devices = None
    if self._options.device:
      devices = [device_utils.DeviceUtils(self._options.device)]
    else:
      devices = device_utils.DeviceUtils.HealthyDevices()
    assert devices, 'Expected at least one connected device'
    if self._options.use_legacy_chrome_apk:
      self._monochrome = False
      for device in devices:
        device_version = device.build_version_sdk
        if (device_version >= version_codes.KITKAT
            and device_version <= version_codes.LOLLIPOP_MR1):
          return device
    assert not self._options.use_legacy_chrome_apk, \
      'No device found running suitable android version for Chrome.apk.'
    preferred_device = None
    for device in devices:
      if device.build_version_sdk >= version_codes.NOUGAT:
        preferred_device = device
        break
    self._monochrome = preferred_device is not None
    return preferred_device if preferred_device else devices[0]
def _SetDevice ( self ) : devices = None if self . _options . device : devices = [ device_utils . DeviceUtils ( self . _options . device ) ] else : devices = device_utils . DeviceUtils . HealthyDevices ( ) assert devices , 'Expected at least one connected device' if self . _options . use_legacy_chrome_apk : self . _monochrome = False for device in devices : device_version = device . build_version_sdk if ( device_version >= version_codes . KITKAT and device_version <= version_codes . LOLLIPOP_MR1 ) : return device assert not self . _options . use_legacy_chrome_apk , 'No device found running suitable android version for Chrome.apk.' preferred_device = None for device in devices : if device . build_version_sdk >= version_codes . NOUGAT : preferred_device = device break self . _monochrome = preferred_device is not None return preferred_device if preferred_device else devices [ 0 ]
Selects the device to be used by the script.
Selects the device to be used by the script .
""" Selects the device to be used by the script.

    Returns:
      (Device with given serial ID) : if the --device flag is set.
      (Device running Android[K,L]) : if --use-legacy-chrome-apk flag is set or
                                      no device running Android N+ was found.
      (Device running Android N+) : Otherwise.

    Raises Error:
      If no device meeting the requirements has been found.
    """
(Device with given serial ID) : if the --device flag is set.
(Device running Android[K,L]) : if --use-legacy-chrome-apk flag is set or
no device running Android N+ was found.
(Device running Android N+) : Otherwise.
( Device with given serial ID ) : if the -- device flag is set . ( Device running Android [ K L ] ) : if -- use - legacy - chrome - apk flag is set or no device running Android N + was found . ( Device running Android N + ) : Otherwise .
self