android-env 1.2.1__py3-none-any.whl → 1.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- android_env/__init__.py +1 -1
- android_env/components/__init__.py +1 -1
- android_env/components/a11y/__init__.py +15 -0
- android_env/components/a11y/a11y_events.py +118 -0
- android_env/components/a11y/a11y_events_test.py +173 -0
- android_env/components/a11y/a11y_forests.py +128 -0
- android_env/components/a11y/a11y_forests_test.py +237 -0
- android_env/components/a11y/a11y_servicer.py +199 -0
- android_env/components/a11y/a11y_servicer_test.py +224 -0
- android_env/components/action_fns.py +132 -0
- android_env/components/action_fns_test.py +227 -0
- android_env/components/action_type.py +26 -3
- android_env/components/adb_call_parser.py +239 -196
- android_env/components/adb_call_parser_test.py +179 -209
- android_env/components/adb_controller.py +90 -52
- android_env/components/adb_controller_test.py +187 -16
- android_env/components/adb_log_stream.py +17 -5
- android_env/components/adb_log_stream_test.py +17 -3
- android_env/components/app_screen_checker.py +17 -15
- android_env/components/app_screen_checker_test.py +7 -8
- android_env/components/config_classes.py +203 -0
- android_env/components/coordinator.py +102 -338
- android_env/components/coordinator_test.py +59 -199
- android_env/components/device_settings.py +174 -0
- android_env/components/device_settings_test.py +228 -0
- android_env/components/dumpsys_thread.py +3 -4
- android_env/components/dumpsys_thread_test.py +1 -1
- android_env/components/errors.py +52 -10
- android_env/components/errors_test.py +110 -0
- android_env/components/log_stream.py +7 -5
- android_env/components/log_stream_test.py +1 -1
- android_env/components/logcat_thread.py +9 -8
- android_env/components/logcat_thread_test.py +3 -4
- android_env/components/{utils.py → pixel_fns.py} +20 -20
- android_env/components/{utils_test.py → pixel_fns_test.py} +20 -15
- android_env/components/setup_step_interpreter.py +47 -39
- android_env/components/setup_step_interpreter_test.py +4 -4
- android_env/components/simulators/__init__.py +1 -1
- android_env/components/simulators/base_simulator.py +116 -44
- android_env/components/simulators/base_simulator_test.py +131 -9
- android_env/components/simulators/emulator/__init__.py +1 -1
- android_env/components/simulators/emulator/emulator_launcher.py +67 -77
- android_env/components/simulators/emulator/emulator_launcher_test.py +153 -49
- android_env/components/simulators/emulator/emulator_simulator.py +276 -95
- android_env/components/simulators/emulator/emulator_simulator_test.py +314 -89
- android_env/components/simulators/fake/__init__.py +1 -1
- android_env/components/simulators/fake/fake_simulator.py +17 -25
- android_env/components/simulators/fake/fake_simulator_test.py +29 -12
- android_env/components/specs.py +18 -28
- android_env/components/specs_test.py +1 -44
- android_env/components/task_manager.py +48 -48
- android_env/components/task_manager_test.py +71 -60
- android_env/env_interface.py +37 -23
- android_env/environment.py +83 -51
- android_env/environment_test.py +68 -29
- android_env/loader.py +57 -43
- android_env/loader_test.py +115 -35
- android_env/proto/__init__.py +1 -1
- android_env/proto/a11y/__init__.py +15 -0
- android_env/proto/a11y/a11y.proto +75 -0
- android_env/proto/a11y/a11y_pb2.py +54 -0
- android_env/proto/a11y/a11y_pb2.pyi +49 -0
- android_env/proto/a11y/a11y_pb2_grpc.py +202 -0
- android_env/proto/a11y/android_accessibility_action.proto +32 -0
- android_env/proto/a11y/android_accessibility_action_pb2.py +37 -0
- android_env/proto/a11y/android_accessibility_action_pb2.pyi +13 -0
- android_env/proto/a11y/android_accessibility_action_pb2_grpc.py +24 -0
- android_env/proto/a11y/android_accessibility_forest.proto +29 -0
- android_env/proto/a11y/android_accessibility_forest_pb2.py +38 -0
- android_env/proto/a11y/android_accessibility_forest_pb2.pyi +13 -0
- android_env/proto/a11y/android_accessibility_forest_pb2_grpc.py +24 -0
- android_env/proto/a11y/android_accessibility_node_info.proto +122 -0
- android_env/proto/a11y/android_accessibility_node_info_clickable_span.proto +49 -0
- android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2.py +39 -0
- android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2.pyi +28 -0
- android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2_grpc.py +24 -0
- android_env/proto/a11y/android_accessibility_node_info_pb2.py +42 -0
- android_env/proto/a11y/android_accessibility_node_info_pb2.pyi +75 -0
- android_env/proto/a11y/android_accessibility_node_info_pb2_grpc.py +24 -0
- android_env/proto/a11y/android_accessibility_tree.proto +29 -0
- android_env/proto/a11y/android_accessibility_tree_pb2.py +38 -0
- android_env/proto/a11y/android_accessibility_tree_pb2.pyi +13 -0
- android_env/proto/a11y/android_accessibility_tree_pb2_grpc.py +24 -0
- android_env/proto/a11y/android_accessibility_window_info.proto +84 -0
- android_env/proto/a11y/android_accessibility_window_info_pb2.py +41 -0
- android_env/proto/a11y/android_accessibility_window_info_pb2.pyi +48 -0
- android_env/proto/a11y/android_accessibility_window_info_pb2_grpc.py +24 -0
- android_env/proto/a11y/rect.proto +30 -0
- android_env/proto/a11y/rect_pb2.py +37 -0
- android_env/proto/a11y/rect_pb2.pyi +17 -0
- android_env/proto/a11y/rect_pb2_grpc.py +24 -0
- android_env/proto/adb.proto +17 -6
- android_env/proto/adb_pb2.py +120 -107
- android_env/proto/adb_pb2.pyi +396 -0
- android_env/proto/adb_pb2_grpc.py +20 -0
- android_env/proto/emulator_controller.proto +68 -63
- android_env/proto/emulator_controller_pb2.py +142 -131
- android_env/proto/emulator_controller_pb2.pyi +672 -0
- android_env/proto/emulator_controller_pb2_grpc.py +505 -142
- android_env/proto/snapshot.proto +169 -0
- android_env/proto/snapshot_pb2.py +47 -0
- android_env/proto/snapshot_pb2.pyi +117 -0
- android_env/proto/snapshot_pb2_grpc.py +24 -0
- android_env/proto/snapshot_service.proto +289 -0
- android_env/proto/snapshot_service_pb2.py +54 -0
- android_env/proto/snapshot_service_pb2.pyi +86 -0
- android_env/proto/snapshot_service_pb2_grpc.py +487 -0
- android_env/proto/state.proto +63 -0
- android_env/proto/state_pb2.py +63 -0
- android_env/proto/state_pb2.pyi +85 -0
- android_env/proto/state_pb2_grpc.py +24 -0
- android_env/proto/task.proto +5 -1
- android_env/proto/task_pb2.py +42 -31
- android_env/proto/task_pb2.pyi +160 -0
- android_env/proto/task_pb2_grpc.py +20 -0
- android_env/wrappers/__init__.py +1 -1
- android_env/wrappers/a11y_grpc_wrapper.py +500 -0
- android_env/wrappers/a11y_grpc_wrapper_test.py +849 -0
- android_env/wrappers/base_wrapper.py +34 -13
- android_env/wrappers/base_wrapper_test.py +22 -16
- android_env/wrappers/discrete_action_wrapper.py +18 -17
- android_env/wrappers/discrete_action_wrapper_test.py +4 -4
- android_env/wrappers/flat_interface_wrapper.py +5 -5
- android_env/wrappers/flat_interface_wrapper_test.py +7 -11
- android_env/wrappers/float_pixels_wrapper.py +9 -10
- android_env/wrappers/float_pixels_wrapper_test.py +3 -3
- android_env/wrappers/gym_wrapper.py +19 -13
- android_env/wrappers/gym_wrapper_test.py +3 -5
- android_env/wrappers/image_rescale_wrapper.py +18 -21
- android_env/wrappers/image_rescale_wrapper_test.py +25 -37
- android_env/wrappers/last_action_wrapper.py +16 -13
- android_env/wrappers/last_action_wrapper_test.py +44 -51
- android_env/wrappers/rate_limit_wrapper.py +6 -3
- android_env/wrappers/rate_limit_wrapper_test.py +22 -1
- android_env/wrappers/tap_action_wrapper.py +16 -17
- android_env/wrappers/tap_action_wrapper_test.py +51 -16
- {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/METADATA +14 -18
- android_env-1.2.3.dist-info/RECORD +141 -0
- {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/WHEEL +1 -1
- android_env/proto/raw_observation.proto +0 -39
- android_env/proto/raw_observation_pb2.py +0 -27
- android_env/proto/raw_observation_pb2_grpc.py +0 -4
- android_env-1.2.1.dist-info/RECORD +0 -81
- {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info/licenses}/LICENSE +0 -0
- {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,49 @@
|
|
1
|
+
from android_env.proto.a11y import android_accessibility_forest_pb2 as _android_accessibility_forest_pb2
|
2
|
+
from google.protobuf.internal import containers as _containers
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
4
|
+
from google.protobuf import message as _message
|
5
|
+
from typing import ClassVar as _ClassVar, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
6
|
+
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
8
|
+
|
9
|
+
class ForestResponse(_message.Message):
|
10
|
+
__slots__ = ("error",)
|
11
|
+
ERROR_FIELD_NUMBER: _ClassVar[int]
|
12
|
+
error: str
|
13
|
+
def __init__(self, error: _Optional[str] = ...) -> None: ...
|
14
|
+
|
15
|
+
class EventRequest(_message.Message):
|
16
|
+
__slots__ = ("event",)
|
17
|
+
class EventEntry(_message.Message):
|
18
|
+
__slots__ = ("key", "value")
|
19
|
+
KEY_FIELD_NUMBER: _ClassVar[int]
|
20
|
+
VALUE_FIELD_NUMBER: _ClassVar[int]
|
21
|
+
key: str
|
22
|
+
value: str
|
23
|
+
def __init__(self, key: _Optional[str] = ..., value: _Optional[str] = ...) -> None: ...
|
24
|
+
EVENT_FIELD_NUMBER: _ClassVar[int]
|
25
|
+
event: _containers.ScalarMap[str, str]
|
26
|
+
def __init__(self, event: _Optional[_Mapping[str, str]] = ...) -> None: ...
|
27
|
+
|
28
|
+
class EventResponse(_message.Message):
|
29
|
+
__slots__ = ("error",)
|
30
|
+
ERROR_FIELD_NUMBER: _ClassVar[int]
|
31
|
+
error: str
|
32
|
+
def __init__(self, error: _Optional[str] = ...) -> None: ...
|
33
|
+
|
34
|
+
class ClientToServer(_message.Message):
|
35
|
+
__slots__ = ("event", "forest")
|
36
|
+
EVENT_FIELD_NUMBER: _ClassVar[int]
|
37
|
+
FOREST_FIELD_NUMBER: _ClassVar[int]
|
38
|
+
event: EventRequest
|
39
|
+
forest: _android_accessibility_forest_pb2.AndroidAccessibilityForest
|
40
|
+
def __init__(self, event: _Optional[_Union[EventRequest, _Mapping]] = ..., forest: _Optional[_Union[_android_accessibility_forest_pb2.AndroidAccessibilityForest, _Mapping]] = ...) -> None: ...
|
41
|
+
|
42
|
+
class ServerToClient(_message.Message):
|
43
|
+
__slots__ = ("get_forest",)
|
44
|
+
class GetA11yForest(_message.Message):
|
45
|
+
__slots__ = ()
|
46
|
+
def __init__(self) -> None: ...
|
47
|
+
GET_FOREST_FIELD_NUMBER: _ClassVar[int]
|
48
|
+
get_forest: ServerToClient.GetA11yForest
|
49
|
+
def __init__(self, get_forest: _Optional[_Union[ServerToClient.GetA11yForest, _Mapping]] = ...) -> None: ...
|
@@ -0,0 +1,202 @@
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
3
|
+
import grpc
|
4
|
+
import warnings
|
5
|
+
|
6
|
+
from android_env.proto.a11y import a11y_pb2 as android__env_dot_proto_dot_a11y_dot_a11y__pb2
|
7
|
+
from android_env.proto.a11y import android_accessibility_forest_pb2 as android__env_dot_proto_dot_a11y_dot_android__accessibility__forest__pb2
|
8
|
+
|
9
|
+
GRPC_GENERATED_VERSION = '1.71.0'
|
10
|
+
GRPC_VERSION = grpc.__version__
|
11
|
+
_version_not_supported = False
|
12
|
+
|
13
|
+
try:
|
14
|
+
from grpc._utilities import first_version_is_lower
|
15
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
16
|
+
except ImportError:
|
17
|
+
_version_not_supported = True
|
18
|
+
|
19
|
+
if _version_not_supported:
|
20
|
+
raise RuntimeError(
|
21
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
22
|
+
+ f' but the generated code in android_env/proto/a11y/a11y_pb2_grpc.py depends on'
|
23
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
24
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
25
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
26
|
+
)
|
27
|
+
|
28
|
+
|
29
|
+
class A11yServiceStub(object):
|
30
|
+
"""A service to send Accessibility information to a remote server.
|
31
|
+
|
32
|
+
The client is assumed to be running inside an Android device (e.g. emulator
|
33
|
+
or real device) while the server is assumed to be running outside (e.g. in a
|
34
|
+
Python process).
|
35
|
+
"""
|
36
|
+
|
37
|
+
def __init__(self, channel):
|
38
|
+
"""Constructor.
|
39
|
+
|
40
|
+
Args:
|
41
|
+
channel: A grpc.Channel.
|
42
|
+
"""
|
43
|
+
self.SendForest = channel.unary_unary(
|
44
|
+
'/android_env.A11yService/SendForest',
|
45
|
+
request_serializer=android__env_dot_proto_dot_a11y_dot_android__accessibility__forest__pb2.AndroidAccessibilityForest.SerializeToString,
|
46
|
+
response_deserializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ForestResponse.FromString,
|
47
|
+
_registered_method=True)
|
48
|
+
self.SendEvent = channel.unary_unary(
|
49
|
+
'/android_env.A11yService/SendEvent',
|
50
|
+
request_serializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventRequest.SerializeToString,
|
51
|
+
response_deserializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventResponse.FromString,
|
52
|
+
_registered_method=True)
|
53
|
+
self.Bidi = channel.stream_stream(
|
54
|
+
'/android_env.A11yService/Bidi',
|
55
|
+
request_serializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ClientToServer.SerializeToString,
|
56
|
+
response_deserializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ServerToClient.FromString,
|
57
|
+
_registered_method=True)
|
58
|
+
|
59
|
+
|
60
|
+
class A11yServiceServicer(object):
|
61
|
+
"""A service to send Accessibility information to a remote server.
|
62
|
+
|
63
|
+
The client is assumed to be running inside an Android device (e.g. emulator
|
64
|
+
or real device) while the server is assumed to be running outside (e.g. in a
|
65
|
+
Python process).
|
66
|
+
"""
|
67
|
+
|
68
|
+
def SendForest(self, request, context):
|
69
|
+
"""Sends a forest of Accessibility trees to a server.
|
70
|
+
"""
|
71
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
72
|
+
context.set_details('Method not implemented!')
|
73
|
+
raise NotImplementedError('Method not implemented!')
|
74
|
+
|
75
|
+
def SendEvent(self, request, context):
|
76
|
+
"""Sends an a11y event to a server.
|
77
|
+
"""
|
78
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
79
|
+
context.set_details('Method not implemented!')
|
80
|
+
raise NotImplementedError('Method not implemented!')
|
81
|
+
|
82
|
+
def Bidi(self, request_iterator, context):
|
83
|
+
"""Long-lived bidirection communication between the client and the server.
|
84
|
+
"""
|
85
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
86
|
+
context.set_details('Method not implemented!')
|
87
|
+
raise NotImplementedError('Method not implemented!')
|
88
|
+
|
89
|
+
|
90
|
+
def add_A11yServiceServicer_to_server(servicer, server):
|
91
|
+
rpc_method_handlers = {
|
92
|
+
'SendForest': grpc.unary_unary_rpc_method_handler(
|
93
|
+
servicer.SendForest,
|
94
|
+
request_deserializer=android__env_dot_proto_dot_a11y_dot_android__accessibility__forest__pb2.AndroidAccessibilityForest.FromString,
|
95
|
+
response_serializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ForestResponse.SerializeToString,
|
96
|
+
),
|
97
|
+
'SendEvent': grpc.unary_unary_rpc_method_handler(
|
98
|
+
servicer.SendEvent,
|
99
|
+
request_deserializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventRequest.FromString,
|
100
|
+
response_serializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventResponse.SerializeToString,
|
101
|
+
),
|
102
|
+
'Bidi': grpc.stream_stream_rpc_method_handler(
|
103
|
+
servicer.Bidi,
|
104
|
+
request_deserializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ClientToServer.FromString,
|
105
|
+
response_serializer=android__env_dot_proto_dot_a11y_dot_a11y__pb2.ServerToClient.SerializeToString,
|
106
|
+
),
|
107
|
+
}
|
108
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
109
|
+
'android_env.A11yService', rpc_method_handlers)
|
110
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
111
|
+
server.add_registered_method_handlers('android_env.A11yService', rpc_method_handlers)
|
112
|
+
|
113
|
+
|
114
|
+
# This class is part of an EXPERIMENTAL API.
|
115
|
+
class A11yService(object):
|
116
|
+
"""A service to send Accessibility information to a remote server.
|
117
|
+
|
118
|
+
The client is assumed to be running inside an Android device (e.g. emulator
|
119
|
+
or real device) while the server is assumed to be running outside (e.g. in a
|
120
|
+
Python process).
|
121
|
+
"""
|
122
|
+
|
123
|
+
@staticmethod
|
124
|
+
def SendForest(request,
|
125
|
+
target,
|
126
|
+
options=(),
|
127
|
+
channel_credentials=None,
|
128
|
+
call_credentials=None,
|
129
|
+
insecure=False,
|
130
|
+
compression=None,
|
131
|
+
wait_for_ready=None,
|
132
|
+
timeout=None,
|
133
|
+
metadata=None):
|
134
|
+
return grpc.experimental.unary_unary(
|
135
|
+
request,
|
136
|
+
target,
|
137
|
+
'/android_env.A11yService/SendForest',
|
138
|
+
android__env_dot_proto_dot_a11y_dot_android__accessibility__forest__pb2.AndroidAccessibilityForest.SerializeToString,
|
139
|
+
android__env_dot_proto_dot_a11y_dot_a11y__pb2.ForestResponse.FromString,
|
140
|
+
options,
|
141
|
+
channel_credentials,
|
142
|
+
insecure,
|
143
|
+
call_credentials,
|
144
|
+
compression,
|
145
|
+
wait_for_ready,
|
146
|
+
timeout,
|
147
|
+
metadata,
|
148
|
+
_registered_method=True)
|
149
|
+
|
150
|
+
@staticmethod
|
151
|
+
def SendEvent(request,
|
152
|
+
target,
|
153
|
+
options=(),
|
154
|
+
channel_credentials=None,
|
155
|
+
call_credentials=None,
|
156
|
+
insecure=False,
|
157
|
+
compression=None,
|
158
|
+
wait_for_ready=None,
|
159
|
+
timeout=None,
|
160
|
+
metadata=None):
|
161
|
+
return grpc.experimental.unary_unary(
|
162
|
+
request,
|
163
|
+
target,
|
164
|
+
'/android_env.A11yService/SendEvent',
|
165
|
+
android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventRequest.SerializeToString,
|
166
|
+
android__env_dot_proto_dot_a11y_dot_a11y__pb2.EventResponse.FromString,
|
167
|
+
options,
|
168
|
+
channel_credentials,
|
169
|
+
insecure,
|
170
|
+
call_credentials,
|
171
|
+
compression,
|
172
|
+
wait_for_ready,
|
173
|
+
timeout,
|
174
|
+
metadata,
|
175
|
+
_registered_method=True)
|
176
|
+
|
177
|
+
@staticmethod
|
178
|
+
def Bidi(request_iterator,
|
179
|
+
target,
|
180
|
+
options=(),
|
181
|
+
channel_credentials=None,
|
182
|
+
call_credentials=None,
|
183
|
+
insecure=False,
|
184
|
+
compression=None,
|
185
|
+
wait_for_ready=None,
|
186
|
+
timeout=None,
|
187
|
+
metadata=None):
|
188
|
+
return grpc.experimental.stream_stream(
|
189
|
+
request_iterator,
|
190
|
+
target,
|
191
|
+
'/android_env.A11yService/Bidi',
|
192
|
+
android__env_dot_proto_dot_a11y_dot_a11y__pb2.ClientToServer.SerializeToString,
|
193
|
+
android__env_dot_proto_dot_a11y_dot_a11y__pb2.ServerToClient.FromString,
|
194
|
+
options,
|
195
|
+
channel_credentials,
|
196
|
+
insecure,
|
197
|
+
call_credentials,
|
198
|
+
compression,
|
199
|
+
wait_for_ready,
|
200
|
+
timeout,
|
201
|
+
metadata,
|
202
|
+
_registered_method=True)
|
@@ -0,0 +1,32 @@
|
|
1
|
+
// Copyright 2024 DeepMind Technologies Limited.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package android_env;
|
18
|
+
|
19
|
+
option java_multiple_files = true;
|
20
|
+
option java_package = "com.google.androidenv.accessibilityforwarder";
|
21
|
+
|
22
|
+
// An Android Accessibility Action.
|
23
|
+
// Next index: 3
|
24
|
+
message AndroidAccessibilityAction {
|
25
|
+
// Required ID that uniquely identifies the action for this node.
|
26
|
+
// Can be one of the standard action IDs listed in the documentation.
|
27
|
+
// https://developer.android.com/reference/android/view/accessibility/AccessibilityNodeInfo.AccessibilityAction
|
28
|
+
int32 id = 1;
|
29
|
+
|
30
|
+
// Optional label describing what the action is.
|
31
|
+
string label = 2;
|
32
|
+
}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
4
|
+
# source: android_env/proto/a11y/android_accessibility_action.proto
|
5
|
+
# Protobuf Python Version: 5.29.0
|
6
|
+
"""Generated protocol buffer code."""
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
11
|
+
from google.protobuf.internal import builder as _builder
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
14
|
+
5,
|
15
|
+
29,
|
16
|
+
0,
|
17
|
+
'',
|
18
|
+
'android_env/proto/a11y/android_accessibility_action.proto'
|
19
|
+
)
|
20
|
+
# @@protoc_insertion_point(imports)
|
21
|
+
|
22
|
+
_sym_db = _symbol_database.Default()
|
23
|
+
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n9android_env/proto/a11y/android_accessibility_action.proto\x12\x0b\x61ndroid_env\"7\n\x1a\x41ndroidAccessibilityAction\x12\n\n\x02id\x18\x01 \x01(\x05\x12\r\n\x05label\x18\x02 \x01(\tB0\n,com.google.androidenv.accessibilityforwarderP\x01\x62\x06proto3')
|
28
|
+
|
29
|
+
_globals = globals()
|
30
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
31
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'android_env.proto.a11y.android_accessibility_action_pb2', _globals)
|
32
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
33
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
34
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n,com.google.androidenv.accessibilityforwarderP\001'
|
35
|
+
_globals['_ANDROIDACCESSIBILITYACTION']._serialized_start=74
|
36
|
+
_globals['_ANDROIDACCESSIBILITYACTION']._serialized_end=129
|
37
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from google.protobuf import descriptor as _descriptor
|
2
|
+
from google.protobuf import message as _message
|
3
|
+
from typing import ClassVar as _ClassVar, Optional as _Optional
|
4
|
+
|
5
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
6
|
+
|
7
|
+
class AndroidAccessibilityAction(_message.Message):
|
8
|
+
__slots__ = ("id", "label")
|
9
|
+
ID_FIELD_NUMBER: _ClassVar[int]
|
10
|
+
LABEL_FIELD_NUMBER: _ClassVar[int]
|
11
|
+
id: int
|
12
|
+
label: str
|
13
|
+
def __init__(self, id: _Optional[int] = ..., label: _Optional[str] = ...) -> None: ...
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
3
|
+
import grpc
|
4
|
+
import warnings
|
5
|
+
|
6
|
+
|
7
|
+
GRPC_GENERATED_VERSION = '1.71.0'
|
8
|
+
GRPC_VERSION = grpc.__version__
|
9
|
+
_version_not_supported = False
|
10
|
+
|
11
|
+
try:
|
12
|
+
from grpc._utilities import first_version_is_lower
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
14
|
+
except ImportError:
|
15
|
+
_version_not_supported = True
|
16
|
+
|
17
|
+
if _version_not_supported:
|
18
|
+
raise RuntimeError(
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
20
|
+
+ f' but the generated code in android_env/proto/a11y/android_accessibility_action_pb2_grpc.py depends on'
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
24
|
+
)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
// Copyright 2024 DeepMind Technologies Limited.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package android_env;
|
18
|
+
|
19
|
+
import "android_env/proto/a11y/android_accessibility_window_info.proto";
|
20
|
+
|
21
|
+
option java_multiple_files = true;
|
22
|
+
option java_package = "com.google.androidenv.accessibilityforwarder";
|
23
|
+
|
24
|
+
// A forest of Android accessibility trees. Each tree belongs to a single
|
25
|
+
// window. Next index: 2
|
26
|
+
message AndroidAccessibilityForest {
|
27
|
+
// All of the windows present on screen.
|
28
|
+
repeated AndroidAccessibilityWindowInfo windows = 1;
|
29
|
+
}
|
@@ -0,0 +1,38 @@
|
|
1
|
+
# -*- coding: utf-8 -*-
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
3
|
+
# NO CHECKED-IN PROTOBUF GENCODE
|
4
|
+
# source: android_env/proto/a11y/android_accessibility_forest.proto
|
5
|
+
# Protobuf Python Version: 5.29.0
|
6
|
+
"""Generated protocol buffer code."""
|
7
|
+
from google.protobuf import descriptor as _descriptor
|
8
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
9
|
+
from google.protobuf import runtime_version as _runtime_version
|
10
|
+
from google.protobuf import symbol_database as _symbol_database
|
11
|
+
from google.protobuf.internal import builder as _builder
|
12
|
+
_runtime_version.ValidateProtobufRuntimeVersion(
|
13
|
+
_runtime_version.Domain.PUBLIC,
|
14
|
+
5,
|
15
|
+
29,
|
16
|
+
0,
|
17
|
+
'',
|
18
|
+
'android_env/proto/a11y/android_accessibility_forest.proto'
|
19
|
+
)
|
20
|
+
# @@protoc_insertion_point(imports)
|
21
|
+
|
22
|
+
_sym_db = _symbol_database.Default()
|
23
|
+
|
24
|
+
|
25
|
+
from android_env.proto.a11y import android_accessibility_window_info_pb2 as android__env_dot_proto_dot_a11y_dot_android__accessibility__window__info__pb2
|
26
|
+
|
27
|
+
|
28
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n9android_env/proto/a11y/android_accessibility_forest.proto\x12\x0b\x61ndroid_env\x1a>android_env/proto/a11y/android_accessibility_window_info.proto\"Z\n\x1a\x41ndroidAccessibilityForest\x12<\n\x07windows\x18\x01 \x03(\x0b\x32+.android_env.AndroidAccessibilityWindowInfoB0\n,com.google.androidenv.accessibilityforwarderP\x01\x62\x06proto3')
|
29
|
+
|
30
|
+
_globals = globals()
|
31
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
32
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'android_env.proto.a11y.android_accessibility_forest_pb2', _globals)
|
33
|
+
if not _descriptor._USE_C_DESCRIPTORS:
|
34
|
+
_globals['DESCRIPTOR']._loaded_options = None
|
35
|
+
_globals['DESCRIPTOR']._serialized_options = b'\n,com.google.androidenv.accessibilityforwarderP\001'
|
36
|
+
_globals['_ANDROIDACCESSIBILITYFOREST']._serialized_start=138
|
37
|
+
_globals['_ANDROIDACCESSIBILITYFOREST']._serialized_end=228
|
38
|
+
# @@protoc_insertion_point(module_scope)
|
@@ -0,0 +1,13 @@
|
|
1
|
+
from android_env.proto.a11y import android_accessibility_window_info_pb2 as _android_accessibility_window_info_pb2
|
2
|
+
from google.protobuf.internal import containers as _containers
|
3
|
+
from google.protobuf import descriptor as _descriptor
|
4
|
+
from google.protobuf import message as _message
|
5
|
+
from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
|
6
|
+
|
7
|
+
DESCRIPTOR: _descriptor.FileDescriptor
|
8
|
+
|
9
|
+
class AndroidAccessibilityForest(_message.Message):
|
10
|
+
__slots__ = ("windows",)
|
11
|
+
WINDOWS_FIELD_NUMBER: _ClassVar[int]
|
12
|
+
windows: _containers.RepeatedCompositeFieldContainer[_android_accessibility_window_info_pb2.AndroidAccessibilityWindowInfo]
|
13
|
+
def __init__(self, windows: _Optional[_Iterable[_Union[_android_accessibility_window_info_pb2.AndroidAccessibilityWindowInfo, _Mapping]]] = ...) -> None: ...
|
@@ -0,0 +1,24 @@
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
3
|
+
import grpc
|
4
|
+
import warnings
|
5
|
+
|
6
|
+
|
7
|
+
GRPC_GENERATED_VERSION = '1.71.0'
|
8
|
+
GRPC_VERSION = grpc.__version__
|
9
|
+
_version_not_supported = False
|
10
|
+
|
11
|
+
try:
|
12
|
+
from grpc._utilities import first_version_is_lower
|
13
|
+
_version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
|
14
|
+
except ImportError:
|
15
|
+
_version_not_supported = True
|
16
|
+
|
17
|
+
if _version_not_supported:
|
18
|
+
raise RuntimeError(
|
19
|
+
f'The grpc package installed is at version {GRPC_VERSION},'
|
20
|
+
+ f' but the generated code in android_env/proto/a11y/android_accessibility_forest_pb2_grpc.py depends on'
|
21
|
+
+ f' grpcio>={GRPC_GENERATED_VERSION}.'
|
22
|
+
+ f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
|
23
|
+
+ f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
|
24
|
+
)
|
@@ -0,0 +1,122 @@
|
|
1
|
+
// Copyright 2024 DeepMind Technologies Limited.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package android_env;
|
18
|
+
|
19
|
+
import "android_env/proto/a11y/android_accessibility_action.proto";
|
20
|
+
import "android_env/proto/a11y/android_accessibility_node_info_clickable_span.proto";
|
21
|
+
import "android_env/proto/a11y/rect.proto";
|
22
|
+
|
23
|
+
option java_multiple_files = true;
|
24
|
+
option java_package = "com.google.androidenv.accessibilityforwarder";
|
25
|
+
|
26
|
+
// An Android AccessibilityNodeInfo.
|
27
|
+
// Next index: 32
|
28
|
+
message AndroidAccessibilityNodeInfo {
|
29
|
+
// Unique monotonically-increasing ID.
|
30
|
+
int32 unique_id = 1;
|
31
|
+
|
32
|
+
// The bounds of this node within the device's screen.
|
33
|
+
ProtoRect bounds_in_screen = 2;
|
34
|
+
|
35
|
+
// The name of the View class that created this node.
|
36
|
+
string class_name = 3;
|
37
|
+
|
38
|
+
// The content description of the node.
|
39
|
+
string content_description = 4;
|
40
|
+
|
41
|
+
// The hint text of the node.
|
42
|
+
string hint_text = 5;
|
43
|
+
|
44
|
+
// The name of the package this node comes from.
|
45
|
+
string package_name = 6;
|
46
|
+
|
47
|
+
// The text of this node.
|
48
|
+
string text = 7;
|
49
|
+
|
50
|
+
// The start index of the text selection.
|
51
|
+
int64 text_selection_start = 8;
|
52
|
+
|
53
|
+
// The end index of the text selection.
|
54
|
+
int64 text_selection_end = 9;
|
55
|
+
|
56
|
+
// The view ID resource name of the node.
|
57
|
+
string view_id_resource_name = 10;
|
58
|
+
|
59
|
+
// The ID of the window this node belongs to.
|
60
|
+
int32 window_id = 11;
|
61
|
+
|
62
|
+
// If true, this node can be checked.
|
63
|
+
bool is_checkable = 12;
|
64
|
+
|
65
|
+
// If true, this node is currently checked.
|
66
|
+
bool is_checked = 13;
|
67
|
+
|
68
|
+
// If true, this node (probably) responds to being clicked.
|
69
|
+
bool is_clickable = 14;
|
70
|
+
|
71
|
+
// If true, this node's text can be edited by the user.
|
72
|
+
bool is_editable = 15;
|
73
|
+
|
74
|
+
// If true, this node is enabled (e.g., if it is a button).
|
75
|
+
bool is_enabled = 16;
|
76
|
+
|
77
|
+
// If true, this node can be focused (e.g., a text input).
|
78
|
+
bool is_focusable = 17;
|
79
|
+
|
80
|
+
// If true, this node is currently focused.
|
81
|
+
bool is_focused = 18;
|
82
|
+
|
83
|
+
// If true, this node (probably) responds to being long pressed.
|
84
|
+
bool is_long_clickable = 19;
|
85
|
+
|
86
|
+
// If true, this node is a password input.
|
87
|
+
bool is_password = 20;
|
88
|
+
|
89
|
+
// If true, this node can be scrolled.
|
90
|
+
bool is_scrollable = 21;
|
91
|
+
|
92
|
+
// If true, this node is currently selected.
|
93
|
+
bool is_selected = 22;
|
94
|
+
|
95
|
+
// If true, this node is (probably) visible to the user.
|
96
|
+
bool is_visible_to_user = 23;
|
97
|
+
|
98
|
+
// List of actions that can be performed on this node.
|
99
|
+
repeated AndroidAccessibilityAction actions = 24;
|
100
|
+
|
101
|
+
// Ordered list of child IDs (i.e., unique_id).
|
102
|
+
repeated int32 child_ids = 25 [packed = true];
|
103
|
+
|
104
|
+
// List of clickable spans present in the node's text or content description.
|
105
|
+
repeated AndroidAccessibilityNodeInfoClickableSpan clickable_spans = 26;
|
106
|
+
|
107
|
+
// The depth of this node in the accessibility tree.
|
108
|
+
int32 depth = 27;
|
109
|
+
|
110
|
+
// Unique ID of the node that this node is declaring itself to be labeled by.
|
111
|
+
int32 labeled_by_id = 28;
|
112
|
+
|
113
|
+
// Unique ID of the node that this is node is declaring itself to be a label
|
114
|
+
// for.
|
115
|
+
int32 label_for_id = 29;
|
116
|
+
|
117
|
+
// The drawing order for the node.
|
118
|
+
int32 drawing_order = 30;
|
119
|
+
|
120
|
+
// The tooltip text of the node.
|
121
|
+
string tooltip_text = 31;
|
122
|
+
}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
// Copyright 2024 DeepMind Technologies Limited.
|
2
|
+
//
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
4
|
+
// you may not use this file except in compliance with the License.
|
5
|
+
// You may obtain a copy of the License at
|
6
|
+
//
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
8
|
+
//
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
12
|
+
// See the License for the specific language governing permissions and
|
13
|
+
// limitations under the License.
|
14
|
+
|
15
|
+
syntax = "proto3";
|
16
|
+
|
17
|
+
package android_env;
|
18
|
+
|
19
|
+
option java_multiple_files = true;
|
20
|
+
option java_package = "com.google.androidenv.accessibilityforwarder";
|
21
|
+
|
22
|
+
// A single clickable span found in the accessibility node's text.
|
23
|
+
// Next index: 6
|
24
|
+
message AndroidAccessibilityNodeInfoClickableSpan {
|
25
|
+
// The source of the span (so the client can find the correct spannable string
|
26
|
+
// in the node).
|
27
|
+
// Next index: 3
|
28
|
+
enum SpanSource {
|
29
|
+
UNKNOWN_TYPE = 0; // Catch all type for forward compatibility.
|
30
|
+
TEXT = 1; // The span is from node#getText
|
31
|
+
CONTENT_DESCRIPTION = 2; // The span is from node#getContentDescription.
|
32
|
+
}
|
33
|
+
|
34
|
+
// The text of the span (a substring of the spannable string).
|
35
|
+
string text = 1;
|
36
|
+
|
37
|
+
// The URL attached to the span if specified.
|
38
|
+
string url = 2;
|
39
|
+
|
40
|
+
// The source of the span.
|
41
|
+
SpanSource source = 3;
|
42
|
+
|
43
|
+
// The index of the first character of the span in the spannable string.
|
44
|
+
// The end of the span would be a sum of span_start and text.length().
|
45
|
+
int32 start = 4;
|
46
|
+
|
47
|
+
// The unique_id from the corresponding AndroidAccessibilityNodeInfo.
|
48
|
+
int32 node_id = 5;
|
49
|
+
}
|