Commit Graph

6875 Commits

Author SHA1 Message Date
Yifan Hong 6e232ed3ce Move parts of roots.cpp to libfs_mgr
am: 0f339e27bb

Change-Id: I8e933cf6fb5361735d51a387102417c2885ee816
2018-12-19 14:27:21 -08:00
Yifan Hong 0f339e27bb Move parts of roots.cpp to libfs_mgr
Move some mounting functionalities to libfs_mgr.

Test: run recovery tests

Bug: 118634720
Bug: 113182233

Change-Id: Ie59376664a744992429f0262ec96d13a1aed30f9
2018-12-18 15:57:29 -08:00
Zhomart Mukhamejanov e84953e9aa Merge "Add verification before downloading whole package"
am: 2e7393dbde

Change-Id: Ib85a3b957d0350122fa7f004f8f7e66667cde742
2018-12-17 22:31:24 -08:00
Zhomart Mukhamejanov 2e7393dbde Merge "Add verification before downloading whole package" 2018-12-18 06:19:59 +00:00
Zhomart Mukhamejanov 1811a6b734 Merge "Add PrepareUpdateService."
am: 2e33cbeb20

Change-Id: I5f62286c5454ab5e44d73e99daad3345c1841024
2018-12-17 14:29:31 -08:00
Zhomart Mukhamejanov c18d488658 Add verification before downloading whole package
UpdateEngine has a feature that verifies
payload without downloading the whole update package.

If UpdateEngine detects invalid payload,
the sample app aborts the update.

No JUnit tests, because it accesses files on the
device and migrating tests to robolectric
is not worth for this sample app.

Bug: 77150191
Test: device
Change-Id: Ib8ce73508a02cf5fdcb326d8ba46c1d05ed5efe5
2018-12-17 14:24:25 -08:00
Zhomart Mukhamejanov 2e33cbeb20 Merge "Add PrepareUpdateService." 2018-12-17 22:19:25 +00:00
Nick Kralevich 649d2d35dc Merge "use epoll_create1"
am: a8d712ec50

Change-Id: I9ddf1a6a059db39ad79d45915f43d9ef6cc456a9
2018-12-17 14:01:26 -08:00
Treehugger Robot a8d712ec50 Merge "use epoll_create1" 2018-12-17 21:57:27 +00:00
Tao Bao acdb8d8d18 Merge "applypatch: Fix comparison of integers of different signs."
am: dfbdaf3f1d

Change-Id: Ic5c55cefd61bc60536a956216ed56d482110a231
2018-12-17 13:35:08 -08:00
Tao Bao dfbdaf3f1d Merge "applypatch: Fix comparison of integers of different signs." 2018-12-17 21:22:41 +00:00
Zhomart Mukhamejanov bc07775393 Add PrepareUpdateService.
It's moved from PrepareStreamingService intent service.
Now PrepareUpdateService takes an UpdateConfig and
builds PayloadSpec for UpdateEngine for both streaming
and non-streaming update.

It allows us to do all preparations in intent service's
thread, without blocking UI.

We will also add checksum verification to
PrepareUpdateService.

Test: device, junit
Bug: 77150191
Change-Id: I15c0bc58e3238bea6ea1c4f13063575e2def89c1
Merged-In: Iea69acd9aa41e17538c26aff60f7598093ca7744
2018-12-17 10:56:28 -08:00
Tao Bao 7ebef8fd40 applypatch: Fix comparison of integers of different signs.
bootable/recovery/applypatch/imgpatch.cpp:57:3: error: comparison of integers of different signs: 'unsigned int' and 'int' [-Werror,-Wsign-compare]
  CHECK_GT(expected_target_length, 0);
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

