aboutsummaryrefslogtreecommitdiff
path: root/mobly/controllers/android_device_lib/services/snippet_management_service.py
diff options
context:
space:
mode:
Diffstat (limited to 'mobly/controllers/android_device_lib/services/snippet_management_service.py')
-rw-r--r--mobly/controllers/android_device_lib/services/snippet_management_service.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mobly/controllers/android_device_lib/services/snippet_management_service.py b/mobly/controllers/android_device_lib/services/snippet_management_service.py
index fae60e2..05e8cda 100644
--- a/mobly/controllers/android_device_lib/services/snippet_management_service.py
+++ b/mobly/controllers/android_device_lib/services/snippet_management_service.py
@@ -55,7 +55,7 @@ class SnippetManagementService(base_service.BaseService):
if name in self._snippet_clients:
return self._snippet_clients[name]
- def add_snippet_client(self, name, package):
+ def add_snippet_client(self, name, package, config=None):
"""Adds a snippet client to the management.
Args:
@@ -63,6 +63,9 @@ class SnippetManagementService(base_service.BaseService):
client. E.g. `name='maps'` attaches the snippet client to
`ad.maps`.
package: string, the package name of the snippet apk to connect to.
+ config: snippet_client_v2.Config, the configuration object for
+ controlling the snippet behaviors. See the docstring of the `Config`
+ class for supported configurations.
Raises:
Error, if a duplicated name or package is passed in.
@@ -79,7 +82,9 @@ class SnippetManagementService(base_service.BaseService):
self, 'Snippet package "%s" has already been loaded under name'
' "%s".' % (package, snippet_name))
- client = snippet_client_v2.SnippetClientV2(package=package, ad=self._device)
+ client = snippet_client_v2.SnippetClientV2(
+ package=package, ad=self._device, config=config,
+ )
client.initialize()
self._snippet_clients[name] = client