Skip to content

Commit

Permalink
Update: added flag to check if Android 32
Browse files Browse the repository at this point in the history
and disable minicap
  • Loading branch information
Niweera committed Jun 8, 2023
1 parent 4b08408 commit af0e386
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion droidbot/adapter/droidbot_ime.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ def disconnect(self):
"""
self.connected = False
r_disable = self.device.adb.shell("ime disable %s" % IME_SERVICE)
if r_disable.endswith("now disabled"):
if "now disabled" in r_disable:
self.connected = False
print("[CONNECTION] %s is disconnected" % self.__class__.__name__)
return
Expand Down
5 changes: 5 additions & 0 deletions droidbot/device.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,11 @@ def __init__(self, device_serial=None, is_emulator=False, output_dir=None,
self.logger.info("disable minicap on emulator")
self.adapters[self.minicap] = False

# minicap is not supporting android 32 and above
if self.get_sdk_version() >= 32:
self.logger.info("disable minicap on sdk >= 32")
self.adapters[self.minicap] = False

def check_connectivity(self):
"""
check if the device is available
Expand Down
2 changes: 2 additions & 0 deletions droidbot/device_state.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,8 @@ def __parse_views(self, raw_views):

def __assemble_view_tree(self, root_view, views):
if not len(self.view_tree): # bootstrap
if not len(views): # to fix if views is empty
return
self.view_tree = copy.deepcopy(views[0])
self.__assemble_view_tree(self.view_tree, views)
else:
Expand Down

0 comments on commit af0e386

Please sign in to comment.