aboutsummaryrefslogtreecommitdiff
path: root/mobly/controllers/android_device_lib/services
diff options
context:
space:
mode:
Diffstat (limited to 'mobly/controllers/android_device_lib/services')
-rw-r--r--mobly/controllers/android_device_lib/services/logcat.py4
-rw-r--r--mobly/controllers/android_device_lib/services/snippet_management_service.py9
2 files changed, 11 insertions, 2 deletions
diff --git a/mobly/controllers/android_device_lib/services/logcat.py b/mobly/controllers/android_device_lib/services/logcat.py
index cbd8e95..37a8454 100644
--- a/mobly/controllers/android_device_lib/services/logcat.py
+++ b/mobly/controllers/android_device_lib/services/logcat.py
@@ -201,6 +201,10 @@ class Logcat(base_service.BaseService):
The collection runs in a separate subprocess and saves logs in a file.
"""
+ if self._ad.is_bootloader:
+ self._ad.log.warning(
+ 'Skip starting logcat because the device is in fastboot mode.')
+ return
self._assert_not_running()
if self._config.clear_log:
self.clear_adb_log()
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