mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-13 00:02:09 +00:00
feat: enhance device connection handling and droidcast resolution management
This commit is contained in:
@@ -242,7 +242,7 @@ class Uiautomator2(Connection):
|
||||
return hierarchy
|
||||
|
||||
@retry
|
||||
def resolution_uiautomator2(self) -> t.Tuple[int, int]:
|
||||
def resolution_uiautomator2(self, cal_rotation=True) -> t.Tuple[int, int]:
|
||||
"""
|
||||
Faster u2.window_size(), cause that calls `dumpsys display` twice.
|
||||
|
||||
@@ -251,9 +251,10 @@ class Uiautomator2(Connection):
|
||||
"""
|
||||
info = self.u2.http.get('/info').json()
|
||||
w, h = info['display']['width'], info['display']['height']
|
||||
rotation = self.get_orientation()
|
||||
if (w > h) != (rotation % 2 == 1):
|
||||
w, h = h, w
|
||||
if cal_rotation:
|
||||
rotation = self.get_orientation()
|
||||
if (w > h) != (rotation % 2 == 1):
|
||||
w, h = h, w
|
||||
return w, h
|
||||
|
||||
def resolution_check_uiautomator2(self):
|
||||
|
||||
Reference in New Issue
Block a user