Bug 876456 - Allow for alternate dumpsys output in adb getTopActivity; r=jmaher
authorGeoff Brown <gbrown@mozilla.com>
Wed, 12 Jun 2013 13:27:55 -0600
changeset 146334 8374bf2b5e638db1873bb25921bff520ab37d4e7
parent 146333 6f56fc0b80e3fe6c894997bd8db9109b45b0228f
child 146335 e91df86d2a0ae48eef284b13658be49af7071e55
push id2697
push userbbajaj@mozilla.com
push dateMon, 05 Aug 2013 18:49:53 +0000
treeherdermozilla-beta@dfec938c7b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjmaher
bugs876456
milestone24.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 876456 - Allow for alternate dumpsys output in adb getTopActivity; r=jmaher
testing/mozbase/mozdevice/mozdevice/droid.py
--- a/testing/mozbase/mozdevice/mozdevice/droid.py
+++ b/testing/mozbase/mozdevice/mozdevice/droid.py
@@ -103,24 +103,30 @@ class DroidMixin(object):
 class DroidADB(DeviceManagerADB, DroidMixin):
 
     def getTopActivity(self):
         package = None
         data = self.shellCheckOutput(["dumpsys", "window", "input"])
         # "dumpsys window input" produces many lines of input. The top/foreground
         # activity is indicated by something like:
         #   mFocusedApp=AppWindowToken{483e6db0 token=HistoryRecord{484dcad8 com.mozilla.SUTAgentAndroid/.SUTAgentAndroid}}
+        # or, on other devices:
+        #   FocusedApplication: name='AppWindowToken{41a65340 token=ActivityRecord{418fbd68 org.mozilla.fennec_mozdev/.App}}', dispatchingTimeout=5000.000ms
         # Extract this line, ending in the forward slash:
         m = re.search('mFocusedApp(.+)/', data)
+        if not m:
+            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:
+            print "Warning: getTopActivity unable to find focused app"
         return package
 
 class DroidSUT(DeviceManagerSUT, DroidMixin):
 
     def _getExtraAmStartArgs(self):
         # in versions of android in jellybean and beyond, the agent may run as
         # a different process than the one that started the app. In this case,
         # we need to get back the original user serial number and then pass