Rewrite snippet management to account for new launch protocol. (#216)
* Snippet will now try and detect v1 protocol and fall back to v0 if that
fails.
* Make snippet_client and sl4a_client responsible for bringup and teardown
of their apks, instead of sprinkling the logic for this between
jsonrpc_client_base, snippet_client, sl4a_client and android_device.
This is needed because the retry structure is now different for v1
snippets.
* Change how device port is handled. Device port comes from device side in
v1 snippets.
* Speed up snippet startup by avoiding extra stop before starting a
snippet.
diff --git a/tools/sl4a_shell.py b/tools/sl4a_shell.py
index 501e656..1006ff8 100755
--- a/tools/sl4a_shell.py
+++ b/tools/sl4a_shell.py
@@ -35,6 +35,7 @@
"""
import argparse
+import logging
from mobly.controllers.android_device_lib import jsonrpc_shell_base
@@ -42,7 +43,6 @@
class Sl4aShell(jsonrpc_shell_base.JsonRpcShellBase):
def _start_services(self, console_env):
"""Overrides superclass."""
- self._ad.start_services()
self._ad.load_sl4a()
console_env['s'] = self._ad.sl4a
console_env['sl4a'] = self._ad.sl4a
@@ -64,4 +64,5 @@
help=
'Device serial to connect to (if more than one device is connected)')
args = parser.parse_args()
+ logging.basicConfig(level=logging.INFO)
Sl4aShell().main(args.serial)