Skip to content

Commit

Permalink
Merge pull request dtmilano#281 from rook828/top_activity_android10
Browse files Browse the repository at this point in the history
Generate startActivity() Android10 compatibility
  • Loading branch information
dtmilano authored Sep 18, 2020
2 parents e9dab09 + 4e7f732 commit 9e97819
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/com/dtmilano/android/adb/adbclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -1337,13 +1337,12 @@ def getFocusedWindowName(self):

def getTopActivityNameAndPid(self):
dat = self.shell('dumpsys activity top')
lines = dat.splitlines()
activityRE = re.compile('\s*ACTIVITY ([A-Za-z0-9_.]+)/([A-Za-z0-9_.\$]+) \w+ pid=(\d+)')
m = activityRE.search(lines[1])
if m:
return m.group(1), m.group(2), m.group(3)
m = activityRE.findall(dat)
if len(m) > 0:
return m[-1]
else:
warnings.warn("NO MATCH:" + lines[1])
warnings.warn("NO MATCH:" + dat)
return None

def getTopActivityName(self):
Expand Down

0 comments on commit 9e97819

Please sign in to comment.