Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Update window regex for latest dumpsys format #17

Merged
merged 2 commits into from

2 participants

@mattismyname

dumpsys is including a new string (userid?) in the Window output. We
ignore it when it exists. This fixes an issue where the status bar is
not being identified and factored into coordinate computations.

Signed-off-by: Matt Gumbel matthew.k.gumbel@linux.intel.com

AndroidViewClient/src/com/dtmilano/android/viewclient.py
@@ -571,7 +571,7 @@ def __dumpWindowsInformation(self):
dww = self.device.shell('dumpsys window windows')
if DEBUG_WINDOWS: print >> sys.stderr, dww
lines = dww.split('\n')
- widRE = re.compile('^ *Window #%s Window{%s %s.*}:' %
+ widRE = re.compile('^ *Window #%s Window{%s (u\d+)? %s.*}:' %
@dtmilano Owner

I think the extra space should be inside the group, otherwise it will be expecting 2 spaces together: (u\d+ )?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
@dtmilano
Owner

Thanks for the patch. See my comment.

Matt Gumbel added some commits
Matt Gumbel Update window regex for latest dumpsys format
dumpsys is including a new string (userid?) in the Window output. We
ignore it when it exists. This fixes an issue where the status bar is
not being identified and factored into coordinate computations.

Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
7021695
Matt Gumbel Don't treat IP address in serial number as regex
When adb is connected to remote device on network, the serial number
can be of the form "192.168.42.1:5555". This should not be treated as
a regex, but rather as a literal serial number.

Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
8b31113
@mattismyname

Good catch, thank you. I've updated the patch.

@dtmilano dtmilano merged commit 96aa405 into dtmilano:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Dec 13, 2012
  1. Update window regex for latest dumpsys format

    Matt Gumbel authored
    dumpsys is including a new string (userid?) in the Window output. We
    ignore it when it exists. This fixes an issue where the status bar is
    not being identified and factored into coordinate computations.
    
    Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
  2. Don't treat IP address in serial number as regex

    Matt Gumbel authored
    When adb is connected to remote device on network, the serial number
    can be of the form "192.168.42.1:5555". This should not be treated as
    a regex, but rather as a literal serial number.
    
    Signed-off-by: Matt Gumbel <matthew.k.gumbel@linux.intel.com>
This page is out of date. Refresh to see the latest.
Showing with 2 additions and 2 deletions.
  1. +2 −2 AndroidViewClient/src/com/dtmilano/android/viewclient.py
View
4 AndroidViewClient/src/com/dtmilano/android/viewclient.py
@@ -571,7 +571,7 @@ def __dumpWindowsInformation(self):
dww = self.device.shell('dumpsys window windows')
if DEBUG_WINDOWS: print >> sys.stderr, dww
lines = dww.split('\n')
- widRE = re.compile('^ *Window #%s Window{%s %s.*}:' %
+ widRE = re.compile('^ *Window #%s Window{%s (u\d+ )?%s.*}:' %
(__nd('num'), __nh('winId'), __ns('activity', greedy=True)))
currentFocusRE = re.compile('^ mCurrentFocus=Window{%s .*' % __nh('winId'))
viewVisibilityRE = re.compile(' mViewVisibility=0x%s ' % __nh('visibility'))
@@ -1076,7 +1076,7 @@ def connectToDeviceOrExit(timeout=60, verbose=False, ignoresecuredevice=False, s
if secure == '1' and debuggable == '0' and not ignoresecuredevice and version < 16:
print >> sys.stderr, "%s: ERROR: Device is secure, AndroidViewClient won't work." % progname
sys.exit(2)
- if re.search("[.*()+]", serialno):
+ if re.search("[.*()+]", serialno) and not re.search("(\d{1,3}\.){3}\d{1,3}"):
# if a regex was used we have to determine the serialno used
serialno = ViewClient.__obtainDeviceSerialNumber(device)
return device, serialno
Something went wrong with that request. Please try again.