parameters: (self, timeout=None, retries=None)
docstring: Context manager that enables battery data collection. It makes
      the device appear to stop charging so that dumpsys will start collecting
      power data since last charge. Once the with block is exited, charging is
      resumed and power data since last charge is no longer collected.
  
      Only for devices L and higher.
  
      Example usage:
        with BatteryMeasurement():
          browser_actions()
          get_power_data() # report usage within this block
        after_measurements() # Anything that runs after power
                             # measurements are collected
  
      Args:
        timeout: timeout in seconds
        retries: number of retries
  
      Raises:
        device_errors.DeviceVersionError: If device is not L or higher.
docstring_summary: Context manager that enables battery data collection. It makes
      the device appear to stop charging so that dumpsys will start collecting
      power data since last charge. Once the with block is exited, charging is
      resumed and power data since last charge is no longer collected.
docstring_tokens: Context manager that enables battery data collection . It makes the device appear to stop charging so that dumpsys will start collecting power data since last charge . Once the with block is exited charging is resumed and power data since last charge is no longer collected .
function: def BatteryMeasurement(self, timeout=None, retries=None):
      """Context manager that enables battery data collection. It makes
      the device appear to stop charging so that dumpsys will start collecting
      power data since last charge. Once the with block is exited, charging is
      resumed and power data since last charge is no longer collected.
  
      Only for devices L and higher.
  
      Example usage:
        with BatteryMeasurement():
          browser_actions()
          get_power_data() # report usage within this block
        after_measurements() # Anything that runs after power
                             # measurements are collected
  
      Args:
        timeout: timeout in seconds
        retries: number of retries
  
      Raises:
        device_errors.DeviceVersionError: If device is not L or higher.
      """
      if self._device.build_version_sdk < version_codes.LOLLIPOP:
        raise device_errors.DeviceVersionError('Device must be L or higher.')
      try:
        self.DisableBatteryUpdates(timeout=timeout, retries=retries)
        yield
      finally:
        self.EnableBatteryUpdates(timeout=timeout, retries=retries)
function_tokens: def BatteryMeasurement ( self , timeout = None , retries = None ) : if self . _device . build_version_sdk < version_codes . LOLLIPOP : raise device_errors . DeviceVersionError ( 'Device must be L or higher.' ) try : self . DisableBatteryUpdates ( timeout = timeout , retries = retries ) yield finally : self . EnableBatteryUpdates ( timeout = timeout , retries = retries )