aboutsummaryrefslogtreecommitdiff
path: root/mobly/controllers/android_device.py
diff options
context:
space:
mode:
Diffstat (limited to 'mobly/controllers/android_device.py')
-rw-r--r--mobly/controllers/android_device.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/mobly/controllers/android_device.py b/mobly/controllers/android_device.py
index 54166a5..c093e3c 100644
--- a/mobly/controllers/android_device.py
+++ b/mobly/controllers/android_device.py
@@ -901,7 +901,7 @@ class AndroidDevice:
# So we need to wait for the device to come back before proceeding.
self.adb.wait_for_device(timeout=DEFAULT_TIMEOUT_BOOT_COMPLETION_SECOND)
- def load_snippet(self, name, package):
+ def load_snippet(self, name, package, config=None):
"""Starts the snippet apk with the given package name and connects.
Examples:
@@ -917,6 +917,9 @@ class AndroidDevice:
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:
SnippetError: Illegal load operations are attempted.
@@ -926,7 +929,9 @@ class AndroidDevice:
raise SnippetError(
self,
'Attribute "%s" already exists, please use a different name.' % name)
- self.services.snippets.add_snippet_client(name, package)
+ self.services.snippets.add_snippet_client(
+ name, package, config=config
+ )
def unload_snippet(self, name):
"""Stops a snippet apk.