Commit Graph

4925 Commits

Author SHA1 Message Date
Tianjie Xu
fc569d1516 Merge "Move Image/ImageChunk/PatchChunk declaration into header files" am: b4bc57ed39 am: b127fddf09
am: f5e3cadeca

Change-Id: Ic9056467184e272eec5c0aead3d4a712033b0503
2017-08-19 04:34:03 +00:00
Tianjie Xu
f5e3cadeca Merge "Move Image/ImageChunk/PatchChunk declaration into header files" am: b4bc57ed39
am: b127fddf09

Change-Id: Ia1eb8977d076c5ee5557d850afaad5e4a689bc63
2017-08-19 04:30:33 +00:00
Tianjie Xu
b127fddf09 Merge "Move Image/ImageChunk/PatchChunk declaration into header files"
am: b4bc57ed39

Change-Id: If254ed9e24bc0cafa19db9766ed36643ca0fed49
2017-08-19 04:27:34 +00:00
Tianjie Xu
b4bc57ed39 Merge "Move Image/ImageChunk/PatchChunk declaration into header files" 2017-08-19 04:21:05 +00:00
Tianjie Xu
57dd961995 Move Image/ImageChunk/PatchChunk declaration into header files
1. Move the declaration of the Image classes to the header file to make
testing easier.
2. Also move rangeset.h to bootable/recovery to allow access in imgdiff.

Test: recovery component test
Change-Id: I68a863e60a3f2e7ae46ee48f48eb15391f5f4330
2017-08-18 17:56:22 -07:00
Tianjie Xu
14b3f5e5cc Merge "update_verifier now logs to kmesg" am: f7ad94313d am: 473606847a
am: 8c9c22a3a9

Change-Id: I2e9d3883edb4de803924ff127cf876cc1f6dd485
2017-08-17 19:26:35 +00:00
Tianjie Xu
8c9c22a3a9 Merge "update_verifier now logs to kmesg" am: f7ad94313d
am: 473606847a

Change-Id: I90f254955823bc815d96bf94ae1b2f37c2b0a44a
2017-08-17 19:22:59 +00:00
Tianjie Xu
473606847a Merge "update_verifier now logs to kmesg"
am: f7ad94313d

Change-Id: I24438ea3f7975608358cf676606dc54b98e7092a
2017-08-17 19:19:32 +00:00
Tianjie Xu
f7ad94313d Merge "update_verifier now logs to kmesg" 2017-08-17 19:16:11 +00:00
Tao Bao
7f7d9b2f37 Merge "screen_ui: Fix a case that may truncate the last char." am: 2e99c38cfd am: 151126360e
am: 228a2f2a37

Change-Id: I5c672cbf0171be019f7240135f9cf6d26e68de9f
2017-08-17 00:48:48 +00:00
Tao Bao
228a2f2a37 Merge "screen_ui: Fix a case that may truncate the last char." am: 2e99c38cfd
am: 151126360e

Change-Id: Id7117e58e1353ce3e9929908a4de0e8f6f8fe1d2
2017-08-17 00:44:08 +00:00
Tao Bao
151126360e Merge "screen_ui: Fix a case that may truncate the last char."
am: 2e99c38cfd

Change-Id: I948a78eb97fbc098610d3410f126843e360e5f65
2017-08-17 00:42:39 +00:00
Tao Bao
2e99c38cfd Merge "screen_ui: Fix a case that may truncate the last char." 2017-08-17 00:16:04 +00:00
Tao Bao
13aa4a902b screen_ui: Fix a case that may truncate the last char.
ScreenRecoveryUI::DrawWrappedTextLines() should be called with
kMarginWidth only. Because it's using a line limit of text_cols_,
which is unaware of kMenuIdent.

Bug: 64293520
Test: No missing char with long header text.
Change-Id: Ib4d08de2c56473a483ff9964eb6cec31f8a74c9a
2017-08-16 13:38:17 -07:00
Tao Bao
f1397b597a Merge "screen_ui: Word-wrap menu headers." am: 162b92323b am: 623bac4ed9
am: ae0af37111

