Commit Graph

4945 Commits

Author SHA1 Message Date
Tao Bao d92baf5988 Merge "wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_."
am: e9605b8ca0

Change-Id: I4f2ee4b8f545151b76dc47791394e91959243bdf
2017-08-28 19:52:21 +00:00
Tao Bao f351a576ce Merge "wear_ui: Remove dead 'self' and 'progress_t'."
am: 2e125bec2f

Change-Id: Ied701c23bacf63048adce28b18cd6847f8134097
2017-08-28 19:52:06 +00:00
Tao Bao e9605b8ca0 Merge "wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_." 2017-08-28 19:42:12 +00:00
Tao Bao 2e125bec2f Merge "wear_ui: Remove dead 'self' and 'progress_t'." 2017-08-28 19:41:54 +00:00
Tao Bao 1e27d14eea wear_ui: Remove kMaxCols/kMaxRows/visible_text_rows/menu_headers_.
We've deprecated kMaxCols/kMaxRows in ScreenRecoveryUI since commit
aa0d6afb61. They unnecessarily limit the
screen size to 96x96 characters.

Also remove the recomputations of text_cols, visible_text_rows (which is
the same as text_rows_). Remove the unintentional hiding of menu_headers_.

Test: mmma bootable/recovery
Change-Id: I7d1526b651943312d62d52cd200414b42bf9b12a
2017-08-26 08:47:43 -07:00
Tao Bao cff8269e5c wear_ui: Remove dead 'self' and 'progress_t'.
They were once used for progress_thread() that's pthread_create'd by
WearRecoveryUI::Init(). They have become dead since the removal of
progress_thread() (commit ad8b5a6c11).

Also add the missing include of <pthread.h> for pthread_mutex_lock().

Test: lunch a watch target and `m recoveryimage`.
Change-Id: I748cf4511434ac4ce97dddf89b0e42e68a5da04b
2017-08-26 08:17:36 -07:00
Tianjie Xu 736be2f93e Merge "Add missing report of error code under recovery"
am: 571855b0e6

Change-Id: Ib425356561060c20e0f9643e2f5b302f5c9dd161
2017-08-24 22:25:10 +00:00
Tianjie Xu 571855b0e6 Merge "Add missing report of error code under recovery" 2017-08-24 22:10:25 +00:00
Tianjie Xu 3fec8c6419 Add missing report of error code under recovery
Add report of kMapFileFailure, kForkUpdateBinaryFailure and
kUpdateBinaryCommandFailure.

Test: unit test pass; kMapFileFailure reports correctly.
Change-Id: I858c81b6c750b5e300b1b12760b1f0fa8e23b47d
2017-08-23 00:18:07 -07:00
Tianjie Xu 7379a5290d Merge "Allow comparison against multi serial nums for A/B package" am: 3810046a55 am: e8b02d68e5
am: 968ebdeefd

Change-Id: I21de76c870001cb5faf145d5f39f8fb2cfa58a66
2017-08-22 23:23:07 +00:00
Tianjie Xu 968ebdeefd Merge "Allow comparison against multi serial nums for A/B package" am: 3810046a55
am: e8b02d68e5

Change-Id: Id75270416e1058776b7ed27a4a2d926895f9bf0e
2017-08-22 23:09:57 +00:00
Tianjie Xu e8b02d68e5 Merge "Allow comparison against multi serial nums for A/B package"
am: 3810046a55

Change-Id: Ic9e431b0d31c61484b04ce4f491a584b3eeba09c
2017-08-22 23:00:01 +00:00
Tianjie Xu 3810046a55 Merge "Allow comparison against multi serial nums for A/B package" 2017-08-22 22:40:47 +00:00
Tianjie Xu 69b9649e9b Allow comparison against multi serial nums for A/B package
The metadata file now can have multiple serial numbers in the format:
serialno=serialno1|serialno2|serialno3 ...
Verifier will pass the check if the device serial number matches any of
these numbers.

Bug: 64802465
Test: Create a metadata file with 1000 numbers and sideload in sailfish.
      The checker detects both match and mismatch cases.

Change-Id: I3f12b75e15f4179df260778e37f4563d65db0fa8
2017-08-22 12:05:52 -07:00
Tao Bao 0d0b6a0d2a Merge changes I5d7a6baa,Id0fb2d4e am: 89ad02206a am: cead180a2b
am: cdc6fcaa47

Change-Id: I50f470bc0f772a372a7e36f8726aa5a91b653939
2017-08-22 18:40:35 +00:00
Tao Bao cdc6fcaa47 Merge changes I5d7a6baa,Id0fb2d4e am: 89ad02206a
am: cead180a2b

Change-Id: Iebb98c53e659eae15a2092610ebcd1b57a939c96
2017-08-22 18:38:02 +00:00
Tao Bao cead180a2b Merge changes I5d7a6baa,Id0fb2d4e
am: 89ad02206a

Change-Id: If9a85999d04902e68a3c807d05f3796ac273d3d1
2017-08-22 18:30:56 +00:00
Tao Bao 89ad02206a Merge changes I5d7a6baa,Id0fb2d4e
* changes:
  wear_ui: Expose menu_unusable_rows via Makefile var.
  Allow customizing WearRecoveryUI via Makefile variables.
2017-08-22 17:44:16 +00:00
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
Tao Bao eea3af3f91 wear_ui: Expose menu_unusable_rows via Makefile var.
This variable is useful on small screens (e.g. on watches) to handle
long menus. We should have better way to handle this value smartly.
Prior to that, expose the value to be overridable by using the generic
wearable UI module (librecovery_ui_wear).

Bug: 64307776
Test: Define the variable, build and boot into recovery image and check
      the UI menu.
Change-Id: I5d7a6baa8bb4cc852bfcc2a7b3cc9686c1c8817e
2017-08-11 13:53:58 -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 0470ceea38 Allow customizing WearRecoveryUI via Makefile variables.
With the following Makefile variables, we can reduce the work of writing
(copy/pasting) device-specific WearRecoveryUI classes.

The list of Makefile variables (the ones useful for Wear devices):
- TARGET_RECOVERY_UI_MARGIN_HEIGHT (default: 0)
- TARGET_RECOVERY_UI_MARGIN_WIDTH (default: 0)
  Specify the margin space that we don't want to display texts. They
  replace the former outer_width and outer_height.

- TARGET_RECOVERY_UI_TOUCH_LOW_THRESHOLD (default: 50)
- TARGET_RECOVERY_UI_TOUCH_HIGH_THRESHOLD (default: 90)
  Specify the sensitivity of recognizing a swipe. Devices give absolute
  positions, so for some devices we need to adjust the thresholds.

- TARGET_RECOVERY_UI_PROGRESS_BAR_BASELINE
  Specify the progress bar vertical position, which should be adjusted
  to the actual height of a device. It replaces the former
  progress_bar_y.

- TARGET_RECOVERY_UI_ANIMATION_FPS (default: 30)
  Specify the animation FPS if using device-specific animation images.
  It replaces the former animation_fps.

Devices can specify "TARGET_RECOVERY_UI_LIB := librecovery_ui_wear",
with optionally defined Makefile vars above, in BoardConfig.mk to
customize their WearRecoveryUI.

Also remove the obsolete wear_touch.{cpp,h}, which has been merged into
ui.cpp in commit 5f8dd9951d.

Bug: 64307776
Test: Change the device BoardConfig.mk and test recovery image.
Change-Id: Id0fb2d4e3977ab5ddd31e71f9535470cab70e41b
2017-08-10 09:31:17 -07: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