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

Commit a12000b4 authored by Rahul Arya's avatar Rahul Arya Committed by Thomas Girardier
Browse files

[Pandora] "Safely" reconnect phone

This is crashing in tradefed and we don't know why. Add logging so we
can see why, and so we don't block all the other tests.

Bug: 239986609
Test: existing
Tag: #stability
Change-Id: Ib845ba56e9459483ae23fe48929a10a73c7cba99
parent 0c022038
Loading
Loading
Loading
Loading
+19 −15
Original line number Diff line number Diff line
@@ -112,8 +112,10 @@ class RootCanal:
        return transport, idxs

    def reconnect_phone(self):
        devices = self.channel.send_command("list", [])
        devices = self._parse_device_list(devices)
        raw_devices = None
        try:
            raw_devices = self.channel.send_command("list", [])
            devices = self._parse_device_list(raw_devices)

            for dev_i, name in enumerate(devices["Devices"]):
                # the default transports are always 0 and 1
@@ -127,6 +129,8 @@ class RootCanal:
                for phy in target_phys:
                    if dev_i not in self._parse_phy(devices["Phys"][phy])[1]:
                        self.channel.send_command("add_device_to_phy", [dev_i, phy])
        except Exception as e:
            print(raw_devices, e)

    def disconnect_phy(self):
        # first, list all devices