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

This commit is contained in:
Dave Hunt 2014-10-14 13:43:22 -04:00
parent 1ba2333d39
commit 80ab08fc64
2 changed files with 7 additions and 0 deletions

View File

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

View File

@ -514,6 +514,12 @@ class DeviceManagerADB(DeviceManager):
ret["process"] = self.shellCheckOutput(["ps"]) ret["process"] = self.shellCheckOutput(["ps"])
if directive == "systime" or directive == "all": if directive == "systime" or directive == "all":
ret["systime"] = self.shellCheckOutput(["date"]) 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) self._logger.info(ret)
return ret return ret