def reboot(self, timeout=None, wait_polling_interval=None):
        """Reboot the device, waiting for the adb connection to become stable.

        :param timeout: Maximum time to wait for reboot.
        :param wait_polling_interval: Interval at which to poll for device readiness.
        """
        if timeout is None:
            timeout = self._timeout
        if wait_polling_interval is None:
            wait_polling_interval = self._wait_polling_interval

        self._logger.info("Rebooting device")
        self.wait_for_device_ready(timeout,
                                   after_first=lambda:self.command_output(["reboot"]))