Merge main into feat/viture-xr

This commit is contained in:
maxjivi05 committed 2026-10-13 23:35:29 -04:00
commit 697c75337f
903 files changed
+70115 -47401

No files matched your search

+3 -9
View File
@@ -15,7 +15,7 @@ import time
from pathlib import Path
sys.path.insert(0, str(Path(__file__).resolve().parent))
from adb_device import DeviceResolutionError, resolve_serial # noqa: E402
from adb_device import DeviceResolutionError, resolve_serial
AUTHORITY = "content://com.droiddeck.launcher.agent"
@@ -215,7 +215,6 @@ def add_serial(response: dict, serial: str) -> dict:
return response
# --- displays ------------------------------------------------------------------------------------
def displays(adb: str, serial: str) -> list[dict]:
"""Logical displays with the SurfaceFlinger (physical) id screencap and screenrecord want."""
@@ -285,7 +284,6 @@ def record(adb: str, serial: str, path: str, seconds: float, display: int | None
return {"ok": True, "command": "record", "path": str(destination), "seconds": seconds, "display": display}
# --- commands ------------------------------------------------------------------------------------
def start_session(adb: str, serial: str, request: dict) -> dict:
if request.get("mode") == "run":
@@ -300,7 +298,7 @@ def start_session(adb: str, serial: str, request: dict) -> dict:
def require_commands(adb: str, serial: str) -> dict:
access = checked(provider_call(adb, serial, "access"), "ACCESS_FAILED")
if access.get("commands") is not True:
raise ControlError("Debugging tools are off: turn on Setup > Session > Debugging tools on the device",
raise ControlError("Debugging tools are off: turn on Setup > Diagnostics > Debugging tools on the device",
"AGENT_COMMANDS_DISABLED")
return access
@@ -343,8 +341,6 @@ def execute(args: argparse.Namespace, adb: str, serial: str) -> dict:
if args.steamvr:
request["steamVr"] = True
if args.reuse:
# A scenario's per-run "before": keep a session of this mode that is already up, so only
# a run after one that ended (a crash, the low-memory killer) starts a new one.
current = get_state(adb, serial)["session"]
wanted = {"steam": "steam", "desktop": "lxqt"}[args.mode]
if current.get("running") and current.get("mode") == wanted and current.get("phase") not in {"STOPPING", "FAILED"}:
@@ -528,7 +524,6 @@ def execute(args: argparse.Namespace, adb: str, serial: str) -> dict:
return add_serial(record(adb, serial, args.path, args.seconds, args.display), serial)
if command == "wake":
# A sleeping device stops the session and hides the app's windows from ui dump.
run_adb(adb, serial, "shell", "input", "keyevent", "KEYCODE_WAKEUP")
run_adb(adb, serial, "shell", "wm", "dismiss-keyguard")
power = run_adb(adb, serial, "shell", "dumpsys", "power").stdout.decode(errors="replace")
@@ -570,7 +565,6 @@ def build_parser() -> argparse.ArgumentParser:
stop = commands.add_parser("stop", help="stop the session and wait for IDLE")
stop.add_argument("--timeout", type=float, default=90)
# Collecting the client's logs and redacting them took about two minutes after a Skyrim session.
stop.add_argument("--artifact-timeout", type=float, default=300)
commands.add_parser("resume", help="resume a suspended session")
@@ -753,7 +747,7 @@ def main(argv: list[str] | None = None) -> int:
except (ControlError, DeviceResolutionError) as exc:
error = {"code": getattr(exc, "code", "DEVICE_RESOLUTION_FAILED"), "message": str(exc)}
code = exit_code(exc)
except Exception as exc: # the contract is JSON on stdout, even for a bug in this tool
except Exception as exc:
error = {"code": "INTERNAL_ERROR", "message": f"{type(exc).__name__}: {exc}"}
code = 2
response = {"ok": False, "error": error}