Chromium Code Reviews| Index: appengine/third_party/python-adb/adb/high.py |
| diff --git a/appengine/third_party/python-adb/adb/high.py b/appengine/third_party/python-adb/adb/high.py |
| index 5b80654004623a5053d9d303bd387f510733b2c3..b5569843a63e8ddf07a85a60742d48619825936e 100644 |
| --- a/appengine/third_party/python-adb/adb/high.py |
| +++ b/appengine/third_party/python-adb/adb/high.py |
| @@ -432,10 +432,16 @@ class HighDevice(object): |
| _LOG.warning( |
| '%s.SetCPUScalingGovernor(): Read invalid scaling_governor: %s', |
| self.port_path, prev) |
| + else: |
| + _LOG.warning( |
| + '%s.SetCPUScalingGovernor(): Failed to read %s', self.port_path, path) |
| # This works on Nexus 10 but not on Nexus 5. Need to investigate more. In |
| # the meantime, simply try one after the other. |
| if not self.PushContent(governor + '\n', path): |
| + _LOG.info( |
| + '%s.SetCPUScalingGovernor(): Failed to push %s in %s', |
| + self.port_path, governor, path) |
| # Fallback via shell. |
| _, exit_code = self.Shell('echo "%s" > %s' % (governor, path)) |
| if exit_code != 0: |
| @@ -608,11 +614,21 @@ class HighDevice(object): |
| dest = posixpath.join(destdir, os.path.basename(apk)) |
| if not self.Push(apk, dest): |
| return False |
| - return self.Shell('pm install -r %s' % pipes.quote(dest))[1] is 0 |
| + cmd = 'pm install -r %s' % pipes.quote(dest) |
| + out, exit_code = self.Shell(cmd) |
| + if not exit_code: |
| + return True |
| + _LOG.info('%s: %s', cmd, out) |
|
ghost stip (do not use)
2015/11/03 18:50:47
might be cool to abstract this into a helper funct
M-A Ruel
2015/11/04 18:39:10
Yes thinking about that but will leave out for now
|
| + return False |
| def UninstallAPK(self, package): |
| """Uninstalls the package.""" |
| - return self.Shell('pm uninstall %s' % pipes.quote(package))[1] is 0 |
| + cmd = 'pm uninstall %s' % pipes.quote(package) |
| + out, exit_code = self.Shell(cmd) |
| + if not exit_code: |
| + return True |
| + _LOG.info('%s: %s', cmd, out) |
| + return False |
| def GetApplicationPath(self, package): |
| # TODO(maruel): Test. |
| @@ -631,10 +647,11 @@ class HighDevice(object): |
| start = time.time() |
| while True: |
| if (time.time() - start) > timeout: |
| - return False |
| + break |
| if self.Stat(self.cache.external_storage_path)[0] != None: |
| return True |
| time.sleep(0.1) |
| + _LOG.warning('%s.WaitForDevice() failed', self.port_path) |
| return False |
| def WaitUntilFullyBooted(self, timeout=300): |
| @@ -653,6 +670,9 @@ class HighDevice(object): |
| # where most time is spent. |
| while True: |
| if (time.time() - start) > timeout: |
| + _LOG.warning( |
| + '%s.WaitUntilFullyBooted() didn\'t get sys.boot_completed in time', |
| + self.port_path) |
| return False |
| if self.GetProp('sys.boot_completed') == '1': |
| break |
| @@ -661,6 +681,9 @@ class HighDevice(object): |
| # Wait for one network to be up and running. |
| while not self.GetIPs(): |
| if (time.time() - start) > timeout: |
| + _LOG.warning( |
| + '%s.WaitUntilFullyBooted() didn\'t get an IP in time', |
| + self.port_path) |
| return False |
| time.sleep(0.1) |
| return True |