parameters: (device_id)
return_statement: return ACCESS_NORMAL
docstring: Determines what kind of access level we have on the device
docstring_summary: Determines what kind of access level we have on the device
docstring_tokens: Determines what kind of access level we have on the device
function: def get_device_access_type(device_id):
      '''
      Determines what kind of access level we have on the device
      '''
      adb_call('root', device = device_id) # this ends up being either a no-op or restarts adbd on device as root
  
      adbd_info = adb_call('shell', '"ps | grep adbd"', device = device_id)
      if adbd_info and ('root' in adbd_info):
          Logs.debug('adb_call: Device - {} - has adbd root access'.format(device_id))
          return ACCESS_ROOT_ADBD
  
      su_test = adb_call('shell', '"su -c echo test"', device = device_id)
      if su_test and ('test' in su_test):
          Logs.debug('adb_call: Device - {} - has shell su access'.format(device_id))
          return ACCESS_SHELL_SU
  
      Logs.debug('adb_call: Unable to verify root access for device {}.  Assuming default access mode.'.format(device_id))
      return ACCESS_NORMAL
function_tokens: def get_device_access_type ( device_id ) : adb_call ( 'root' , device = device_id ) # this ends up being either a no-op or restarts adbd on device as root adbd_info = adb_call ( 'shell' , '"ps | grep adbd"' , device = device_id ) if adbd_info and ( 'root' in adbd_info ) : Logs . debug ( 'adb_call: Device - {} - has adbd root access' . format ( device_id ) ) return ACCESS_ROOT_ADBD su_test = adb_call ( 'shell' , '"su -c echo test"' , device = device_id ) if su_test and ( 'test' in su_test ) : Logs . debug ( 'adb_call: Device - {} - has shell su access' . format ( device_id ) ) return ACCESS_SHELL_SU Logs . debug ( 'adb_call: Unable to verify root access for device {}.  Assuming default access mode.' . format ( device_id ) ) return ACCESS_NORMAL