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.
Files changed (145) hide show
  1. android_env/__init__.py +1 -1
  2. android_env/components/__init__.py +1 -1
  3. android_env/components/a11y/__init__.py +15 -0
  4. android_env/components/a11y/a11y_events.py +118 -0
  5. android_env/components/a11y/a11y_events_test.py +173 -0
  6. android_env/components/a11y/a11y_forests.py +128 -0
  7. android_env/components/a11y/a11y_forests_test.py +237 -0
  8. android_env/components/a11y/a11y_servicer.py +199 -0
  9. android_env/components/a11y/a11y_servicer_test.py +224 -0
  10. android_env/components/action_fns.py +132 -0
  11. android_env/components/action_fns_test.py +227 -0
  12. android_env/components/action_type.py +26 -3
  13. android_env/components/adb_call_parser.py +239 -196
  14. android_env/components/adb_call_parser_test.py +179 -209
  15. android_env/components/adb_controller.py +90 -52
  16. android_env/components/adb_controller_test.py +187 -16
  17. android_env/components/adb_log_stream.py +17 -5
  18. android_env/components/adb_log_stream_test.py +17 -3
  19. android_env/components/app_screen_checker.py +17 -15
  20. android_env/components/app_screen_checker_test.py +7 -8
  21. android_env/components/config_classes.py +203 -0
  22. android_env/components/coordinator.py +102 -338
  23. android_env/components/coordinator_test.py +59 -199
  24. android_env/components/device_settings.py +174 -0
  25. android_env/components/device_settings_test.py +228 -0
  26. android_env/components/dumpsys_thread.py +3 -4
  27. android_env/components/dumpsys_thread_test.py +1 -1
  28. android_env/components/errors.py +52 -10
  29. android_env/components/errors_test.py +110 -0
  30. android_env/components/log_stream.py +7 -5
  31. android_env/components/log_stream_test.py +1 -1
  32. android_env/components/logcat_thread.py +9 -8
  33. android_env/components/logcat_thread_test.py +3 -4
  34. android_env/components/{utils.py → pixel_fns.py} +20 -20
  35. android_env/components/{utils_test.py → pixel_fns_test.py} +20 -15
  36. android_env/components/setup_step_interpreter.py +47 -39
  37. android_env/components/setup_step_interpreter_test.py +4 -4
  38. android_env/components/simulators/__init__.py +1 -1
  39. android_env/components/simulators/base_simulator.py +116 -44
  40. android_env/components/simulators/base_simulator_test.py +131 -9
  41. android_env/components/simulators/emulator/__init__.py +1 -1
  42. android_env/components/simulators/emulator/emulator_launcher.py +67 -77
  43. android_env/components/simulators/emulator/emulator_launcher_test.py +153 -49
  44. android_env/components/simulators/emulator/emulator_simulator.py +276 -95
  45. android_env/components/simulators/emulator/emulator_simulator_test.py +314 -89
  46. android_env/components/simulators/fake/__init__.py +1 -1
  47. android_env/components/simulators/fake/fake_simulator.py +17 -25
  48. android_env/components/simulators/fake/fake_simulator_test.py +29 -12
  49. android_env/components/specs.py +18 -28
  50. android_env/components/specs_test.py +1 -44
  51. android_env/components/task_manager.py +48 -48
  52. android_env/components/task_manager_test.py +71 -60
  53. android_env/env_interface.py +37 -23
  54. android_env/environment.py +83 -51
  55. android_env/environment_test.py +68 -29
  56. android_env/loader.py +57 -43
  57. android_env/loader_test.py +115 -35
  58. android_env/proto/__init__.py +1 -1
  59. android_env/proto/a11y/__init__.py +15 -0
  60. android_env/proto/a11y/a11y.proto +75 -0
  61. android_env/proto/a11y/a11y_pb2.py +54 -0
  62. android_env/proto/a11y/a11y_pb2.pyi +49 -0
  63. android_env/proto/a11y/a11y_pb2_grpc.py +202 -0
  64. android_env/proto/a11y/android_accessibility_action.proto +32 -0
  65. android_env/proto/a11y/android_accessibility_action_pb2.py +37 -0
  66. android_env/proto/a11y/android_accessibility_action_pb2.pyi +13 -0
  67. android_env/proto/a11y/android_accessibility_action_pb2_grpc.py +24 -0
  68. android_env/proto/a11y/android_accessibility_forest.proto +29 -0
  69. android_env/proto/a11y/android_accessibility_forest_pb2.py +38 -0
  70. android_env/proto/a11y/android_accessibility_forest_pb2.pyi +13 -0
  71. android_env/proto/a11y/android_accessibility_forest_pb2_grpc.py +24 -0
  72. android_env/proto/a11y/android_accessibility_node_info.proto +122 -0
  73. android_env/proto/a11y/android_accessibility_node_info_clickable_span.proto +49 -0
  74. android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2.py +39 -0
  75. android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2.pyi +28 -0
  76. android_env/proto/a11y/android_accessibility_node_info_clickable_span_pb2_grpc.py +24 -0
  77. android_env/proto/a11y/android_accessibility_node_info_pb2.py +42 -0
  78. android_env/proto/a11y/android_accessibility_node_info_pb2.pyi +75 -0
  79. android_env/proto/a11y/android_accessibility_node_info_pb2_grpc.py +24 -0
  80. android_env/proto/a11y/android_accessibility_tree.proto +29 -0
  81. android_env/proto/a11y/android_accessibility_tree_pb2.py +38 -0
  82. android_env/proto/a11y/android_accessibility_tree_pb2.pyi +13 -0
  83. android_env/proto/a11y/android_accessibility_tree_pb2_grpc.py +24 -0
  84. android_env/proto/a11y/android_accessibility_window_info.proto +84 -0
  85. android_env/proto/a11y/android_accessibility_window_info_pb2.py +41 -0
  86. android_env/proto/a11y/android_accessibility_window_info_pb2.pyi +48 -0
  87. android_env/proto/a11y/android_accessibility_window_info_pb2_grpc.py +24 -0
  88. android_env/proto/a11y/rect.proto +30 -0
  89. android_env/proto/a11y/rect_pb2.py +37 -0
  90. android_env/proto/a11y/rect_pb2.pyi +17 -0
  91. android_env/proto/a11y/rect_pb2_grpc.py +24 -0
  92. android_env/proto/adb.proto +17 -6
  93. android_env/proto/adb_pb2.py +120 -107
  94. android_env/proto/adb_pb2.pyi +396 -0
  95. android_env/proto/adb_pb2_grpc.py +20 -0
  96. android_env/proto/emulator_controller.proto +68 -63
  97. android_env/proto/emulator_controller_pb2.py +142 -131
  98. android_env/proto/emulator_controller_pb2.pyi +672 -0
  99. android_env/proto/emulator_controller_pb2_grpc.py +505 -142
  100. android_env/proto/snapshot.proto +169 -0
  101. android_env/proto/snapshot_pb2.py +47 -0
  102. android_env/proto/snapshot_pb2.pyi +117 -0
  103. android_env/proto/snapshot_pb2_grpc.py +24 -0
  104. android_env/proto/snapshot_service.proto +289 -0
  105. android_env/proto/snapshot_service_pb2.py +54 -0
  106. android_env/proto/snapshot_service_pb2.pyi +86 -0
  107. android_env/proto/snapshot_service_pb2_grpc.py +487 -0
  108. android_env/proto/state.proto +63 -0
  109. android_env/proto/state_pb2.py +63 -0
  110. android_env/proto/state_pb2.pyi +85 -0
  111. android_env/proto/state_pb2_grpc.py +24 -0
  112. android_env/proto/task.proto +5 -1
  113. android_env/proto/task_pb2.py +42 -31
  114. android_env/proto/task_pb2.pyi +160 -0
  115. android_env/proto/task_pb2_grpc.py +20 -0
  116. android_env/wrappers/__init__.py +1 -1
  117. android_env/wrappers/a11y_grpc_wrapper.py +500 -0
  118. android_env/wrappers/a11y_grpc_wrapper_test.py +849 -0
  119. android_env/wrappers/base_wrapper.py +34 -13
  120. android_env/wrappers/base_wrapper_test.py +22 -16
  121. android_env/wrappers/discrete_action_wrapper.py +18 -17
  122. android_env/wrappers/discrete_action_wrapper_test.py +4 -4
  123. android_env/wrappers/flat_interface_wrapper.py +5 -5
  124. android_env/wrappers/flat_interface_wrapper_test.py +7 -11
  125. android_env/wrappers/float_pixels_wrapper.py +9 -10
  126. android_env/wrappers/float_pixels_wrapper_test.py +3 -3
  127. android_env/wrappers/gym_wrapper.py +19 -13
  128. android_env/wrappers/gym_wrapper_test.py +3 -5
  129. android_env/wrappers/image_rescale_wrapper.py +18 -21
  130. android_env/wrappers/image_rescale_wrapper_test.py +25 -37
  131. android_env/wrappers/last_action_wrapper.py +16 -13
  132. android_env/wrappers/last_action_wrapper_test.py +44 -51
  133. android_env/wrappers/rate_limit_wrapper.py +6 -3
  134. android_env/wrappers/rate_limit_wrapper_test.py +22 -1
  135. android_env/wrappers/tap_action_wrapper.py +16 -17
  136. android_env/wrappers/tap_action_wrapper_test.py +51 -16
  137. {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/METADATA +14 -18
  138. android_env-1.2.3.dist-info/RECORD +141 -0
  139. {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/WHEEL +1 -1
  140. android_env/proto/raw_observation.proto +0 -39
  141. android_env/proto/raw_observation_pb2.py +0 -27
  142. android_env/proto/raw_observation_pb2_grpc.py +0 -4
  143. android_env-1.2.1.dist-info/RECORD +0 -81
  144. {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info/licenses}/LICENSE +0 -0
  145. {android_env-1.2.1.dist-info → android_env-1.2.3.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,54 @@
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/snapshot_service.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/snapshot_service.proto'
19
+ )
20
+ # @@protoc_insertion_point(imports)
21
+
22
+ _sym_db = _symbol_database.Default()
23
+
24
+
25
+ from android_env.proto import snapshot_pb2 as android__env_dot_proto_dot_snapshot__pb2
26
+
27
+
28
+ DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n(android_env/proto/snapshot_service.proto\x12\x19\x61ndroid.emulation.control\x1a android_env/proto/snapshot.proto\"\xd3\x01\n\x0fSnapshotPackage\x12\x13\n\x0bsnapshot_id\x18\x01 \x01(\t\x12\x0f\n\x07payload\x18\x02 \x01(\x0c\x12\x0f\n\x07success\x18\x03 \x01(\x08\x12\x0b\n\x03\x65rr\x18\x04 \x01(\x0c\x12\x41\n\x06\x66ormat\x18\x05 \x01(\x0e\x32\x31.android.emulation.control.SnapshotPackage.Format\x12\x0c\n\x04path\x18\x06 \x01(\t\"+\n\x06\x46ormat\x12\t\n\x05TARGZ\x10\x00\x12\x07\n\x03TAR\x10\x01\x12\r\n\tDIRECTORY\x10\x02\"\x87\x01\n\x0eSnapshotFilter\x12J\n\x0cstatusFilter\x18\x01 \x01(\x0e\x32\x34.android.emulation.control.SnapshotFilter.LoadStatus\")\n\nLoadStatus\x12\x12\n\x0e\x43ompatibleOnly\x10\x00\x12\x07\n\x03\x41ll\x10\x01\"\xe5\x01\n\x0fSnapshotDetails\x12\x13\n\x0bsnapshot_id\x18\x01 \x01(\t\x12,\n\x07\x64\x65tails\x18\x02 \x01(\x0b\x32\x1b.emulator_snapshot.Snapshot\x12\x45\n\x06status\x18\x03 \x01(\x0e\x32\x35.android.emulation.control.SnapshotDetails.LoadStatus\x12\x0c\n\x04size\x18\x04 \x01(\x04\":\n\nLoadStatus\x12\x0e\n\nCompatible\x10\x00\x12\x10\n\x0cIncompatible\x10\x01\x12\n\n\x06Loaded\x10\x02\"M\n\x0cSnapshotList\x12=\n\tsnapshots\x18\x01 \x03(\x0b\x32*.android.emulation.control.SnapshotDetails\"\x80\x01\n\x0cIceboxTarget\x12\x0b\n\x03pid\x18\x01 \x01(\x03\x12\x14\n\x0cpackage_name\x18\x02 \x01(\t\x12\x13\n\x0bsnapshot_id\x18\x03 \x01(\t\x12\x0e\n\x06\x66\x61iled\x18\x04 \x01(\x08\x12\x0b\n\x03\x65rr\x18\x05 \x01(\t\x12\x1b\n\x13max_snapshot_number\x18\x06 \x01(\x05\x32\xf4\x05\n\x0fSnapshotService\x12\x65\n\rListSnapshots\x12).android.emulation.control.SnapshotFilter\x1a\'.android.emulation.control.SnapshotList\"\x00\x12j\n\x0cPullSnapshot\x12*.android.emulation.control.SnapshotPackage\x1a*.android.emulation.control.SnapshotPackage\"\x00\x30\x01\x12j\n\x0cPushSnapshot\x12*.android.emulation.control.SnapshotPackage\x1a*.android.emulation.control.SnapshotPackage\"\x00(\x01\x12h\n\x0cLoadSnapshot\x12*.android.emulation.control.SnapshotPackage\x1a*.android.emulation.control.SnapshotPackage\"\x00\x12h\n\x0cSaveSnapshot\x12*.android.emulation.control.SnapshotPackage\x1a*.android.emulation.control.SnapshotPackage\"\x00\x12j\n\x0e\x44\x65leteSnapshot\x12*.android.emulation.control.SnapshotPackage\x1a*.android.emulation.control.SnapshotPackage\"\x00\x12\x62\n\x0cTrackProcess\x12\'.android.emulation.control.IceboxTarget\x1a\'.android.emulation.control.IceboxTarget\"\x00\x42&\n\x1c\x63om.android.emulator.controlP\x01\xa2\x02\x03\x41\x45\x43\x62\x06proto3')
29
+
30
+ _globals = globals()
31
+ _builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
32
+ _builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'android_env.proto.snapshot_service_pb2', _globals)
33
+ if not _descriptor._USE_C_DESCRIPTORS:
34
+ _globals['DESCRIPTOR']._loaded_options = None
35
+ _globals['DESCRIPTOR']._serialized_options = b'\n\034com.android.emulator.controlP\001\242\002\003AEC'
36
+ _globals['_SNAPSHOTPACKAGE']._serialized_start=106
37
+ _globals['_SNAPSHOTPACKAGE']._serialized_end=317
38
+ _globals['_SNAPSHOTPACKAGE_FORMAT']._serialized_start=274
39
+ _globals['_SNAPSHOTPACKAGE_FORMAT']._serialized_end=317
40
+ _globals['_SNAPSHOTFILTER']._serialized_start=320
41
+ _globals['_SNAPSHOTFILTER']._serialized_end=455
42
+ _globals['_SNAPSHOTFILTER_LOADSTATUS']._serialized_start=414
43
+ _globals['_SNAPSHOTFILTER_LOADSTATUS']._serialized_end=455
44
+ _globals['_SNAPSHOTDETAILS']._serialized_start=458
45
+ _globals['_SNAPSHOTDETAILS']._serialized_end=687
46
+ _globals['_SNAPSHOTDETAILS_LOADSTATUS']._serialized_start=629
47
+ _globals['_SNAPSHOTDETAILS_LOADSTATUS']._serialized_end=687
48
+ _globals['_SNAPSHOTLIST']._serialized_start=689
49
+ _globals['_SNAPSHOTLIST']._serialized_end=766
50
+ _globals['_ICEBOXTARGET']._serialized_start=769
51
+ _globals['_ICEBOXTARGET']._serialized_end=897
52
+ _globals['_SNAPSHOTSERVICE']._serialized_start=900
53
+ _globals['_SNAPSHOTSERVICE']._serialized_end=1656
54
+ # @@protoc_insertion_point(module_scope)
@@ -0,0 +1,86 @@
1
+ from android_env.proto import snapshot_pb2 as _snapshot_pb2
2
+ from google.protobuf.internal import containers as _containers
3
+ from google.protobuf.internal import enum_type_wrapper as _enum_type_wrapper
4
+ from google.protobuf import descriptor as _descriptor
5
+ from google.protobuf import message as _message
6
+ from typing import ClassVar as _ClassVar, Iterable as _Iterable, Mapping as _Mapping, Optional as _Optional, Union as _Union
7
+
8
+ DESCRIPTOR: _descriptor.FileDescriptor
9
+
10
+ class SnapshotPackage(_message.Message):
11
+ __slots__ = ("snapshot_id", "payload", "success", "err", "format", "path")
12
+ class Format(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
13
+ __slots__ = ()
14
+ TARGZ: _ClassVar[SnapshotPackage.Format]
15
+ TAR: _ClassVar[SnapshotPackage.Format]
16
+ DIRECTORY: _ClassVar[SnapshotPackage.Format]
17
+ TARGZ: SnapshotPackage.Format
18
+ TAR: SnapshotPackage.Format
19
+ DIRECTORY: SnapshotPackage.Format
20
+ SNAPSHOT_ID_FIELD_NUMBER: _ClassVar[int]
21
+ PAYLOAD_FIELD_NUMBER: _ClassVar[int]
22
+ SUCCESS_FIELD_NUMBER: _ClassVar[int]
23
+ ERR_FIELD_NUMBER: _ClassVar[int]
24
+ FORMAT_FIELD_NUMBER: _ClassVar[int]
25
+ PATH_FIELD_NUMBER: _ClassVar[int]
26
+ snapshot_id: str
27
+ payload: bytes
28
+ success: bool
29
+ err: bytes
30
+ format: SnapshotPackage.Format
31
+ path: str
32
+ def __init__(self, snapshot_id: _Optional[str] = ..., payload: _Optional[bytes] = ..., success: bool = ..., err: _Optional[bytes] = ..., format: _Optional[_Union[SnapshotPackage.Format, str]] = ..., path: _Optional[str] = ...) -> None: ...
33
+
34
+ class SnapshotFilter(_message.Message):
35
+ __slots__ = ("statusFilter",)
36
+ class LoadStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
37
+ __slots__ = ()
38
+ CompatibleOnly: _ClassVar[SnapshotFilter.LoadStatus]
39
+ All: _ClassVar[SnapshotFilter.LoadStatus]
40
+ CompatibleOnly: SnapshotFilter.LoadStatus
41
+ All: SnapshotFilter.LoadStatus
42
+ STATUSFILTER_FIELD_NUMBER: _ClassVar[int]
43
+ statusFilter: SnapshotFilter.LoadStatus
44
+ def __init__(self, statusFilter: _Optional[_Union[SnapshotFilter.LoadStatus, str]] = ...) -> None: ...
45
+
46
+ class SnapshotDetails(_message.Message):
47
+ __slots__ = ("snapshot_id", "details", "status", "size")
48
+ class LoadStatus(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
49
+ __slots__ = ()
50
+ Compatible: _ClassVar[SnapshotDetails.LoadStatus]
51
+ Incompatible: _ClassVar[SnapshotDetails.LoadStatus]
52
+ Loaded: _ClassVar[SnapshotDetails.LoadStatus]
53
+ Compatible: SnapshotDetails.LoadStatus
54
+ Incompatible: SnapshotDetails.LoadStatus
55
+ Loaded: SnapshotDetails.LoadStatus
56
+ SNAPSHOT_ID_FIELD_NUMBER: _ClassVar[int]
57
+ DETAILS_FIELD_NUMBER: _ClassVar[int]
58
+ STATUS_FIELD_NUMBER: _ClassVar[int]
59
+ SIZE_FIELD_NUMBER: _ClassVar[int]
60
+ snapshot_id: str
61
+ details: _snapshot_pb2.Snapshot
62
+ status: SnapshotDetails.LoadStatus
63
+ size: int
64
+ def __init__(self, snapshot_id: _Optional[str] = ..., details: _Optional[_Union[_snapshot_pb2.Snapshot, _Mapping]] = ..., status: _Optional[_Union[SnapshotDetails.LoadStatus, str]] = ..., size: _Optional[int] = ...) -> None: ...
65
+
66
+ class SnapshotList(_message.Message):
67
+ __slots__ = ("snapshots",)
68
+ SNAPSHOTS_FIELD_NUMBER: _ClassVar[int]
69
+ snapshots: _containers.RepeatedCompositeFieldContainer[SnapshotDetails]
70
+ def __init__(self, snapshots: _Optional[_Iterable[_Union[SnapshotDetails, _Mapping]]] = ...) -> None: ...
71
+
72
+ class IceboxTarget(_message.Message):
73
+ __slots__ = ("pid", "package_name", "snapshot_id", "failed", "err", "max_snapshot_number")
74
+ PID_FIELD_NUMBER: _ClassVar[int]
75
+ PACKAGE_NAME_FIELD_NUMBER: _ClassVar[int]
76
+ SNAPSHOT_ID_FIELD_NUMBER: _ClassVar[int]
77
+ FAILED_FIELD_NUMBER: _ClassVar[int]
78
+ ERR_FIELD_NUMBER: _ClassVar[int]
79
+ MAX_SNAPSHOT_NUMBER_FIELD_NUMBER: _ClassVar[int]
80
+ pid: int
81
+ package_name: str
82
+ snapshot_id: str
83
+ failed: bool
84
+ err: str
85
+ max_snapshot_number: int
86
+ def __init__(self, pid: _Optional[int] = ..., package_name: _Optional[str] = ..., snapshot_id: _Optional[str] = ..., failed: bool = ..., err: _Optional[str] = ..., max_snapshot_number: _Optional[int] = ...) -> None: ...
@@ -0,0 +1,487 @@
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 import snapshot_service_pb2 as android__env_dot_proto_dot_snapshot__service__pb2
7
+
8
+ GRPC_GENERATED_VERSION = '1.71.0'
9
+ GRPC_VERSION = grpc.__version__
10
+ _version_not_supported = False
11
+
12
+ try:
13
+ from grpc._utilities import first_version_is_lower
14
+ _version_not_supported = first_version_is_lower(GRPC_VERSION, GRPC_GENERATED_VERSION)
15
+ except ImportError:
16
+ _version_not_supported = True
17
+
18
+ if _version_not_supported:
19
+ raise RuntimeError(
20
+ f'The grpc package installed is at version {GRPC_VERSION},'
21
+ + f' but the generated code in android_env/proto/snapshot_service_pb2_grpc.py depends on'
22
+ + f' grpcio>={GRPC_GENERATED_VERSION}.'
23
+ + f' Please upgrade your grpc module to grpcio>={GRPC_GENERATED_VERSION}'
24
+ + f' or downgrade your generated code using grpcio-tools<={GRPC_VERSION}.'
25
+ )
26
+
27
+
28
+ class SnapshotServiceStub(object):
29
+ """The SnapshotService enables you to list, insert, store, and retrieve
30
+ snapshots.
31
+
32
+ Currently there are two types of snapshots:
33
+
34
+ - Local (default): These are snapshots that are created locally. They are
35
+ stored internally inside qcow2 files and are very efficient. These are
36
+ the snapshots usually created by interacting with the UI.
37
+
38
+ - Remote: These are snapshots that have been exported at a certain point.
39
+ an exported snapshot is normalized (completely self contained) and
40
+ can be imported into an emulator with a similar hardware configuration.
41
+
42
+ Currently the emulator has limited support for importing snapshots:
43
+ - Once an imported snapshot has been loaded into an emulator it is no longer
44
+ possible to create new snapshots.
45
+ - The hardware configuration of the emulator your are pushing a snapshot to
46
+ must match (or be very similar) to the one you pulled the snapshot from.
47
+
48
+ For example do not expect to be able to restore a snapshot on created on an
49
+ Intel cpu on an AMD cpu.
50
+ """
51
+
52
+ def __init__(self, channel):
53
+ """Constructor.
54
+
55
+ Args:
56
+ channel: A grpc.Channel.
57
+ """
58
+ self.ListSnapshots = channel.unary_unary(
59
+ '/android.emulation.control.SnapshotService/ListSnapshots',
60
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotFilter.SerializeToString,
61
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotList.FromString,
62
+ _registered_method=True)
63
+ self.PullSnapshot = channel.unary_stream(
64
+ '/android.emulation.control.SnapshotService/PullSnapshot',
65
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
66
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
67
+ _registered_method=True)
68
+ self.PushSnapshot = channel.stream_unary(
69
+ '/android.emulation.control.SnapshotService/PushSnapshot',
70
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
71
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
72
+ _registered_method=True)
73
+ self.LoadSnapshot = channel.unary_unary(
74
+ '/android.emulation.control.SnapshotService/LoadSnapshot',
75
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
76
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
77
+ _registered_method=True)
78
+ self.SaveSnapshot = channel.unary_unary(
79
+ '/android.emulation.control.SnapshotService/SaveSnapshot',
80
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
81
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
82
+ _registered_method=True)
83
+ self.DeleteSnapshot = channel.unary_unary(
84
+ '/android.emulation.control.SnapshotService/DeleteSnapshot',
85
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
86
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
87
+ _registered_method=True)
88
+ self.TrackProcess = channel.unary_unary(
89
+ '/android.emulation.control.SnapshotService/TrackProcess',
90
+ request_serializer=android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.SerializeToString,
91
+ response_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.FromString,
92
+ _registered_method=True)
93
+
94
+
95
+ class SnapshotServiceServicer(object):
96
+ """The SnapshotService enables you to list, insert, store, and retrieve
97
+ snapshots.
98
+
99
+ Currently there are two types of snapshots:
100
+
101
+ - Local (default): These are snapshots that are created locally. They are
102
+ stored internally inside qcow2 files and are very efficient. These are
103
+ the snapshots usually created by interacting with the UI.
104
+
105
+ - Remote: These are snapshots that have been exported at a certain point.
106
+ an exported snapshot is normalized (completely self contained) and
107
+ can be imported into an emulator with a similar hardware configuration.
108
+
109
+ Currently the emulator has limited support for importing snapshots:
110
+ - Once an imported snapshot has been loaded into an emulator it is no longer
111
+ possible to create new snapshots.
112
+ - The hardware configuration of the emulator your are pushing a snapshot to
113
+ must match (or be very similar) to the one you pulled the snapshot from.
114
+
115
+ For example do not expect to be able to restore a snapshot on created on an
116
+ Intel cpu on an AMD cpu.
117
+ """
118
+
119
+ def ListSnapshots(self, request, context):
120
+ """Lists all the snapshots, filtered by the given query, that are stored
121
+ locally for the currently running avd. This includes all the snapshots that
122
+ were imported (pushed) into this emulator.
123
+
124
+ Returns a list of snapshot_id's and associated details that describes
125
+ the hardware configuration, logical name, etc of the snapshot.
126
+ """
127
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
128
+ context.set_details('Method not implemented!')
129
+ raise NotImplementedError('Method not implemented!')
130
+
131
+ def PullSnapshot(self, request, context):
132
+ """Pulls down the snapshot stored inside the AVD as a tar.gz/tar stream
133
+ This will normalize the snapshot, all relevant data to push a snapshot
134
+ into a similar emulator will be placed inside the tar file.
135
+
136
+ Pulling down a snapshot will pause the emulator until the snapshots
137
+ are rebased and ready for exporting. Once the snapshot is rebased
138
+ the emulator will continue and downloading should commence.
139
+
140
+ Note that pulling .gz stream is slow.
141
+
142
+ You must provide the snapshot_id and (desired) format.
143
+
144
+ If SnapshotPackage.path is set, the gRPC service will directly write the
145
+ exported snapshot to SnapshotPackage.path without streaming, which is
146
+ usually significantly faster. It would require emulator to have direct
147
+ access to SnapshotPackage.path, which usually means it can only be used
148
+ when pulling from a local emulator.
149
+ """
150
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
151
+ context.set_details('Method not implemented!')
152
+ raise NotImplementedError('Method not implemented!')
153
+
154
+ def PushSnapshot(self, request_iterator, context):
155
+ """Push a tar.gz stream contain the snapshot. The tar file should
156
+ be a snapshot that was exported through the PullSnapshot in the past.
157
+ The emulator will try to import the snapshot. The hardware configuration
158
+ of the current emulator should match the one used for pulling.
159
+
160
+ A detailed description of the snapshot (emulator_snapshot.Snapshot)
161
+ is stored in the snapshot.pb file inside the tar.
162
+
163
+ You must provide the snapshot_id and format in the first message.
164
+ Will return success and a possible error message when a failure occurs.
165
+
166
+ If SnapshotPackage.path is set, the gRPC service will directly unzip the
167
+ exported snapshot from SnapshotPackage.path without streaming, which is
168
+ usually significantly faster. It would require emulator to have direct
169
+ access to SnapshotPackage.path, which usually means it can only be used
170
+ when pushing to a local emulator.
171
+ """
172
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
173
+ context.set_details('Method not implemented!')
174
+ raise NotImplementedError('Method not implemented!')
175
+
176
+ def LoadSnapshot(self, request, context):
177
+ """Loads the given snapshot inside the emulator and activates it.
178
+ The device will be in the state as it was when the snapshot was created.
179
+
180
+ You will no longer be able to call Save if this was an imported
181
+ snapshot that was pushed into this emulator.
182
+
183
+ You must provide the snapshot_id to indicate which snapshot to load
184
+ Will return success and a possible error message when a failure occurs.
185
+ """
186
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
187
+ context.set_details('Method not implemented!')
188
+ raise NotImplementedError('Method not implemented!')
189
+
190
+ def SaveSnapshot(self, request, context):
191
+ """Creates as a snapshot of the current state of the emulator.
192
+ You can only save a snapshot if you never activated (Load) an imported
193
+ snapshot (Push).
194
+
195
+ For example:
196
+ - PushSnapshot("some_snap.tar.gz");
197
+ - LoadSnapshot("some_snap");
198
+ - SaveSnapshot("same_newer_snap"); // <--- Will currently fail.
199
+
200
+ You can provide the snapshot_id to indicate the name used for storing.
201
+ Will return success and a possible error message when a failure occurs.
202
+ """
203
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
204
+ context.set_details('Method not implemented!')
205
+ raise NotImplementedError('Method not implemented!')
206
+
207
+ def DeleteSnapshot(self, request, context):
208
+ """Deletes the snapshot with the given snapshot_id from the avd.
209
+
210
+ You must provide the snapshot_id to indicate which snapshot to delete.
211
+ Will return success and a possible error message when a failure occurs.
212
+ """
213
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
214
+ context.set_details('Method not implemented!')
215
+ raise NotImplementedError('Method not implemented!')
216
+
217
+ def TrackProcess(self, request, context):
218
+ """Tracks the given process for automated snapshot creation in case of
219
+ assert failures.
220
+
221
+ Will return success and a possible error message when a failure occurs.
222
+ The snapshot_id field will contain the name of the snapshot that
223
+ will be created. The pid field will contain the process id that is
224
+ being tracked.
225
+ """
226
+ context.set_code(grpc.StatusCode.UNIMPLEMENTED)
227
+ context.set_details('Method not implemented!')
228
+ raise NotImplementedError('Method not implemented!')
229
+
230
+
231
+ def add_SnapshotServiceServicer_to_server(servicer, server):
232
+ rpc_method_handlers = {
233
+ 'ListSnapshots': grpc.unary_unary_rpc_method_handler(
234
+ servicer.ListSnapshots,
235
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotFilter.FromString,
236
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotList.SerializeToString,
237
+ ),
238
+ 'PullSnapshot': grpc.unary_stream_rpc_method_handler(
239
+ servicer.PullSnapshot,
240
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
241
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
242
+ ),
243
+ 'PushSnapshot': grpc.stream_unary_rpc_method_handler(
244
+ servicer.PushSnapshot,
245
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
246
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
247
+ ),
248
+ 'LoadSnapshot': grpc.unary_unary_rpc_method_handler(
249
+ servicer.LoadSnapshot,
250
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
251
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
252
+ ),
253
+ 'SaveSnapshot': grpc.unary_unary_rpc_method_handler(
254
+ servicer.SaveSnapshot,
255
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
256
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
257
+ ),
258
+ 'DeleteSnapshot': grpc.unary_unary_rpc_method_handler(
259
+ servicer.DeleteSnapshot,
260
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
261
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
262
+ ),
263
+ 'TrackProcess': grpc.unary_unary_rpc_method_handler(
264
+ servicer.TrackProcess,
265
+ request_deserializer=android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.FromString,
266
+ response_serializer=android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.SerializeToString,
267
+ ),
268
+ }
269
+ generic_handler = grpc.method_handlers_generic_handler(
270
+ 'android.emulation.control.SnapshotService', rpc_method_handlers)
271
+ server.add_generic_rpc_handlers((generic_handler,))
272
+ server.add_registered_method_handlers('android.emulation.control.SnapshotService', rpc_method_handlers)
273
+
274
+
275
+ # This class is part of an EXPERIMENTAL API.
276
+ class SnapshotService(object):
277
+ """The SnapshotService enables you to list, insert, store, and retrieve
278
+ snapshots.
279
+
280
+ Currently there are two types of snapshots:
281
+
282
+ - Local (default): These are snapshots that are created locally. They are
283
+ stored internally inside qcow2 files and are very efficient. These are
284
+ the snapshots usually created by interacting with the UI.
285
+
286
+ - Remote: These are snapshots that have been exported at a certain point.
287
+ an exported snapshot is normalized (completely self contained) and
288
+ can be imported into an emulator with a similar hardware configuration.
289
+
290
+ Currently the emulator has limited support for importing snapshots:
291
+ - Once an imported snapshot has been loaded into an emulator it is no longer
292
+ possible to create new snapshots.
293
+ - The hardware configuration of the emulator your are pushing a snapshot to
294
+ must match (or be very similar) to the one you pulled the snapshot from.
295
+
296
+ For example do not expect to be able to restore a snapshot on created on an
297
+ Intel cpu on an AMD cpu.
298
+ """
299
+
300
+ @staticmethod
301
+ def ListSnapshots(request,
302
+ target,
303
+ options=(),
304
+ channel_credentials=None,
305
+ call_credentials=None,
306
+ insecure=False,
307
+ compression=None,
308
+ wait_for_ready=None,
309
+ timeout=None,
310
+ metadata=None):
311
+ return grpc.experimental.unary_unary(
312
+ request,
313
+ target,
314
+ '/android.emulation.control.SnapshotService/ListSnapshots',
315
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotFilter.SerializeToString,
316
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotList.FromString,
317
+ options,
318
+ channel_credentials,
319
+ insecure,
320
+ call_credentials,
321
+ compression,
322
+ wait_for_ready,
323
+ timeout,
324
+ metadata,
325
+ _registered_method=True)
326
+
327
+ @staticmethod
328
+ def PullSnapshot(request,
329
+ target,
330
+ options=(),
331
+ channel_credentials=None,
332
+ call_credentials=None,
333
+ insecure=False,
334
+ compression=None,
335
+ wait_for_ready=None,
336
+ timeout=None,
337
+ metadata=None):
338
+ return grpc.experimental.unary_stream(
339
+ request,
340
+ target,
341
+ '/android.emulation.control.SnapshotService/PullSnapshot',
342
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
343
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
344
+ options,
345
+ channel_credentials,
346
+ insecure,
347
+ call_credentials,
348
+ compression,
349
+ wait_for_ready,
350
+ timeout,
351
+ metadata,
352
+ _registered_method=True)
353
+
354
+ @staticmethod
355
+ def PushSnapshot(request_iterator,
356
+ target,
357
+ options=(),
358
+ channel_credentials=None,
359
+ call_credentials=None,
360
+ insecure=False,
361
+ compression=None,
362
+ wait_for_ready=None,
363
+ timeout=None,
364
+ metadata=None):
365
+ return grpc.experimental.stream_unary(
366
+ request_iterator,
367
+ target,
368
+ '/android.emulation.control.SnapshotService/PushSnapshot',
369
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
370
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
371
+ options,
372
+ channel_credentials,
373
+ insecure,
374
+ call_credentials,
375
+ compression,
376
+ wait_for_ready,
377
+ timeout,
378
+ metadata,
379
+ _registered_method=True)
380
+
381
+ @staticmethod
382
+ def LoadSnapshot(request,
383
+ target,
384
+ options=(),
385
+ channel_credentials=None,
386
+ call_credentials=None,
387
+ insecure=False,
388
+ compression=None,
389
+ wait_for_ready=None,
390
+ timeout=None,
391
+ metadata=None):
392
+ return grpc.experimental.unary_unary(
393
+ request,
394
+ target,
395
+ '/android.emulation.control.SnapshotService/LoadSnapshot',
396
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
397
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
398
+ options,
399
+ channel_credentials,
400
+ insecure,
401
+ call_credentials,
402
+ compression,
403
+ wait_for_ready,
404
+ timeout,
405
+ metadata,
406
+ _registered_method=True)
407
+
408
+ @staticmethod
409
+ def SaveSnapshot(request,
410
+ target,
411
+ options=(),
412
+ channel_credentials=None,
413
+ call_credentials=None,
414
+ insecure=False,
415
+ compression=None,
416
+ wait_for_ready=None,
417
+ timeout=None,
418
+ metadata=None):
419
+ return grpc.experimental.unary_unary(
420
+ request,
421
+ target,
422
+ '/android.emulation.control.SnapshotService/SaveSnapshot',
423
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
424
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
425
+ options,
426
+ channel_credentials,
427
+ insecure,
428
+ call_credentials,
429
+ compression,
430
+ wait_for_ready,
431
+ timeout,
432
+ metadata,
433
+ _registered_method=True)
434
+
435
+ @staticmethod
436
+ def DeleteSnapshot(request,
437
+ target,
438
+ options=(),
439
+ channel_credentials=None,
440
+ call_credentials=None,
441
+ insecure=False,
442
+ compression=None,
443
+ wait_for_ready=None,
444
+ timeout=None,
445
+ metadata=None):
446
+ return grpc.experimental.unary_unary(
447
+ request,
448
+ target,
449
+ '/android.emulation.control.SnapshotService/DeleteSnapshot',
450
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.SerializeToString,
451
+ android__env_dot_proto_dot_snapshot__service__pb2.SnapshotPackage.FromString,
452
+ options,
453
+ channel_credentials,
454
+ insecure,
455
+ call_credentials,
456
+ compression,
457
+ wait_for_ready,
458
+ timeout,
459
+ metadata,
460
+ _registered_method=True)
461
+
462
+ @staticmethod
463
+ def TrackProcess(request,
464
+ target,
465
+ options=(),
466
+ channel_credentials=None,
467
+ call_credentials=None,
468
+ insecure=False,
469
+ compression=None,
470
+ wait_for_ready=None,
471
+ timeout=None,
472
+ metadata=None):
473
+ return grpc.experimental.unary_unary(
474
+ request,
475
+ target,
476
+ '/android.emulation.control.SnapshotService/TrackProcess',
477
+ android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.SerializeToString,
478
+ android__env_dot_proto_dot_snapshot__service__pb2.IceboxTarget.FromString,
479
+ options,
480
+ channel_credentials,
481
+ insecure,
482
+ call_credentials,
483
+ compression,
484
+ wait_for_ready,
485
+ timeout,
486
+ metadata,
487
+ _registered_method=True)