Change-Id: Ibb4a439d7a864e8fc44b06cad66a07f18f3376f7
2017-08-16 05:13:56 +00:00
Tao Bao
ae0af37111 Merge "screen_ui: Word-wrap menu headers." am: 162b92323b
am: 623bac4ed9

Change-Id: If8d200cd487aed9ee5eedbe831e1436e4c3551da
2017-08-16 05:10:55 +00:00
Tao Bao
623bac4ed9 Merge "screen_ui: Word-wrap menu headers."
am: 162b92323b

Change-Id: I93c959422c5b56a15875580159ecfc1a1d44087d
2017-08-16 05:07:55 +00:00
Tao Bao
162b92323b Merge "screen_ui: Word-wrap menu headers." 2017-08-16 05:02:05 +00:00
Tao Bao
2bbc6d642d screen_ui: Word-wrap menu headers.
This CL adds ScreenRecoveryUI::DrawWrappedTextLines() to better handle
long menu header texts. It does a word wrap at spaces, if available.
This avoids fixed-length menu headers being truncated on small screens.

Bug: 64293520
Test: On bullhead, boot into recovery with --prompt_and_wipe_data, and
      check the prompt texts.
Change-Id: Ia22746583516dd230567a267584aca558429395e
2017-08-15 15:10:21 -07:00
Tianjie Xu
a009ce05e2 update_verifier now logs to kmesg
Set up update_verifier logging to be written to kmsg; because we may
not have Logd during boot time.

Bug: 64713327
Test: logs show up in `adb shell dmesg`
Change-Id: If02f460bda121cd3e9062bc0e08107c6da66492c
2017-08-15 18:57:17 +00:00
Tianjie Xu
bfd3123a6a Merge "Add a new PatchChunk class in imgdiff" am: 11214d9062 am: 5bde1d9ef8
am: 96b490acec

Change-Id: I9656f313d5d3746ac9c9ecd98311b88d8754b3e1
2017-08-14 17:34:57 +00:00
Tianjie Xu
96b490acec Merge "Add a new PatchChunk class in imgdiff" am: 11214d9062
am: 5bde1d9ef8

Change-Id: Iccd45b9c2673237a0e8775d9527eb35f0aa2b869
2017-08-14 17:31:26 +00:00
Tianjie Xu
5bde1d9ef8 Merge "Add a new PatchChunk class in imgdiff"
am: 11214d9062

Change-Id: Ic2d4b218b36ace3dd1d49be1d17adeaf2d37b108
2017-08-14 17:26:56 +00:00
Tianjie Xu
11214d9062 Merge "Add a new PatchChunk class in imgdiff" 2017-08-14 17:21:16 +00:00
Tianjie Xu
d82a2ed50b Add a new PatchChunk class in imgdiff
This way we can keep the input images const when calling
genetatepatches().

Test: recovery component test; diff and patch on chrome.apk; generate
recovery-from-boot.p for angler.
Change-Id: I65b5689b88f6719c6ede46bb82def0c4caeb8a61
2017-08-12 22:07:43 -07:00
David Zeuthen
db9ec51c39 update_verifier: Support androidboot.veritymode being empty or 'disabled'.
am: 3222dc0d76

Change-Id: I31ce6bf1e82269a45e3d49bda961359f7dd8bab9
2017-08-10 21:00:09 +00:00
Tao Bao
37b9d108a9 Merge "update_verifier: verify blocks in parallel" am: 0459799ea8 am: 1fa82a2af4
am: 5156e24ccf

Change-Id: I84945b9ef0d8ae985e5200c2e5dec95ce4da2b9d
2017-08-10 16:37:22 +00:00
Tao Bao
5156e24ccf Merge "update_verifier: verify blocks in parallel" am: 0459799ea8
am: 1fa82a2af4

Change-Id: Ieeabe5fc76d25a4c22164c0e61d3a93b046cd8c7
2017-08-10 16:33:23 +00:00
Tao Bao
1fa82a2af4 Merge "update_verifier: verify blocks in parallel"
am: 0459799ea8

