Bug 1084473 - Avoid intermittent DMError in getTopActivity on some Android 4.4 devices; r=jmaher

This commit is contained in:
Geoff Brown 2014-10-24 09:37:32 -06:00
parent 429f5cd892
commit 6aed4508f7

View File

@ -173,7 +173,11 @@ class DroidADB(DeviceManagerADB, DroidMixin):
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):