Bug 1078274 - [mozdevice] Add memtotal to getInfo with implementation in DeviceManagerADB. r=wlach

This commit is contained in:
Dave Hunt 2014-10-13 03:10:00 -04:00
parent 09460e99ab
commit 61900f7977
2 changed files with 7 additions and 0 deletions

View File

@ -112,6 +112,7 @@ class DeviceManager(object):
- `systime` - system time of the device
- `screen` - screen resolution
- `memory` - memory stats
- `memtotal` - total memory available on the device, for example 927208 kB
- `process` - list of running processes (same as ps)
- `disk` - total, free, available bytes on disk
- `power` - power status (charge, battery temp)

View File

@ -514,6 +514,12 @@ class DeviceManagerADB(DeviceManager):
ret["process"] = self.shellCheckOutput(["ps"])
if directive == "systime" or directive == "all":
ret["systime"] = self.shellCheckOutput(["date"])
if directive == "memtotal" or directive == "all":
meminfo = {}
for line in self.pullFile("/proc/meminfo").splitlines():
key, value = line.split(":")
meminfo[key] = value.strip()
ret["memtotal"] = meminfo["MemTotal"]
self._logger.info(ret)
return ret