Commit Graph

7710 Commits

Author SHA1 Message Date
Tao Bao a17d09b098 Merge "Add TEST_MAPPING." am: c6ebcaaad7 am: d8cecf4df9
am: 4507b9d0fb

Change-Id: I67b01596604d3e17d904fee48e7e894961b10f41
2019-04-24 19:14:30 -07:00
Tao Bao 4507b9d0fb Merge "Add TEST_MAPPING." am: c6ebcaaad7
am: d8cecf4df9

Change-Id: Ia7377f8c4baebc4175855465befca024d87243bf
2019-04-24 17:39:28 -07:00
Tao Bao d8cecf4df9 Merge "Add TEST_MAPPING."
am: c6ebcaaad7

Change-Id: Ib9d892cf4657a6b4cce9c15c6f25f5a89b4dbdef
2019-04-24 17:36:26 -07:00
Treehugger Robot c6ebcaaad7 Merge "Add TEST_MAPPING." 2019-04-25 00:18:44 +00:00
Tao Bao a14e860190 Add TEST_MAPPING.
Currently it triggers minadbd_test, recovery_unit_test and
recovery_component_test during presubmit.

Test: TreeHugger
Change-Id: Ie0e2ddc9519a7e9b66d059cdf0b81dcbba631c25
2019-04-24 14:03:52 -07:00
Tao Bao 1f17f8dd15 Merge "minadbd: Support adb reboot under sideload/rescue modes." am: cf1f715d62 am: 0d6f57a90f
am: 24eb4d1cdd

Change-Id: I2ac98d2b6bda7b68451e60222f73c44e94538268
2019-04-24 14:03:30 -07:00
Tao Bao 24eb4d1cdd Merge "minadbd: Support adb reboot under sideload/rescue modes." am: cf1f715d62
am: 0d6f57a90f

Change-Id: I4be98a85565ada3f1e97f038ff116174d7f03559
2019-04-24 13:56:24 -07:00
Tao Bao 0d6f57a90f Merge "minadbd: Support adb reboot under sideload/rescue modes."
am: cf1f715d62

Change-Id: Ie0037cbef2daa1e47f169ff353ca3ac4fd24c164
2019-04-24 13:52:22 -07:00
Tao Bao cf1f715d62 Merge "minadbd: Support adb reboot under sideload/rescue modes." 2019-04-24 20:33:18 +00:00
Tao Bao 10f441a9db minadbd: Support adb reboot under sideload/rescue modes.
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
2019-04-23 23:50:12 -07:00
Tianjie Xu e529ea49ee Merge "Add test for minadbd" am: c92f412b8d am: b63e6963ec
am: ba4f02398f

Change-Id: I12ec9c785ff99435c021ab8ead89964e843bcb3f
2019-04-23 17:23:24 -07:00
Tianjie Xu ba4f02398f Merge "Add test for minadbd" am: c92f412b8d
am: b63e6963ec

Change-Id: I8a1e67369687b2382d822d174570413e143b6bbc
2019-04-23 15:51:19 -07:00
Tianjie Xu b63e6963ec Merge "Add test for minadbd"
am: c92f412b8d

Change-Id: Ie742f6993faa062737ee41cd308a3d249023af97
2019-04-23 15:43:54 -07:00
Tianjie Xu c92f412b8d Merge "Add test for minadbd" 2019-04-23 22:26:54 +00:00
Tianjie Xu 8445949f2f Merge changes Ibdb7dd0b,Iafd3e846 am: 72e6e55e34 am: 05e295b755
am: 3e165c8607

Change-Id: I7cdbb3ac460028e1b9bc94cdd1c9677d5291f20a
2019-04-23 11:37:17 -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
Tianjie Xu 3e165c8607 Merge changes Ibdb7dd0b,Iafd3e846 am: 72e6e55e34
am: 05e295b755

Change-Id: Ie71d74670d017e275329dd5e3b59ca45e9c6524a
2019-04-23 11:26:08 -07:00
Tianjie Xu 05e295b755 Merge changes Ibdb7dd0b,Iafd3e846
am: 72e6e55e34

Change-Id: I2cf9f6e8c489b6c48056687d0405ba3585df5b9a
2019-04-23 11:04:48 -07:00
Tianjie Xu 72e6e55e34 Merge changes Ibdb7dd0b,Iafd3e846
* changes:
  matches_locale no longer accept empty locales in the png file
  Fall back to en-US if localized bitmap is missing for a locale
2019-04-23 17:31:23 +00:00
Tao Bao 387dbeb25e Merge "minadbd: Support rescue install and getprop commands." am: f365574a60 am: 8c7085878c
am: 2050b0efb9

Change-Id: I33c64d87acf07462679dfafa4f4d8a2f6a57768a
2019-04-22 16:41:14 -07:00
Tao Bao 2050b0efb9 Merge "minadbd: Support rescue install and getprop commands." am: f365574a60
am: 8c7085878c

