parameters: (self, timeout=DEFAULT, retries=DEFAULT)
return_statement: return self._cache['needs_su']
docstring: Checks whether 'su' is needed to access protected resources.
  
      Args:
        timeout: timeout in seconds
        retries: number of retries
  
      Returns:
        True if 'su' is available on the device and is needed to to access
          protected resources; False otherwise if either 'su' is not available
          (e.g. because the device has a user build), or not needed (because adbd
          already has root privileges).
  
      Raises:
        CommandTimeoutError on timeout.
        DeviceUnreachableError on missing device.
docstring_summary: Checks whether 'su' is needed to access protected resources.
docstring_tokens: Checks whether su is needed to access protected resources .
function: def NeedsSU(self, timeout=DEFAULT, retries=DEFAULT):
      """Checks whether 'su' is needed to access protected resources.
  
      Args:
        timeout: timeout in seconds
        retries: number of retries
  
      Returns:
        True if 'su' is available on the device and is needed to to access
          protected resources; False otherwise if either 'su' is not available
          (e.g. because the device has a user build), or not needed (because adbd
          already has root privileges).
  
      Raises:
        CommandTimeoutError on timeout.
        DeviceUnreachableError on missing device.
      """
      if 'needs_su' not in self._cache:
        try:
          self.RunShellCommand(
              '%s && ! ls /root' % self._Su('ls /root'), check_return=True,
              timeout=self._default_timeout if timeout is DEFAULT else timeout,
              retries=self._default_retries if retries is DEFAULT else retries)
          self._cache['needs_su'] = True
        except device_errors.AdbCommandFailedError:
          self._cache['needs_su'] = False
      return self._cache['needs_su']
function_tokens: def NeedsSU ( self , timeout = DEFAULT , retries = DEFAULT ) : if 'needs_su' not in self . _cache : try : self . RunShellCommand ( '%s && ! ls /root' % self . _Su ( 'ls /root' ) , check_return = True , timeout = self . _default_timeout if timeout is DEFAULT else timeout , retries = self . _default_retries if retries is DEFAULT else retries ) self . _cache [ 'needs_su' ] = True except device_errors . AdbCommandFailedError : self . _cache [ 'needs_su' ] = False return self . _cache [ 'needs_su' ]