Commit 01224ba8 authored by Tarek Ziadé's avatar Tarek Ziadé
Browse files

Bug 1579853 - added get_sys_info() r=bc

This API returns the data from get_info() along with a handful
list of dumpsys services data.

Differential Revision: https://phabricator.services.mozilla.com/D45317

--HG--
extra : moz-landing-system : lando
parent da226821
Loading
Loading
Loading
Loading
+20 −0
Original line number Diff line number Diff line
@@ -2824,6 +2824,26 @@ class ADBDevice(ADBCommand):
        self._initialize_boot_state(timeout=timeout)
        return self.is_device_ready(timeout=timeout)

    def get_sysinfo(self, timeout=None):
        """
        Returns a detailed dictionary of information strings about the device.

        :param timeout: optional integer specifying the maximum time in
            seconds for any spawned adb process to complete before
            throwing an ADBTimeoutError.
            This timeout is per adb call. The total time spent
            may exceed this value. If it is not specified, the value
            set in the ADB constructor is used.

        :raises: * ADBTimeoutError
        """
        results = {"info": self.get_info(timeout=timeout)}
        for service in ("meminfo", "cpuinfo", "dbinfo", "procstats", "usagestats",
                        "battery", "batterystats", "diskstats"):
            results[service] = self.shell_output("dumpsys %s" % service,
                                                 timeout=timeout)
        return results

    def get_info(self, directive=None, timeout=None):
        """
        Returns a dictionary of information strings about the device.