mirror of
https://github.com/yume-chan/ya-webadb.git
synced 2025-10-03 09:49:24 +02:00
32 lines
957 B
TypeScript
32 lines
957 B
TypeScript
import type { Adb } from "../../adb.js";
|
|
import { AdbFeature } from "../../features.js";
|
|
|
|
import { AdbNoneProtocolSubprocessService } from "./none/index.js";
|
|
import { AdbShellProtocolSubprocessService } from "./shell/index.js";
|
|
|
|
export class AdbSubprocessService {
|
|
readonly #adb: Adb;
|
|
get adb() {
|
|
return this.#adb;
|
|
}
|
|
|
|
readonly #noneProtocol: AdbNoneProtocolSubprocessService;
|
|
get noneProtocol(): AdbNoneProtocolSubprocessService {
|
|
return this.#noneProtocol;
|
|
}
|
|
|
|
readonly #shellProtocol?: AdbShellProtocolSubprocessService;
|
|
get shellProtocol(): AdbShellProtocolSubprocessService | undefined {
|
|
return this.#shellProtocol;
|
|
}
|
|
|
|
constructor(adb: Adb) {
|
|
this.#adb = adb;
|
|
|
|
this.#noneProtocol = new AdbNoneProtocolSubprocessService(adb);
|
|
|
|
if (adb.canUseFeature(AdbFeature.Shell2)) {
|
|
this.#shellProtocol = new AdbShellProtocolSubprocessService(adb);
|
|
}
|
|
}
|
|
}
|