Change-Id: Ie21b5177cccdc2e65d7ceedac89b8402a44ced27
2019-04-22 15:45:47 -07:00
xunchang 34723087fe matches_locale no longer accept empty locales in the png file
The legacy png files have an empty line in the end. And the recovery
used to match any missing locale, e.g. "he" with that line and gets an
empty image.

Since the empty image is barely useful, we should just error out and
fall back to the default locale.

This reversed the unit test check added in d17a688525

Bug: 128934634
Test: run locale test with "he" and legacy images, recovery reports
error and doesn't crash even without default locale fall back

Change-Id: Ibdb7dd0b42348de5e392c834cce67ff02be85c24
2019-04-22 15:32:17 -07:00
Tao Bao 8c7085878c Merge "minadbd: Support rescue install and getprop commands."
am: f365574a60

Change-Id: I380d0ae30f1ea9e03bfdb880be1107acd2fb28d8
2019-04-22 15:23:45 -07:00
Tao Bao f365574a60 Merge "minadbd: Support rescue install and getprop commands." 2019-04-22 22:08:52 +00:00
xunchang 9d05c8a357 Fall back to en-US if localized bitmap is missing for a locale
We used to show the image for the last locale or an empty image, if
the localized image is missing for a specific locale. As the default
english one is more meaningful to users, we should just error out and
fall back to use the default locale when the image loading fails.

Bug: 128934634
Test: run graphic test, locale test
Change-Id: Iafd3e8466aec63b4952d1959b2a3d37e358677d4
2019-04-22 14:39:51 -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
Tao Bao fcdf5e2723 Merge "Allow entering rescue mode via recovery UI." am: b951138ebe am: bca2ceb7a7
am: df739f4835

Change-Id: I215d5fe9d84f5f8a1ac9681ceaa4d19de91ad1d5
2019-04-18 15:37:27 -07:00
Tao Bao df739f4835 Merge "Allow entering rescue mode via recovery UI." am: b951138ebe
am: bca2ceb7a7

Change-Id: I0551d7fa0cfd8fa7c8d1ce6e4447e99a584e4c1e
2019-04-18 15:10:24 -07:00
Tao Bao bca2ceb7a7 Merge "Allow entering rescue mode via recovery UI."
am: b951138ebe

Change-Id: I76b5e4de39d45622bb3c644145fd2cbb9a04bd0f
2019-04-18 15:05:29 -07:00
Tao Bao b951138ebe Merge "Allow entering rescue mode via recovery UI." 2019-04-18 21:45:50 +00:00
Bill Yi e5606628b6 [automerger skipped] Import translations. DO NOT MERGE am: d0052c30ce -s ours
am: ca44dc4aa4 -s ours
am skip reason: subject contains skip directive

Change-Id: I9f54cfffc23c2e9bf83bd351a317f81230c3f222
2019-04-17 19:46:55 -07:00
Bill Yi ca44dc4aa4 [automerger skipped] Import translations. DO NOT MERGE
am: d0052c30ce -s ours
am skip reason: subject contains skip directive

Change-Id: I6f80b1be7b7f0ab1046b1d65e1110de4a093cc83
2019-04-17 15:19:22 -07:00
Tao Bao c6dc325e88 Allow entering rescue mode via recovery UI.
Only enabled on debuggable builds.

Bug: 128415917
Test: Sideload package on taimen.
Test: Choose "Enter rescue" from recovery UI.
Change-Id: I913dbdbcffd3179e6fa72ca862f74ca8f1364b02
2019-04-17 14:07:23 -07:00
xunchang ddd4e528ec [automerger skipped] DO NOT MERGE: Move load & restore logs to logging.cpp am: cd780b456f
am: 46ecbc897c -s ours
am skip reason: subject contains skip directive

Change-Id: I295d56f67eb90e5cc85641560399bfeb3e51bbd5
2019-04-16 23:40:21 -07:00
xunchang b1c9278c1c [automerger skipped] DO NOT MERGE: Move wipe cache|data to libinstall am: 388d253b9c -s ours
am: fde9a21127 -s ours
am skip reason: subject contains skip directive

Change-Id: I75e4d17a119f2dc9927b1dac945880e42248663b
2019-04-16 23:40:16 -07:00
xunchang aed1428737 [automerger skipped] DO NOT MERGE: Add socket communication between recovery and minadbd am: 95d67323a4 -s ours
am: 06e006ca60 -s ours
am skip reason: subject contains skip directive

Change-Id: I284e5df434448b9484ff15dd474f73418a6d0287
2019-04-16 23:40:10 -07:00
Tao Bao e8a7f8a430 [automerger skipped] DO NOT MERGE: Build libinstall as a static library. am: 2f8afba707 -s ours
am: b937028417 -s ours
am skip reason: subject contains skip directive

