Commit graph

26 commits

Author SHA1 Message Date
Jack Wu
6b39dee45d Update health AIDL HAL to V2
Bug: 251425963
Test: Build
Change-Id: I471f8fb9c7eb1044ea0b920d55728613188bfbdf
Signed-off-by: Jack Wu <wjack@google.com>
2022-12-24 13:13:18 +00:00
Yifan Hong
67a8fd2175 GetBatteryInfo() also reads AIDL health HAL.
Test: call GetBatteryInfo manually with and without AIDL health HAL
Bug: 170338625
Bug: 177269435
Change-Id: I123739e5bc372d5198fd711f592ceac04d46ab28
2021-12-06 16:53:58 -08:00
Bob Badour
29be3f6ef1 [LSC] Add LOCAL_LICENSE_KINDS to bootable/recovery
Added SPDX-license-identifier-Apache-2.0 to:
  applypatch/Android.bp
  bootloader_message/Android.bp
  edify/Android.bp
  fuse_sideload/Android.bp
  install/Android.bp
  minadbd/Android.bp
  minui/Android.bp
  otautil/Android.bp
  recovery_ui/Android.bp
  recovery_utils/Android.bp
  tests/Android.bp
  tools/image_generator/Android.bp
  tools/recovery_l10n/Android.bp
  uncrypt/Android.bp
  update_verifier/Android.bp
  updater/Android.bp
  updater/Android.mk
  updater_sample/Android.bp
  updater_sample/tests/Android.bp

Added SPDX-license-identifier-Apache-2.0 SPDX-license-identifier-MIT
    SPDX-license-identifier-OFL
to:
  Android.bp
  Android.mk

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I3da761b525452838977297f773974000d4de7bd6
2021-02-14 10:37:20 -08:00
Baligh Uddin
0e313c1c2c Migrate system/core/adb to packages/modules/adb
BUG: 167963357
Test: TH
Merged-In: Ied3afa5d19d814155c5ecbe2363ba544f2ab96b7
Change-Id: Ied65135d7c635d1675af591ccc64c26632935161
2020-10-23 03:42:07 +00:00
Kelvin Zhang
d7ae5a020c Fix flaky tests by require root for minadbd_tests
minadbd tests require access to /dev/fuse, therefore needs to run as
root. This test has been flaky because root preparetor wasn't specified.

Bug: 165604640
Test: atest MinadbdServicesTest
Change-Id: I6ee1e2deede4352e28aad79c436ec5974e7d64f6
2020-08-24 14:36:01 -04:00
Josh Gao
d4a964f121 Track rename of adbd_system_binaries.
Bug: http://b/157709367
Test: treehugger
Change-Id: Ic205acc56a763c38ba689b2b895609b5e878d813
2020-06-01 18:58:57 -07:00
Josh Gao
5ee3eba34f minadbd: statically link libadbd.
Reduce the amount of wasted space on the recovery image by statically
linking all of the adb libraries into minadbd.

Bug: http://b/150317254
Test: booted aosp_walleye-eng into recovery
Change-Id: I5233b1a23c14f9d478bb77c25ebdbb0ce45bcc5a
2020-03-30 16:54:44 -07:00
Josh Gao
a91e456fd4 Use adbd_system_binaries to track adbd's dependencies.
required doesn't propagate from apexes, so we need a separate phony
target to track adbd's dependenecies.

Test: m
Change-Id: I13977d1376de63839bf182d2cfa56b5c6c63aba9
2019-10-23 14:33:51 -07:00
Tao Bao
b548bea778 minadbd: Return battery level via getprop.
`adb rescue getprop rescue.battery_level` returns the current battery
level.

Bug: 134560109
Test: Build and boot into rescue mode.
Test: `adb rescue getprop ro.build.fingerprint`
Test: `adb rescue getprop rescue.battery_level`
Test: `adb rescue getprop` to dump all the properties.
Test: Run recovery_unit_test.
Change-Id: I78a9e8ab9783ffc8532cb93e6a64fb2157c19bd5
2019-10-04 15:33:27 -07:00
Tao Bao
3305d48b0b minadbd: Export minadbd/types.h to libinstall.
Test: mmma bootable/recovery
Change-Id: I503e942b23cc51024aa752c1eb3db5455a44a9d1
2019-09-26 00:04:11 -07:00
Pete Bentley
189d424ced Link libcrypto dynamically for recovery unit tests.
Tested by running recovery_unit_test as described in
https://android.googlesource.com/platform/bootable/recovery/+/refs/heads/master/README.md

Attempted to build and boot a recovery image with the
same change to confirm it still works, but
m recoveryimage-nodeps
fails for me.

Bug: 140940227
Test: See above
Change-Id: I00545968a0e5684823e505f2ddbe7e993319b5d4
2019-09-13 12:18:44 +01:00
xunchang
311e6ca7b6 Implement FuseBlockDataProvider
Adds a fuse data provider that parses the metadata from a block map,
reads the data from the given ranges of the block device; and provides
the data to the fuse.

