diff options
author | uael <uael@google.com> | 2023-10-05 02:21:32 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-10-05 02:21:32 +0000 |
commit | c31e576329d6847c781f50d0434311e361ef3882 (patch) | |
tree | 22c90a7f799b736bb1fb9f8972eb39d2fd4418e4 /mobly/controllers/android_device_lib/services | |
parent | 872432729fdc4a5e3efd86d57e7456fa75537b4d (diff) | |
parent | 337de6ca59d6df85630e9030f084327afec078a1 (diff) | |
download | mobly-c31e576329d6847c781f50d0434311e361ef3882.tar.gz |
Merge remote-tracking branch 'aosp/upstream-master' into main am: a3c64c07c8 am: a6408fdd14 am: b31b1eddc1 am: 337de6ca59
Original change: https://android-review.googlesource.com/c/platform/external/python/mobly/+/2736301
Change-Id: I74600a88ad9778dd8fd9284d6e37e8151ccb2984
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'mobly/controllers/android_device_lib/services')
-rw-r--r-- | mobly/controllers/android_device_lib/services/logcat.py | 4 | ||||
-rw-r--r-- | mobly/controllers/android_device_lib/services/snippet_management_service.py | 9 |
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 |