From 728057dbba2c84eaea46bbe9e2903c134d354337 Mon Sep 17 00:00:00 2001 From: Marc Bonnici Date: Wed, 7 Feb 2018 09:32:03 +0000 Subject: [PATCH] target/androidassistant: Fix Logcat poller creation Threads cannot be restarted therfore we need to create a new polling thread for each time the poller is started. --- wa/framework/target/assistant.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wa/framework/target/assistant.py b/wa/framework/target/assistant.py index 18b24c38..a9a41abe 100644 --- a/wa/framework/target/assistant.py +++ b/wa/framework/target/assistant.py @@ -49,15 +49,14 @@ class AndroidAssistant(object): def __init__(self, target, logcat_poll_period=None): self.target = target + self.logcat_poll_period = logcat_poll_period + self.logcat_poller = None if self.target.is_rooted: self.disable_selinux() - if logcat_poll_period: - self.logcat_poller = LogcatPoller(target, logcat_poll_period) - else: - self.logcat_poller = None def start(self): - if self.logcat_poller: + if self.logcat_poll_period: + self.logcat_poller = LogcatPoller(self.target, self.logcat_poll_period) self.logcat_poller.start() def stop(self):