Change-Id: I5423f195ae2d0af2cb9f9ce06936cc1d764db6e3
2019-04-16 23:40:04 -07:00
xunchang 46ecbc897c DO NOT MERGE: Move load & restore logs to logging.cpp
am: cd780b456f

Change-Id: Ieade28272c726cf7e81da7cc633fe40489db17d4
2019-04-16 22:06:39 -07:00
xunchang fde9a21127 [automerger skipped] DO NOT MERGE: Move wipe cache|data to libinstall
am: 388d253b9c -s ours
am skip reason: SHA1 388d253b9c skipped by user xunchang

Change-Id: I6d2b097e941a5e0c45c420a33d0a733bb384184e
2019-04-16 22:06:32 -07:00
xunchang 06e006ca60 [automerger skipped] DO NOT MERGE: Add socket communication between recovery and minadbd
am: 95d67323a4 -s ours
am skip reason: SHA1 95d67323a4 skipped by user xunchang

Change-Id: I8e5c027a88b224523728a37f1b8b68a1b1490421
2019-04-16 22:06:24 -07:00
Tao Bao b937028417 [automerger skipped] DO NOT MERGE: Build libinstall as a static library.
am: 2f8afba707 -s ours
am skip reason: SHA1 2f8afba707 skipped by user xunchang

Change-Id: Id6835cbd7845acdb91a8bb7b0888a003b01c48a3
2019-04-16 22:06:17 -07:00
Bill Yi d0052c30ce Import translations. DO NOT MERGE
Auto-generated-cl: translation import

Bug: 64712476
Change-Id: Ie58e59d8d2731350f58bc9733e4599f75a3aca61
2019-04-16 19:59:20 -07:00
Tianjie Xu 883426085c Merge "Move load & restore logs to logging.cpp" am: 3aff98aee8 am: c3a273b33a
am: f980ad94ef

Change-Id: Ib9dc6cca578c1c045c4eaa7f3f4e42527e1d5c2b
2019-04-16 12:42:11 -07:00
Tao Bao 0549efe3c1 Merge "Remove the FD parameter from FuseDataProvider ctor." am: bb0c6e1fe7 am: 510daac2cc
am: 265ff4fffd

Change-Id: I8e7851aafbd45d440874fb0756f97347194bfb6a
2019-04-16 12:26:59 -07:00
xunchang cd780b456f DO NOT MERGE: Move load & restore logs to logging.cpp
We perform these steps to perserve the recovery logs when wiping
/cache partition. Move them to logging.cpp to keep the actually
EraseVolume function concise.

Bug: 130166585
Test: unit tests pass, mount cache and check last log after cache
Change-Id: Idc52833817a446f3a0148a3dd2112f911c9ef48d
(cherry picked from commit 2239b9e4dd)
2019-04-16 19:26:44 +00:00
xunchang 388d253b9c DO NOT MERGE: Move wipe cache|data to libinstall
Therefore, libinstall becomes the sole owner to handle the request
from minadbd service.

The change also includes
1. move logging.cpp out of librecovery
2. drop the dependency on common.h
3. now it's more sensible to move the wipe_cache as part of
install_package. move the wipe_cache to the end of the function.

Bug: 130166585
Test: wipe data and cache from menu
Change-Id: I6f356dccdb38015c50acf756bac246f87c30fc1f
(cherry picked from commit 316e971746)
2019-04-16 19:26:31 +00:00
xunchang 95d67323a4 DO NOT MERGE: 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
(cherry picked from commit 34690ced91)
2019-04-16 19:26:20 +00:00
Tao Bao 2f8afba707 DO NOT MERGE: Build libinstall as a static library.
It was once considered to be shared between recovery and minadbd, so
that the latter can start an install on its own. The plan has been
changed, since package install -- including device wipe operations --
could be device-specific, which should be done by recovery only.

This CL moves libinstall back to a static library, which also saves the
overall size (reducing from 140256 + 660576 to 555880 bytes on
aosp_taimen-userdebug).

Bug: 130166585
Test: Run recovery_component_test.
Test: `adb sideload` on taimen.
Change-Id: Ib1f5f79f235df4682c0bd104425c9c122f6091ba
2019-04-16 19:25:23 +00:00
Tianjie Xu f980ad94ef Merge "Move load & restore logs to logging.cpp" am: 3aff98aee8
am: c3a273b33a

Change-Id: Iea229ce291f97333e1b47cc050731783ffc1e47f
2019-04-16 11:23:54 -07:00
Tianjie Xu c3a273b33a Merge "Move load & restore logs to logging.cpp"
am: 3aff98aee8

Change-Id: I7da098091879ca823be31bd12b60dc12d5c45145
2019-04-16 11:07:47 -07:00