Bug 1084473 - Avoid intermittent DMError in getTopActivity on some Android 4.4 devices; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Fri, 24 Oct 2014 09:37:32 -0600
changeset 212257 b7ecfedc0ef3f5aa115b2a6b95b21e96b7f7a5bf
parent 212256 d0ab048707562b3a34c218dd31436c616986ba47
child 212258 b7050902ed0311a331b3886f1ec3e6aa1a97f14f
push id27702
push userkwierso@gmail.com
push dateFri, 24 Oct 2014 22:05:50 +0000
treeherdermozilla-central@c70f62375f7d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs1084473
milestone36.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1084473 - Avoid intermittent DMError in getTopActivity on some Android 4.4 devices; r=jmaher
testing/mozbase/mozdevice/mozdevice/droid.py
--- a/testing/mozbase/mozdevice/mozdevice/droid.py
+++ b/testing/mozbase/mozdevice/mozdevice/droid.py
@@ -168,17 +168,21 @@ class DroidADB(DeviceManagerADB, DroidMi
             m = re.search('FocusedApplication(.+)/', data)
         if m:
             line = m.group(0)
             # Extract package name: string of non-whitespace ending in forward slash
             m = re.search('(\S+)/$', line)
             if m:
                 package = m.group(1)
         if not package:
-            raise DMError("unable to find focused app")
+            # On some Android 4.4 devices, when the home screen is displayed,
+            # dumpsys reports "mFocusedApp=null". Guard against this case and
+            # others where the focused app can not be determined by returning
+            # an empty string -- same as sutagent.
+            package = ""
         return package
 
     def getAppRoot(self, packageName):
         """
         Returns the root directory for the specified android application
         """
         # relying on convention
         return '/data/data/%s' % packageName