Change-Id: Ic8ce7a45de3a7501f7e1f758c7ddf56ff5d919e3
2017-08-10 16:30:03 +00:00
Tao Bao
0459799ea8 Merge "update_verifier: verify blocks in parallel" 2017-08-10 16:24:38 +00:00
Tao Bao
6f1c38c9ad Merge "tests: Add the missing dependency on libhidlbase." am: 05b2e982ad am: 43df6cfeee
am: 46c13f3f05

Change-Id: Iaa1bd4f403664a87153b9f6b647e04bc7798a33d
2017-08-10 06:10:14 +00:00
Tao Bao
46c13f3f05 Merge "tests: Add the missing dependency on libhidlbase." am: 05b2e982ad
am: 43df6cfeee

Change-Id: I1b6aec75eda5a289cc3cd6a72029d90d9ba4c433
2017-08-10 06:06:43 +00:00
Tao Bao
43df6cfeee Merge "tests: Add the missing dependency on libhidlbase."
am: 05b2e982ad

Change-Id: Ie08dca777af1d12a304aebf11f4df25680ff939a
2017-08-10 06:03:45 +00:00
Wei Wang
5226f4715d update_verifier: verify blocks in parallel
This CL is to change update_verifier to verify blocks in parallel to
maximize storage bandwidth, it also preallocate the buffer to avoid
vector allocation within reading loop.

Test:
care_map.txt:
system
16,0,517,556,32770,33084,98306,98620,163842,164156,229378,229692,294914,295228,483544,524288,524296
vendor
8,0,119,135,32770,32831,96150,98304,98306

With CL:
init: Service 'update_verifier_nonencrypted' (pid 711) exited with status 0 waiting took 2.978424 seconds

Without CL:
init: Service 'update_verifier_nonencrypted' (pid 695) exited with status 0 waiting took 4.466320 seconds

Bug: 63686531
Test: reboot with manual insert care_map.txt
Change-Id: Idf791865f15f6ff6cad89bf7ff230ee46c6adccc
(cherry picked from commit bd9664b5a0)
2017-08-09 22:59:16 -07:00
Tao Bao
05b2e982ad Merge "tests: Add the missing dependency on libhidlbase." 2017-08-10 05:58:49 +00:00
Tao Bao
3e2345e1fe tests: Add the missing dependency on libhidlbase.
It fails to build recovery_component_test with the following errors:

out/soong/.intermediates/hardware/interfaces/boot/1.0/android.hardware.boot@1.0_genc++_headers/gen/android/hardware/boot/1.0/types.h:14:
error: undefined reference to 'android::hardware::hidl_string::hidl_string(android::hardware::hidl_string const&)'
out/soong/.intermediates/hardware/interfaces/boot/1.0/android.hardware.boot@1.0_genc++_headers/gen/android/hardware/boot/1.0/types.h:14:
error: undefined reference to 'android::hardware::hidl_string::operator=(android::hardware::hidl_string
const&)'
out/soong/.intermediates/hardware/interfaces/boot/1.0/android.hardware.boot@1.0_genc++_headers/gen/android/hardware/boot/1.0/types.h:14:
error: undefined reference to 'android::hardware::hidl_string::~hidl_string()'

libupdate_verifier includes <android/hardware/boot/1.0/IBootControl.h>,
which includes the 'types.h' above. In 'types.h', it defines struct
CommandResult that's using android::hardware::hidl_string.

Since libhidlbase doesn't have a static library target, remove
'LOCAL_FORCE_STATIC_EXECUTABLE := true', which isn't required for
running tests.

Test: mmma -j bootable/recovery
Bug: 64538692
Change-Id: Iaa7c08adc241128d787274fcaea9b363e7ff93f4
(cherry picked from commit 102016ce1f)
2017-08-09 22:57:13 -07:00
David Zeuthen
3222dc0d76 update_verifier: Support androidboot.veritymode being empty or 'disabled'.
Bootloaders using libavb will set androidboot.veritymode=disabled if
the "disable dm-verity" flag has been set. Additionally if the
"disable verification" flag is set androidboot.veritymode will not be
set at all. Handle both cases.

Without this fix we'll end up in a bootloop.

