Skip to content

Commit 130d535

Browse files
clink42The android_world Authors
authored andcommitted
Internal change
PiperOrigin-RevId: 770788464
1 parent 4f949d3 commit 130d535

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

android_world/env/android_world_controller.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ class A11yMethod(enum.Enum):
133133
# From `uiautomator dump``.
134134
UIAUTOMATOR = 'uiautomator'
135135

136+
# No A11y tree retrieval
137+
NONE = 'none'
138+
136139

137140
def apply_a11y_forwarder_app_wrapper(
138141
env: env_interface.AndroidEnvInterface, install_a11y_forwarding_app: bool
@@ -228,10 +231,12 @@ def get_ui_elements(self) -> list[representation_utils.UIElement]:
228231
self.get_a11y_forest(),
229232
exclude_invisible_elements=True,
230233
)
231-
else:
234+
elif self._a11y_method == A11yMethod.UIAUTOMATOR:
232235
return representation_utils.xml_dump_to_ui_elements(
233236
adb_utils.uiautomator_dump(self._env)
234237
)
238+
else:
239+
return []
235240

236241
def _process_timestep(self, timestep: dm_env.TimeStep) -> dm_env.TimeStep:
237242
"""Adds a11y tree info to the observation."""

0 commit comments

Comments
 (0)