support delay config
This commit is contained in:
@@ -6,6 +6,8 @@ from dataclasses import dataclass
|
||||
from enum import Enum
|
||||
from typing import Optional
|
||||
|
||||
from phone_agent.config.timing import TIMING_CONFIG
|
||||
|
||||
|
||||
class ConnectionType(Enum):
|
||||
"""Type of ADB connection."""
|
||||
@@ -244,7 +246,7 @@ class ADBConnection:
|
||||
output = result.stdout + result.stderr
|
||||
|
||||
if "restarting" in output.lower() or result.returncode == 0:
|
||||
time.sleep(2) # Wait for ADB to restart
|
||||
time.sleep(TIMING_CONFIG.connection.adb_restart_delay)
|
||||
return True, f"TCP/IP mode enabled on port {port}"
|
||||
else:
|
||||
return False, output.strip()
|
||||
@@ -312,7 +314,7 @@ class ADBConnection:
|
||||
[self.adb_path, "kill-server"], capture_output=True, timeout=5
|
||||
)
|
||||
|
||||
time.sleep(1)
|
||||
time.sleep(TIMING_CONFIG.connection.server_restart_delay)
|
||||
|
||||
# Start server
|
||||
subprocess.run(
|
||||
|
||||
Reference in New Issue
Block a user