Test: Manually tested on a device using AVB.
(cherry-picked from commit 1a0929cc8a)
Bug: 64404283
Change-Id: I3adf93f8dfd528fe9b869a63afa775f5730a3f69
2017-08-09 14:23:20 -04:00
David Zeuthen
ade231287b Merge "update_verifier: Support androidboot.veritymode being empty or 'disabled'." am: 399ce66534 am: bb8d04cd3c
am: f2a8eba23c

Change-Id: I22c644eb6bd995fecfd8ddcf9006386eb524dee9
2017-08-08 19:12:05 +00:00
David Zeuthen
f2a8eba23c Merge "update_verifier: Support androidboot.veritymode being empty or 'disabled'." am: 399ce66534
am: bb8d04cd3c

Change-Id: I279d1398c83b4cd97525f56dc035c1719eb6f446
2017-08-08 19:08:35 +00:00
David Zeuthen
bb8d04cd3c Merge "update_verifier: Support androidboot.veritymode being empty or 'disabled'."
am: 399ce66534

Change-Id: I6d2f6f15f9dc56963cd5c7750e67dbad0ee40994
2017-08-08 19:05:04 +00:00
Treehugger Robot
399ce66534 Merge "update_verifier: Support androidboot.veritymode being empty or 'disabled'." 2017-08-08 18:57:32 +00:00
David Zeuthen
1a0929cc8a update_verifier: Support androidboot.veritymode being empty or 'disabled'.
Bootloaders using libavb will set androidboot.veritymode=disabled if
the "disable dm-verity" flag has been set. Additionally if the
"disable verification" flag is set androidboot.veritymode will not be
set at all. Handle both cases.

Without this fix we'll end up in a bootloop.

Test: Manually tested on a device using AVB.
Bug: 64315394
Change-Id: I8310849e347248f4a96158838310f688ecef4211
2017-08-08 12:48:43 -04:00
Tao Bao
99f78994cb Merge "ui: Check for bootreason=recovery_ui." am: f49cc02e86 am: 7c0b8a4322
am: 7f5b514411

Change-Id: I63473a830b0736da5e4f16febf0ee826d870ab40
2017-08-03 22:10:26 +00:00
Tao Bao
7f5b514411 Merge "ui: Check for bootreason=recovery_ui." am: f49cc02e86
am: 7c0b8a4322

Change-Id: I47386ad9e8c1dabaaa981f77d84abb8cf24557d6
2017-08-03 22:05:27 +00:00
Tao Bao
7c0b8a4322 Merge "ui: Check for bootreason=recovery_ui."
am: f49cc02e86

Change-Id: I75d4f38e9842b24e01027523fa765feca8c8cc25
2017-08-03 21:59:51 +00:00
Tao Bao
f49cc02e86 Merge "ui: Check for bootreason=recovery_ui." 2017-08-03 21:49:24 +00:00
Tao Bao
046aae29d9 ui: Check for bootreason=recovery_ui.
Some wear bootloaders are passing bootreason=recovery_ui when booting
into recovery from fastboot, or via 'adb reboot recovery'. Allow turning
on text mode with a swipe for such a bootreason. Since we will turn on
text mode automatically for debuggable builds, this bootreason mainly
handles the case for user builds.

Note this change only applies to devices that allow touch screen inputs.

Bug: 36169090
Test: Build and boot into user build recovery image. Toggle on text mode
      with a swipe.
Change-Id: I55f19aed7b210352f8370de19935b4772cc12095
2017-08-03 11:37:37 -07:00
Tao Bao
30886cb817 Merge "ui: Move the support for touch inputs into RecoveryUI." am: faa5b1f773 am: 5daa000068
am: 14d829b02c

Change-Id: Icc07c0788a2d0fdcdb09957c7e80d2c208374e41
2017-08-03 18:35:40 +00:00
Tianjie Xu
12cd28fb9c Merge "Refactor the imgdiff" am: f411f3dcfb am: 6c1a6c389b
am: e500bc3e15

Change-Id: Ibee36f11ef600685881bb2f652216196f323ed8d
2017-08-03 18:35:23 +00:00
Tao Bao
14d829b02c Merge "ui: Move the support for touch inputs into RecoveryUI." am: faa5b1f773
am: 5daa000068

Change-Id: I5cec1eef0e5f0e648e630117b6332e1a4059f4f2
2017-08-03 18:29:38 +00:00