Bug 1425163 - Use cat /proc/meminfo rather than trying to pull it from device; r=bc

This commit is contained in:
Geoff Brown 2017-12-14 09:46:04 -06:00
Родитель 0de4d4e471
Коммит 6aa123de17
1 изменённых файлов: 7 добавлений и 5 удалений

Просмотреть файл

@ -643,11 +643,13 @@ class DeviceManagerADB(DeviceManager):
if directive == "systime" or directive == "all":
ret["systime"] = self.shellCheckOutput(["date"], timeout=self.short_timeout)
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"]
out = self.shellCheckOutput(["cat", "/proc/meminfo"], timeout=self.short_timeout)
out = out.replace('\r\n', '\n').splitlines(True)
for line in out:
parts = line.split(":")
if len(parts) == 2 and parts[0] == "MemTotal":
ret["memtotal"] = parts[1].strip()
break
if directive == "disk" or directive == "all":
data = self.shellCheckOutput(
["df", "/data", "/system", "/sdcard"], timeout=self.short_timeout)