summaryrefslogtreecommitdiffstats
path: root/minadbd/minadbd_services.cpp (follow)
Commit message (Collapse)AuthorAgeFilesLines
* minadbd: `adb rescue getprop` returns newline-terminated result.Tao Bao2019-06-101-10/+7
| | | | | | | | | | | | | | This change addresses the comment in [1], which makes the results of `adb shell getprop foo` and `adb rescue getprop foo` more consistent. That is, both will return newline-terminated results now. [1] https://r.android.com/c/platform/bootable/recovery/+/976340/3/minadbd/minadbd_services.cpp#188 Test: Run the following commands on taimen (under rescue mode): `adb rescue getprop ro.build.fingerprint` `adb rescue getprop ro.nonexistent` `adb rescue getprop` Change-Id: I5af47f8ea4d569b8507e259daef87749c0945f47
* minadbd: Support `adb rescue getprop`.Tao Bao2019-06-051-5/+18
| | | | | | | | It dumps all the allowed properties, similar to `adb shell getprop`. Bug: 134027350 Test: Run the command under rescue mode. Change-Id: Ic0864ca0fb51505ec1e4f38af2464591aa576201
* minadbd: More allowed properties.Tao Bao2019-06-031-1/+8
| | | | | | | | | | | Most of these properties are already part of the fingerprint. This CL allows querying them directly, instead of encouraging users to decode from fingerprints. Bug: 134027350 Test: Boot into rescue mode on taimen. Run `adb rescue getprop` with new props. Change-Id: Id4667fcaf0e908c391085b22e22c957acd01d9c4
* ConsumePrefix is now in libbase.Elliott Hughes2019-05-031-5/+5
| | | | | Test: treehugger Change-Id: I2feecabb77986d3e007de1009b123c2d98454631
* Support wipe command in rescue modexunchang2019-04-261-6/+40
| | | | | | Bug: 131037235 Test: unit tests pass, run `adb rescue wipe` Change-Id: I22668f2c98fe2d9195d2561f961c28a7c08e712c
* minadbd: Support `adb reboot` under sideload/rescue modes.Tao Bao2019-04-241-2/+41
| | | | | | | | | | | | Bug: 128415917 Test: Run the following commands under sideload and rescue modes respectively. $ adb reboot $ adb reboot bootloader $ adb reboot recovery $ adb reboot rescue $ adb reboot invalid Change-Id: I84daf63e3360b7b4a0af5e055149a4f54e10ba90
* Add test for minadbdxunchang2019-04-231-1/+7
| | | | | | | | | | | Ass some unit tests to check if the minadbd service exit correctly in the failure case. Also start the fuse and verify the socket communication between minadbd with adb host, and minadbd with recovery. Bug: 131037235 Test: run unit tests repeatedly, injects some errors and test fails without dangling process. Change-Id: I2f073b701b25d7f1aafc59868a7a91a8cbefaf49
* minadbd: Support rescue install and getprop commands.Tao Bao2019-04-191-14/+81
| | | | | | | | | | Bug: 128415917 Test: Enter rescue mode on taimen. Send the following commands: `adb rescue getprop ro.build.fingerprint` `adb rescue getprop ro.build.date.utc` `adb rescue install /path/to/package.zip` Test: Sideload on taimen w/ `adb sideload /path/to/package.zip`. Change-Id: Ibc25daf9fd13f7002e54789f67aaf85d06976bb8
* Allow entering rescue mode via recovery UI.Tao Bao2019-04-171-0/+6
| | | | | | | | | Only enabled on debuggable builds. Bug: 128415917 Test: Sideload package on taimen. Test: Choose "Enter rescue" from recovery UI. Change-Id: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02
* Remove the FD parameter from FuseDataProvider ctor.Tao Bao2019-04-161-2/+1
| | | | | | | | | | | This leaves the FD implementation details to subclasses. In particular, it allows minadbd to do additional works with the FD after sideloading. Bug: 128415917 Test: atest recovery_component_test Test: atest minadbd_test Test: Sideload package on taimen. Change-Id: I106bbaad05201227bbc5fe28890bbbb06fdcb67e
* Add socket communication between recovery and minadbdxunchang2019-04-111-7/+66
| | | | | | | | | | | | | This cl adds a socket pair to support the communication between recovery and minadbd. Therefore, minadbd will be able to issue multiple commands to recovery and get back the status of each command. This cl also switches the adb sideload from the recovery menu to use this protocol; and moves minadbd to a separate binary. Bug: 130166585 Test: sideload a package Change-Id: I80d36d5c4e6fe1ae3ea23640907bc50c0dc0d482
* Remove the provider_vtabxunchang2019-03-191-1/+5
| | | | | | | | | It's no longer needed with the newly added FuseDataProvider class. Also cleans up the parameters for run_fuse_sideload. Bug: 127071893 Test: unit tests pass, run a sideload Change-Id: I1ccd6798d187cfc6ac9f559ffb3f3edf08dad55c
* Create a FuseDataProvider base classxunchang2019-03-191-1/+1
| | | | | | | | | | | | The fuse data provider for adb/sdcard shares common code and structures. This cl creates a FuseDataProvider base class and provides implementations for adb and sdcard. In the follow cls, we can kill the provider_vtab struct; and also add another implementation to parse a block map file and provides data. Test: unit tests pass, sideload a package, apply a package from sdcard Change-Id: If8311666a52a2e3c0fbae0ee9688fa6d01e4ad09
* minadbd: daemon_service_to_fd takes std::string_view.Tao Bao2019-01-021-7/+7
| | | | | | | | | | | | The caller of daemon_service_to_fd() in core adb has switched to std::string_view in [1]. The mismatch breaks the sideload service, as it picks up the wrong daemon_service_to_fd() when serving sideload. [1] https://android-review.googlesource.com/c/platform/system/core/+/850392 Bug: 122171762 Test: `adb sideload` on taimen. Change-Id: Ie828400768523c35c5576e2c029e38fc0ad0aff9
* Allow OTA package size larger than 2GiB(2147483647 bytes) on sideload.katao2018-09-271-10/+11
| | | | | | | | | | | | | | At present, multiple partitions such as vendor have been added, which reduces the coupling between mobile phone manufacturers and Android systems. However, it may increase the generated package size substantially (e.g. from ~200MB to ~800MB). Causes the package size to exceed the int limit (2147483647 bytes). Change the int length parameters to long. Bug: http://b/112003354 Test: adb sideload ota.zip (ota.zip bigger than 2147483647 bytes) Change-Id: Ifb656431f7b961ac0e91754107578dc8b89ff14e Signed-off-by: katao <katao@xiaomi.com>
* minadbd: avoid overrriding services_to_fd.Josh Gao2018-07-271-22/+8
| | | | | | | | | | | | Previously, we were relying on linker ordering pulling in minadbd's copy of services_to_fd instead of libadbd's, which breaks when we switch to dynamically linking. Separate out libadbd's services into a separate function that's in a file that isn't built into libadbd, so that we can provide our own here. Bug: http://b/111831478 Test: mma Change-Id: I2479947b2d81db5e750020fffc2c2c770cb31a78
* minadbd: track signature change of service_to_fd.Josh Gao2018-04-141-1/+1
| | | | | | | Bug: http://b/37066218 Bug: http://b/71898863 Test: treehugger Change-Id: I5f2b14c65cff8d41dd3230d78b87e3e27e489bf6
* Drop -Wno-unused-parameter.Tao Bao2017-10-121-15/+15
| | | | | | | The only one left is libedify. Will handle that in a separate CL. Test: mmma bootable/recovery Change-Id: I732a5f85229da90fd767bee2e46c5c95f529c396
* Minor clean up to minadbd_services.cppTianjie Xu2017-04-191-9/+7
| | | | | | | | Switch some function signatures to std::string to avoid memory leak. Bug: 30039381 Test: sideload a package on angler Change-Id: Iae1e75871a782d6e5d6dde5dcf3f18469eb63f7d
* minadbd: switch adb_thread_create to std::thread.Josh Gao2017-04-131-27/+3
| | | | | Test: treehugger Change-Id: I7edcb13eb1fc6d4f36f5a764a1b647fbf9cd063e
* Use static_cast to cast pointers returned by malloc/calloc/realloc/mmap.Rahul Chaudhry2016-11-161-1/+1
| | | | | | | | | | | static_cast is preferable to reinterpret_cast when casting from void* pointers returned by malloc/calloc/realloc/mmap calls. Discovered while looking at compiler warnings (b/26936282). Test: WITH_TIDY=1 WITH_STATIC_ANALYZER=1 mma Change-Id: Iaffd537784aa857108f6981fdfd82d0496eb5592 Merged-In: I151642d5a60c94f312d0611576ad0143c249ba3d
* Minor minadbd cleanup.Elliott Hughes2016-06-171-0/+103
Distinguish our "services.cpp" more clearly from the regular adbd "services.cpp", and remove a few useless includes of "sysdeps.h". Change-Id: Ided4945a3ac5916133322ca7e95fa51add9abaa4