Skip to content

Commit

Permalink
Fix capabilities, screen
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Oct 23, 2023
1 parent 6ccfcc7 commit 8c8ac7f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def __repr__(self):
return s

def check_snoop_log(self) -> bool:
return config.hci_log_level in self.platform.run_adb_command("getprop persist.bluetooth.btsnooplogmode",
return config.hci_log_level in self.platform.run_adb_command("shell getprop persist.bluetooth.btsnooplogmode",
capture_output=True).get_captured_output()

def check_capabilities(self):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,18 @@ def check_screen(self) -> bool:
return "true" in screen_cmd_output.get_captured_output()

async def prepare_screen_recording(self) -> None:
try:
async with asyncio.timeout_at(asyncio.get_running_loop().time() + 20.0):
screen_on = self.check_screen()
while not screen_on:
await asyncio.sleep(2)
screen_on = self.check_screen()
if not screen_on:
self.logger.error("Please turn the screen on so screen recording can start!")
except TimeoutError:
self.logger.error("Screen recording timeout")
return
# try:
# async with asyncio.timeout_at(asyncio.get_running_loop().time() + 20.0):
screen_on = self.check_screen()
while not screen_on:
await asyncio.sleep(2)
screen_on = self.check_screen()
if not screen_on:
self.logger.error("Please turn the screen on so screen recording can start!")

# except TimeoutError:
# self.logger.error("Screen recording timeout")
# return

def update_commands(self) -> None:
self.screen_artifact = create_standard_log_name("screencast" + str(self.file_counter),
Expand All @@ -78,6 +79,7 @@ def update_commands(self) -> None:

def run_recorder(self) -> None:
while True:
asyncio.run(self.prepare_screen_recording())
self.update_commands()
self.logger.info(f"New screen recording file started {self.screen_phone_out_path} {self.screen_artifact}")
self.platform.run_adb_command(self.screen_command)
Expand Down

0 comments on commit 8c8ac7f

Please sign in to comment.