Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b4240ed5 authored by Treehugger Robot's avatar Treehugger Robot Committed by Gerrit Code Review
Browse files

Merge "GD HCI:Wait channel ready after stop/start server"

parents bb2c05ac 410b12cb
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -29,7 +29,7 @@ import grpc


ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
ANDROID_BUILD_TOP = os.environ.get('ANDROID_BUILD_TOP')
ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
ANDROID_HOST_OUT = os.environ.get('ANDROID_HOST_OUT')
_WAIT_CHANNEL_READY_TIMEOUT = 10
WAIT_CHANNEL_READY_TIMEOUT = 10


def replace_vars(string, config):
def replace_vars(string, config):
    return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
    return string.replace("$ANDROID_HOST_OUT", ANDROID_HOST_OUT) \
@@ -91,7 +91,7 @@ class GdDeviceBase:
    def wait_channel_ready(self):
    def wait_channel_ready(self):
        future = grpc.channel_ready_future(self.grpc_channel)
        future = grpc.channel_ready_future(self.grpc_channel)
        try:
        try:
          future.result(timeout=_WAIT_CHANNEL_READY_TIMEOUT)
          future.result(timeout = WAIT_CHANNEL_READY_TIMEOUT)
        except grpc.FutureTimeoutError:
        except grpc.FutureTimeoutError:
          logging.error("wait channel ready timeout")
          logging.error("wait channel ready timeout")


+3 −0
Original line number Original line Diff line number Diff line
@@ -47,6 +47,9 @@ class SimpleHciTest(GdBaseTestClass):
            )
            )
        )
        )


        self.device_under_test.wait_channel_ready()
        self.cert_device.wait_channel_ready()

        self.device_under_test.hci.SetPageScanMode(
        self.device_under_test.hci.SetPageScanMode(
            hci_facade_pb2.PageScanMode(enabled=True)
            hci_facade_pb2.PageScanMode(enabled=True)
        )
        )