xref: /aosp_15_r20/bootable/recovery/minadbd/README.md (revision e7c364b630b241adcb6c7726a21055250b91fdac)
1*e7c364b6SAndroid Build Coastguard Workerminadbd
2*e7c364b6SAndroid Build Coastguard Worker=======
3*e7c364b6SAndroid Build Coastguard Worker
4*e7c364b6SAndroid Build Coastguard Worker`minadbd` is analogous to the regular `adbd`, but providing the minimal services to support
5*e7c364b6SAndroid Build Coastguard Workerrecovery-specific use cases. Generally speaking, `adbd` = `libadbd` + `libadbd_services`, whereas
6*e7c364b6SAndroid Build Coastguard Worker`minadbd` = `libadbd` + `libminadbd_services`.
7*e7c364b6SAndroid Build Coastguard Worker
8*e7c364b6SAndroid Build Coastguard WorkerAlthough both modules may be installed into the recovery image, only one of them, or none, can be
9*e7c364b6SAndroid Build Coastguard Workeractive at any given time.
10*e7c364b6SAndroid Build Coastguard Worker
11*e7c364b6SAndroid Build Coastguard Worker- The start / stop of `adbd` is managed via system property `sys.usb.config`, when setting to `adb`
12*e7c364b6SAndroid Build Coastguard Worker  or `none` respectively. Upon starting recovery mode, `adbd` is started in debuggable builds by
13*e7c364b6SAndroid Build Coastguard Worker  default; otherwise `adbd` will stay off at all times in user builds. See the triggers in
14*e7c364b6SAndroid Build Coastguard Worker  `bootable/recovery/etc/init.rc`.
15*e7c364b6SAndroid Build Coastguard Worker
16*e7c364b6SAndroid Build Coastguard Worker- `minadbd` is started by `recovery` as needed.
17*e7c364b6SAndroid Build Coastguard Worker  - When requested to start `minadbd`, `recovery` stops `adbd` first, if it's running; it then forks
18*e7c364b6SAndroid Build Coastguard Worker    and execs `minadbd` in a separate process.
19*e7c364b6SAndroid Build Coastguard Worker  - `minadbd` talks to host-side `adb` server to get user requests.
20*e7c364b6SAndroid Build Coastguard Worker    - `minadbd` handles some requests directly, e.g. querying device properties for rescue service.
21*e7c364b6SAndroid Build Coastguard Worker    - `minadbd` communicates with `recovery` to fulfill requests regarding package installation. See
22*e7c364b6SAndroid Build Coastguard Worker      the comments in `bootable/recovery/install/adb_install.cpp` for the IPC protocol between
23*e7c364b6SAndroid Build Coastguard Worker      `recovery` and `minadbd`.
24*e7c364b6SAndroid Build Coastguard Worker  - Upon exiting `minadbd`, `recovery` restarts `adbd` if it was previously running.
25