code: def display(self):
          
          for line in self.adb_shell('dumpsys display').splitlines():
              m = _DISPLAY_RE.search(line, 0)
              if not m:
                  continue
              w = int(m.group('width'))
              h = int(m.group('height'))
              return collections.namedtuple('Display', ['width', 'height'])(w, h)
          else:
              w, h = self.info['displayWidth'], self.info['displayHeight']
              return collections.namedtuple('Display', ['width', 'height'])(w, h)
docs: Virtual keyborad may get small d.info['displayHeight']