bootable/recovery/applypatch/freecache.cpp:145:50: error: comparison of integers of different signs: 'long' and '__fsblkcnt64_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
  if (sf.f_bsize == 0 || free_space / sf.f_bsize != sf.f_bavail) {
                         ~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
bootable/recovery/applypatch/freecache.cpp:190:16: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
  if (free_now >= bytes_needed) {
      ~~~~~~~~ ^  ~~~~~~~~~~~~
bootable/recovery/applypatch/freecache.cpp:233:18: error: comparison of integers of different signs: 'int64_t' (aka 'long') and 'size_t' (aka 'unsigned long') [-Werror,-Wsign-compare]
    if (free_now >= bytes_needed) {
        ~~~~~~~~ ^  ~~~~~~~~~~~~

Test: `mmma -j bootable/recovery/applypatch` with -Wsign-compare
Test: Run recovery_unit_test on marlin.
Change-Id: I4aa1fd0f9b7205b9e4e50874fc4bccb62951e7fe
2018-12-17 10:07:27 -08:00
Nick Kralevich 39c53c8ac9 use epoll_create1
epoll_create leaks file descriptors. Use epoll_create1(EPOLL_CLOEXEC)
instead.

Bug: 120983106
Test: compiles and boots
Change-Id: I91f213ebb2dd05330dd25ec1ca1fec59b611e7f2
2018-12-17 08:51:38 -08:00
Tianjie Xu 608acc9ca2 Merge "Show wipe data confirmation text in recovery mode"
am: c456aab7e2

Change-Id: Id1dfc9ca935b8d5f88387b55809dd152fe600544
2018-12-11 15:39:19 -08:00
Tianjie Xu c456aab7e2 Merge "Show wipe data confirmation text in recovery mode" 2018-12-11 23:24:05 +00:00
Tianjie Xu 1a0a30a16a Show wipe data confirmation text in recovery mode
After we generate the localized confirmation text images for certain dpi,
we can now load these images and display them under recovery. Devices that
cannot load the images will use the backup text strings as before.

Bug: 74397117
Test: check the menu with multiple locales, and check all the images locally
with locale test, check the fall back strings.
Change-Id: Ic31a55670026c909ec7a05cb0bb4a0fc1d5d15c7
2018-12-11 23:23:41 +00:00
Bill Yi 00ab5cd4f7 Import translations. DO NOT MERGE
Change-Id: I1bd6d7f12c7bfffb7e022f09347a5be5a96766a3
Cherry-picked from: f560a89470
Test: mma
Auto-generated-cl: translation import
2018-12-11 12:30:44 -08:00
Tao Bao f68cf7c34f Merge "tests: Temporarily disable ScreenRecoveryUITest tests."
am: ceab300864

Change-Id: I64aa4e6e4c8782ee977c41febf625f3935f06af4
2018-12-07 08:41:01 -08:00
Tao Bao ceab300864 Merge "tests: Temporarily disable ScreenRecoveryUITest tests." 2018-12-07 16:31:18 +00:00
Tao Bao f242a7ec2c tests: Temporarily disable ScreenRecoveryUITest tests.
Seems they're racing with SurfaceFlinger in acquiring the display, which
occasionally takes down the device and leads to test failures.

Bug: 120601844
Test: Run recovery_unit_test on marlin. ScreenRecoveryUITest not
      triggered.
Change-Id: I80b21595247a87fc1f2f95aa68df59f58bdf0257
2018-12-06 13:05:05 -08:00
Tao Bao 211fe93f19 Merge changes Id946ab1c,Ifacd01d6
am: 5de42a592a

Change-Id: I2a6a5d0b6a4a151fa46467608d3aabe2d341004f
2018-12-06 10:03:05 -08:00
Treehugger Robot 5de42a592a Merge changes Id946ab1c,Ifacd01d6
* changes:
  uncrypt: Fix the comparison in FindBlockDevice().
  uncrypt: Replace a few C-strings with std::string.
2018-12-06 17:47:46 +00:00
Tao Bao bb134b2613 uncrypt: Fix the comparison in FindBlockDevice().
Previously it considered a match if the given path (i.e. path to an
update package) fully equals to a mount_point.  For example, `uncrypt
/data block.map` or `uncrypt /vendor block.map` would exit successfully,
without producing a block map.

Test: `uncrypt /path/to/package.zip block.map`
Test: `uncrypt /vendor block.map` fails.
Change-Id: Id946ab1c0b158b623013f89463cbb1960141d8b5
2018-12-05 14:44:32 -08:00
Tao Bao d1670a064d uncrypt: Replace a few C-strings with std::string.
Also use android::base::{Dirname,Realpath,StartsWith}.

Test: Run uncrypt on device (`uncrypt package block.map`).
Change-Id: Ifacd01d6b35d85ea4afcb93a0dbc0235bb765a75
2018-12-05 14:44:24 -08:00
Tom Cherry 94b3574440 Merge "Move some small users of fstab to new C++ Fstab"
am: 62040c53e0

Change-Id: I67b07c175d08e5c9166875c9e316831cde425c79
2018-12-04 16:53:20 -08:00
Tom Cherry 62040c53e0 Merge "Move some small users of fstab to new C++ Fstab" 2018-12-05 00:36:14 +00:00
Tom Cherry 772c93ca5c Move some small users of fstab to new C++ Fstab
Bug: 62292478
Test: tree-hugger
Change-Id: Ie2cc10e5168ef3b9dcc42f88e67a1ccd1175fcc5
2018-12-04 11:11:14 -08:00
Elliott Hughes 9f909492c0 Merge "C++17 is the default now."
am: 8fc15c02bd

Change-Id: Ifdbf426e445f1527c0f17c2a1e2901c084f8140c
2018-12-03 13:52:56 -08:00
Treehugger Robot 8fc15c02bd Merge "C++17 is the default now." 2018-12-03 20:42:40 +00:00
Elliott Hughes 31b92a5d75 C++17 is the default now.
Test: builds
Change-Id: I91923da25f470621189589711c50f3d67e435c68
2018-12-03 09:27:17 -08:00
Yifan Hong ec6d0626f4 Merge "Fix ensure_path_mounted_at for fsck_unshare_blocks"
am: a37aa092c7

Change-Id: Ib621a39aa30868506223ec9ee1219b954389b4f1
2018-11-30 22:19:38 -08:00
Treehugger Robot a37aa092c7 Merge "Fix ensure_path_mounted_at for fsck_unshare_blocks" 2018-12-01 06:00:32 +00:00
Tianjie Xu af36438170 Merge "ImageGenerator: ignore the duplicate locales"
am: 7846823125

Change-Id: I8a50e53fa5da77f264bc45fcbe51f9f0308b3e3d
2018-11-30 20:15:13 -08:00
Tianjie Xu 7846823125 Merge "ImageGenerator: ignore the duplicate locales" 2018-12-01 03:56:10 +00:00
Yifan Hong d7b6858045 Fix ensure_path_mounted_at for fsck_unshare_blocks
Test: pass
Bug: 118634720
Change-Id: Icb2540892bd35659462f56c3883a39759f29eeab
2018-11-30 15:22:19 -08:00
Yifan Hong fe00ae099c Merge "SYSTEM_ROOT -> get_system_root"
am: cbfeb7f6af

Change-Id: I3ac20643f620bcf469509241b17a02f9343efa20
2018-11-30 14:31:35 -08:00
Yifan Hong cbfeb7f6af Merge "SYSTEM_ROOT -> get_system_root" 2018-11-30 22:07:24 +00:00
Tom Cherry 21197a7f2b Merge "Update for long long -> off64_t for fstab.length"
am: 1f66578d6f

Change-Id: I0f9f5ba577a129b9c31f9cb409d95282638227db
2018-11-30 08:57:37 -08:00
Tom Cherry 1f66578d6f Merge "Update for long long -> off64_t for fstab.length" 2018-11-30 16:33:54 +00:00
Tom Cherry 45e505a4e9 Update for long long -> off64_t for fstab.length
Test: boot
Change-Id: I755a5dd48f1d5be2cbd8e494b9c405674b12cebb
2018-11-29 13:33:07 -08:00
xunchang a48f00a5e8 ImageGenerator: ignore the duplicate locales
Some language variants have the duplicated translations. Therefore,
we can compare the translated string for each locale to the default
text string for that language. And the duplicated ones will be skipped
to save some space.

Bug: 74397117
Test: generate and check the image
Change-Id: If51fa8fe700350c06f084f0e74d3698b82d6f177
2018-11-29 12:13:02 -08:00
Tianjie Xu f2099b7872 Merge "ImageGenerator: Handle special characters in xml files"
am: 697003dbce

Change-Id: Iee0eecaa259235f9546db3ca34e557b945ee3c5b
2018-11-29 10:46:08 -08:00
Tianjie Xu 697003dbce Merge "ImageGenerator: Handle special characters in xml files" 2018-11-29 18:28:44 +00:00
xunchang 1eeee45a7d ImageGenerator: Handle special characters in xml files
In specific, the apostrophe appears as "\'"; and a new line appears as
"\n\n". We need to handle these two cases accordingly.

Bug: 74397117
Test: generate and check the image
Change-Id: I67b1ebce7494e4a685a0c7334da58dc6df2ccb29
2018-11-29 18:28:13 +00:00
Tianjie Xu 49ba6fc534 Merge "ImageGenerator: switch to BreakIterator from icu library"
am: 86936c46a8

Change-Id: Ic21c9505c8a8a4509fecc2a96635e9f5014e134a
2018-11-28 10:46:18 -08:00
Tianjie Xu 86936c46a8 Merge "ImageGenerator: switch to BreakIterator from icu library" 2018-11-28 18:27:58 +00:00
Jaegeuk Kim f8c230a072 Merge "make_f2fs: use -g android by default"
am: 4cd38430d7

Change-Id: Id85e7c286e88c4b543df91df95a19d69fb66835a
2018-11-27 17:13:59 -08:00
Tao Bao 096d3205b4 Merge "Update README.md."
am: c075d688fd

Change-Id: Ic0b46e5337e759d02b7251b36e5cf5e05437c433
2018-11-27 17:10:35 -08:00
Jaegeuk Kim 4cd38430d7 Merge "make_f2fs: use -g android by default" 2018-11-28 00:57:25 +00:00