Skip to content

Commit

Permalink
Bugreport
Browse files Browse the repository at this point in the history
  • Loading branch information
aBozowski committed Oct 19, 2023
1 parent efcc621 commit 024eeb6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/tools/interop/idt/capture/platform/android/android.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,14 @@
#

import ipaddress
import os
import traceback
import typing

from capture import log_format
from capture.base import PlatformLogStreamer
from capture.shell_utils import Bash
from . import config
from . import streams
from .capabilities import Capabilities

Expand Down Expand Up @@ -179,6 +181,7 @@ async def connect(self) -> None:
async def handle_stream_action(self, action: str) -> None:
had_error = False
for stream_name, stream in self.streams.items():
self.logger.info(f"Doing {action} for {stream_name}!")
try:
await getattr(stream, action)()
except:
Expand All @@ -192,3 +195,15 @@ async def start_streaming(self) -> None:

async def stop_streaming(self) -> None:
await self.handle_stream_action("stop")
if config.enable_bug_report:
found = False
for item in os.listdir(self.artifact_dir):
if "bugreport" in item and ".zip" in item:
found = True
if not found:
self.logger.info("Taking bugreport")
self.run_adb_command("bugreport", cwd=self.artifact_dir)
else:
self.logger.warning("bugreport already taken")
else:
self.logger.critical("bugreport disabled in settings!")
1 change: 1 addition & 0 deletions src/tools/interop/idt/capture/platform/android/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,4 @@
#

enable_build_push_tcpdump = True
enable_bug_report = True

0 comments on commit 024eeb6

Please sign in to comment.