Esempio n. 1
0
    def __init__(self, backend, adb):
        super(AndroidDevice, self).__init__(backend=backend,
                                            settings=backends.Settings(
                                                AndroidDevice._SETTINGS_KEYS))
        self.adb = adb
        self._name = '%s %s' % (adb.GetProp('ro.product.model', cached=True),
                                adb.GetProp('ro.build.id', cached=True))
        self._id = adb.serial
        self._sys_stats = None
        self._last_device_stats = None
        self._sys_stats_last_update = None
        self._processes = {}  # pid (int) -> |Process|
        self._initialized = False

        # Determine the available ABIs, |_arch| will contain the primary ABI.
        # TODO(primiano): For the moment we support only one ABI per device (i.e. we
        # assume that all processes are 64 bit on 64 bit device, failing to profile
        # 32 bit ones). Dealing properly with multi-ABIs requires work on ps_ext and
        # at the moment is not an interesting use case.
        self._arch = None
        self._arch32 = None
        self._arch64 = None
        abi = adb.GetProp('ro.product.cpu.abi', cached=True)
        if abi in _SUPPORTED_64BIT_ABIS:
            self._arch = self._arch64 = _SUPPORTED_64BIT_ABIS[abi]
        elif abi in _SUPPORTED_32BIT_ABIS:
            self._arch = self._arch32 = _SUPPORTED_32BIT_ABIS[abi]
        else:
            raise exceptions.MemoryInspectorException('ABI %s not supported' %
                                                      abi)
Esempio n. 2
0
 def __init__(self, backend, adb):
   super(AndroidDevice, self).__init__(
       backend=backend,
       settings=backends.Settings(AndroidDevice._SETTINGS_KEYS))
   self.adb = adb
   self._id = adb.GetDevice()
   self._name = adb.GetProductModel()
   self._sys_stats = None
   self._sys_stats_last_update = None
Esempio n. 3
0
 def __init__(self, backend, adb):
     super(AndroidDevice, self).__init__(backend=backend,
                                         settings=backends.Settings(
                                             AndroidDevice._SETTINGS_KEYS))
     self.adb = adb
     self._id = adb.GetDevice()
     self._name = adb.GetProductModel()
     self._sys_stats = None
     self._last_device_stats = None
     self._sys_stats_last_update = None
     self._processes = {}  # pid (int) -> |Process|
     self._initialized = False
 def __init__(self, backend, underlying_device):
   super(AndroidDevice, self).__init__(
       backend=backend,
       settings=backends.Settings(AndroidDevice._SETTINGS_KEYS))
   self.underlying_device = underlying_device
   self._id = str(underlying_device)
   self._name = underlying_device.GetProp('ro.product.model')
   self._sys_stats = None
   self._last_device_stats = None
   self._sys_stats_last_update = None
   self._processes = {}  # pid (int) -> |Process|
   self._initialized = False
Esempio n. 5
0
 def __init__(self):
     super(AndroidBackend, self).__init__(
         settings=backends.Settings(AndroidBackend._SETTINGS_KEYS))
     self._devices = {}  # 'device id' -> |Device|.
Esempio n. 6
0
 def __init__(self, settings=None):
   super(AndroidBackend, self).__init__(
       settings=backends.Settings(AndroidBackend._SETTINGS_KEYS))