Bug: 127071893
Test: unit tests pass, install a package from block map
Change-Id: Ie9925ee9144e98642505b3f5e1a4a186d2b21ed0
2019-05-01 12:09:38 -07:00
xunchang
9c04eb46b7 Add test for minadbd
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
2019-04-23 11:33:57 -07:00
Tao Bao
ed717ca17d minadbd: Support rescue install and getprop commands.
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
2019-04-19 12:53:55 -07:00
xunchang
34690ced91 Add socket communication between recovery and minadbd
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
2019-04-11 14:23:53 -07:00
xunchang
ea2912f187 Create a FuseDataProvider base class
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
2019-03-19 11:11:58 -07:00
Tao Bao
5de19e2e02 minadbd: daemon_service_to_fd takes std::string_view.
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
2019-01-02 09:40:46 -08:00
Elliott Hughes
31b92a5d75 C++17 is the default now.
Test: builds
Change-Id: I91923da25f470621189589711c50f3d67e435c68
2018-12-03 09:27:17 -08:00
Josh Gao
9828dc14cb minadbd: track adb C++ version change.
adb is going to start using shiny new C++17 features like
std::optional in headers that minadbd includes.

Test: mma
Change-Id: I7eb100c48abbf2364d6ff5f30aa223480e2466a6
2018-11-13 14:19:04 -08:00
Christopher Ferris
272467d950 Move to new isolation test runner.
Test: Ran tests.
Change-Id: I5fa99f7b6b03c7b9247b4f340f3df982063b0e3e
2018-10-01 12:19:33 -07:00
Tao Bao
7d2a63afe1 Reland "Build and use minadbd as a shared library."
This relands the previously reverted CL in commit
c70446ce7b ("Build and use minadbd as a
shared library."). `recovery` has been built with Soong, so the previous
concern (unintentionally installing `libminadbd_services.so` to normal
system image) no longer holds.

Note that `reocvery` can't use `libminadbd_services.a`, as functions
like `daemon_service_to_fd()` (needed by `libadbd.so`) won't be linked
into `recovery`.

This CL moves the dependency of `libminadbd_services` from `librecovery`
into `recovery`, as only the latter actually relies on it (via
`recovery_main.cpp`). Note that we no longer need to list the transitive
dependency on `libadbd` or `libasyncio`.

Bug: 112494634
Test: `mmma -j bootable/recovery`
Test: Build and boot into recovery with aosp_taimen-userdebug. Verify that
      sideloading keeps working.
Test: `build/soong/build_test.bash --dist`
Change-Id: Ic086470b86d6770bede317e0f5534f608fa7b7d2
2018-08-13 14:09:58 -07:00
Tao Bao
5fc72a103b Build recovery with Soong.
Fixes: 110380063
Test: `mmma -j bootable/recovery` with aosp_taimen-userdebug
Test: Build and boot into recovery on taimen. Check the basic
      functionalities (`Apply update from ADB`, `View recovery logs`,
      `Run graphics test`).
Test: Run recovery_unit_test and recovery_component_test on marlin.
Test: Modify `recovery.cpp` locally to trigger the call to
      is_battery_ok(). Check that the battery info is reported
      correctly.
Test: `build/soong/build_test.bash --dist`
Change-Id: I391eb201d57c760e457ba2bf2410ceb72596795c
2018-08-10 14:43:27 -07:00
Tao Bao
c70446ce7b Revert "Build and use minadbd as a shared library."
This reverts commit 4fd4f89591.

The reverted CL has a side effect that unintentionally installs
a copy of libminadbd_services.so to the system image. This breaks the
check with `build/soong/build_test.bash --dist` which detects and
prevents vendor modules from installing files to the system image.

Prior to fully converting `recovery` to be built with Soong, we have to
statically link recovery-specific modules into `recovery`.

Bug: 110380063
Test: `m -j bootimage` with aosp_marlin-userdebug
Test: Run minadbd_test on marlin.
Test: Boot into recovery and verify that sideloading still works.
Test: `build/soong/build_test.bash --dist`
Change-Id: I290d55c82e17aa60a5afdf2ff7f896afc4dae8b3
2018-08-07 20:44:39 -07:00
Tao Bao
4fd4f89591 Build and use minadbd as a shared library.
The former `minadbd` module is now built as a shared library
(`libminadbd_services.so`) that serves sideloading under recovery, with
a dynamic dependency on `libadbd.so`.

This allows sharing and reusing libadbd code on device (both of `adbd`
and `recovery` now uses `libadbd.so`). As a result, it reduces the size
of `recovery` binary from 1407360-byte to (1272880 + 33032)-byte
(aosp_marlin-userdebug).

Bug: 78793464
Test: `m -j bootimage` with aosp_marlin-userdebug
Test: Run minadbd_test on marlin.
Test: Boot into recovery and verify that sideloading still works.
Change-Id: I6c2bc3d351d5af71220a9b9f956c8c039e52c781
2018-08-06 17:06:43 -07:00
Tao Bao
4b51c3ab40 Export fuse_sideload.h for libfusesideload.
Move the module into a separate directory so that we can export only the
expected header.

With this change, minadbd no longer needs to include bootable/recovery.

Test: mmma -j bootable/recovery
Change-Id: I69b888ceb160a33a67d79c5bda208dc17ad6ed86
2018-03-07 10:01:51 -08:00
Tao Bao
8c7761edec minadbd: Move to Soong.
Test: mmma -j bootable/recovery
Change-Id: Ic4cd676a842f0e8c4735cc6731fcbf13b844510c
2018-03-06 20:36:35 -08:00