From fc493ba09258fa6230d0903f63042e234d6f6080 Mon Sep 17 00:00:00 2001 From: Bob Clary Date: Wed, 15 Jul 2020 20:57:24 +0000 Subject: [PATCH] Bug 1486004 - Part 2 - Update remoteautomation.py to support unrooted android devices using mozdevice 4.0.0, r=gbrown Depends on D82744 Differential Revision: https://phabricator.services.mozilla.com/D82745 --- build/mobile/remoteautomation.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/build/mobile/remoteautomation.py b/build/mobile/remoteautomation.py index 36c0c14b051e..b9245f36b2a0 100644 --- a/build/mobile/remoteautomation.py +++ b/build/mobile/remoteautomation.py @@ -62,7 +62,7 @@ class RemoteAutomation(object): for |timeout| seconds. """ if self.device.is_file(self.remoteLog): - self.device.rm(self.remoteLog, root=True) + self.device.rm(self.remoteLog) self.log.info("remoteautomation.py | runApp deleted %s" % self.remoteLog) if timeout == -1: @@ -209,7 +209,7 @@ class RemoteAutomation(object): if self.appName and self.device.process_exist(self.appName): print("remoteautomation.py %s is already running. Stopping..." % self.appName) - self.device.stop_application(self.appName, root=True) + self.device.stop_application(self.appName) self.counts = counts if self.counts is not None: @@ -268,7 +268,7 @@ class RemoteAutomation(object): except ADBTimeoutError: raise except Exception as e: - self.log.info("remoteautomation.py | exception reading log: %s" % str(e)) + self.log.exception("remoteautomation.py | exception reading log: %s" % str(e)) return False if not newLogContent: return False @@ -354,12 +354,12 @@ class RemoteAutomation(object): endTime = datetime.datetime.now() + datetime.timedelta(seconds=timeout) # wait for log creation on startup retries = 0 - while retries < 20 and not self.device.is_file(self.remoteLog, root=True): + while retries < 20 and not self.device.is_file(self.remoteLog): retries += 1 time.sleep(1) - if self.device.is_file(self.remoteLog, root=True): + if self.device.is_file(self.remoteLog): # We must change the remote log's permissions so that the shell can read it. - self.device.chmod(self.remoteLog, mask="666", root=True) + self.device.chmod(self.remoteLog, mask="666") else: print("Failed wait for remote log: %s missing?" % self.remoteLog) while top == self.procName: @@ -408,7 +408,7 @@ class RemoteAutomation(object): if stagedShutdown: # Trigger an ANR report with "kill -3" (SIGQUIT) try: - self.device.pkill(self.procName, sig=3, attempts=1, root=True) + self.device.pkill(self.procName, sig=3, attempts=1) except ADBTimeoutError: raise except: # NOQA: E722 @@ -416,7 +416,7 @@ class RemoteAutomation(object): time.sleep(3) # Trigger a breakpad dump with "kill -6" (SIGABRT) try: - self.device.pkill(self.procName, sig=6, attempts=1, root=True) + self.device.pkill(self.procName, sig=6, attempts=1) except ADBTimeoutError: raise except: # NOQA: E722 @@ -432,7 +432,7 @@ class RemoteAutomation(object): retries += 1 if self.device.process_exist(self.procName): try: - self.device.pkill(self.procName, sig=9, attempts=1, root=True) + self.device.pkill(self.procName, sig=9, attempts=1) except ADBTimeoutError: raise except: # NOQA: E722 @@ -448,7 +448,7 @@ class RemoteAutomation(object): if self.device.process_exist(crashreporter): print("Warning: %s unexpectedly found running. Killing..." % crashreporter) try: - self.device.pkill(crashreporter, root=True) + self.device.pkill(crashreporter) except ADBTimeoutError: raise except: # NOQA: E722