Commit Graph

2535 Commits

Author SHA1 Message Date
Mark Salyzyn 7bf11aadfd Merge "No longer need android/log.h"
am: b330559fb6

Change-Id: Ie2b65008349d874eb96f40da24b1333e7e62e7da
2016-10-10 14:19:41 +00:00
Mark Salyzyn b330559fb6 Merge "No longer need android/log.h" 2016-10-10 14:14:30 +00:00
Tao Bao 8477a03a4a Merge "Disable the meaningless parts of the UI for A/B."
am: aa4924cab1

Change-Id: Iaba41f4d5a4581053813beb99366cac4068725bb
2016-10-09 21:08:47 +00:00
Tao Bao aa4924cab1 Merge "Disable the meaningless parts of the UI for A/B." 2016-10-09 21:00:37 +00:00
Elliott Hughes b0c3f6ffeb Disable the meaningless parts of the UI for A/B.
Bug: http://b/28748484
Test: mmma bootable/recovery
Change-Id: Ie86a265f4699503471e7c717d65677a916dbd25b
(cherry picked from commit 01fcbe160b)
2016-10-09 12:55:50 -07:00
Mark Salyzyn df1b6947ec No longer need android/log.h
Test: compile
Bug: 31992412
Change-Id: I5156590bfc94e46e9d282c197c3dd8c4bbd9e855
2016-10-07 14:19:48 -07:00
Tao Bao 6674f22a2f Merge "edify: Move State.script and State.errmsg to std::string."
am: 8810634773

Change-Id: Id8e786de6fe76287b598dfcfbf962eba5d9ebde2
2016-10-05 06:13:22 +00:00
Treehugger Robot 8810634773 Merge "edify: Move State.script and State.errmsg to std::string." 2016-10-05 06:07:56 +00:00
Tao Bao 59dcb9cbea edify: Move State.script and State.errmsg to std::string.
This way we kill a few strdup() and free() calls.

Test: 1. recovery_component_test still passes;
2. Applying an update with the new updater works;
3. The error code in a script with abort("E310: xyz") is recorded into
last_install correctly.

Change-Id: Ibda4da5937346e058a0d7cc81764d6f02920010a
2016-10-04 14:24:32 -07:00
Mark Salyzyn 7cf7e6ce4f Merge "recovery: drop log/logger.h"
am: 38b923ff6c

Change-Id: I92ddb6d9adef3f4a25588c76bade058914952b06
2016-10-04 17:42:40 +00:00
Mark Salyzyn 38b923ff6c Merge "recovery: drop log/logger.h" 2016-10-04 17:39:17 +00:00
Tao Bao 6fbed10fa5 Merge "edify: Move the testcases to gtest."
am: 0bc2df1696

Change-Id: I6c61d04cb7d2b47ef903d838ead453f51eb91ea7
2016-10-04 16:59:38 +00:00
Tao Bao 0bc2df1696 Merge "edify: Move the testcases to gtest." 2016-10-04 16:55:50 +00:00
Mark Salyzyn fee79a4532 recovery: drop log/logger.h
private/android_logger.h contains all we need.

Test: compile
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I6714d730372dc81f784e7f9dfee8a33848643a5d
2016-10-04 09:04:08 -07:00
Tao Bao d770d2e7af edify: Move the testcases to gtest.
Now they live in tests/component/edify_test.cpp.

Also rename edify/main.cpp to edify/edify_parser.cpp. It becomes a
host-side debugging tool that validates the input edify script. However,
it supports edify builtin functions only and doesn't recognize the ones
defined via updater.

Test: recovery_component_test passes on device.

Change-Id: Ib94a787bf15098a9cc078d256b6a6dc96ff12b2e
2016-10-03 15:33:20 -07:00
Tianjie Xu 5269808bb0 Merge "Turn on -Werror for recovery"
am: 695ef7cacc

Change-Id: If8cb1fd9470c4ae6798dc4ecf1707c5eb40b877e
2016-09-30 17:45:35 +00:00
Tianjie Xu 695ef7cacc Merge "Turn on -Werror for recovery" 2016-09-30 17:41:14 +00:00
Tianjie Xu 7aa88748f6 Turn on -Werror for recovery
Also remove the 0xff comparison when validating the bootloader
message fields. As the fields won't be erased to 0xff after we
remove the MTD support.

Bug: 28202046
Test: The recovery folder compiles for aosp_x86-eng
Change-Id: Ibb30ea1b2b28676fb08c7e92a1e5f7b6ef3247ab
2016-09-29 19:21:24 -07:00
Tianjie Xu 7582609d61 Merge "Report uncrypt errors in details"
am: af8b9363c6

Change-Id: I5790f1c3ce902edf7bf9025e445b043c93036a30
2016-09-27 21:19:56 +00:00
Treehugger Robot af8b9363c6 Merge "Report uncrypt errors in details" 2016-09-27 21:11:06 +00:00
Tianjie Xu da44cf18f3 Report uncrypt errors in details
Add the error codes for uncrypt and report the failure details in
uncrypt_status.

Test: uncrypt_error logs correctly in last_install
Bug: 31603820
Change-Id: I8e0de845ce1707b6f8f5ae84564c5e93fd5f5ef5
2016-09-26 22:48:45 -07:00
Tao Bao 5ac819a51f Merge "Duplicate the last_install content into last_log."
am: 95afc912fb

Change-Id: Ib3838e9d2f3d6a9a15872e9a5163bf140ff2f3d5
2016-09-27 01:43:42 +00:00
Tao Bao 87f4edf467 Duplicate the last_install content into last_log.
am: f4885adc18

Change-Id: I8f197d09af405254a0b07f0ace4e5149736ca0ad
2016-09-27 01:43:41 +00:00
Tao Bao 95afc912fb Merge "Duplicate the last_install content into last_log." 2016-09-27 01:38:53 +00:00
Tao Bao f4885adc18 Duplicate the last_install content into last_log.
Currently we save the OTA metrics in last_install, which keeps the data
for the _last_ install only. This CL logs the same content into last_log
so that we keep the metrics for every install.

Bug: 31607469
Test: Apply an update (via OTA and sideload) and check last_log and last_install.

Change-Id: Id8f174d79534fddc9f06d72a4e69b2b1d8ab186c
2016-09-26 14:46:12 -07:00
Elliott Hughes be9a94fd17 Merge "Switch to <android-base/properties.h>."
am: cc02f9652f

Change-Id: I5f0d55f980055cee3c7ae477d1bdbd1d05b97dc1
2016-09-26 19:40:28 +00:00
Elliott Hughes cc02f9652f Merge "Switch to <android-base/properties.h>." 2016-09-26 19:32:48 +00:00
Elliott Hughes cb22040c63 Switch to <android-base/properties.h>.
Bug: http://b/23102347
Test: boot into recovery.
Change-Id: Ib2ca560f1312961c21fbaa294bb068de19cb883e
Merged-In: Ib2ca560f1312961c21fbaa294bb068de19cb883e
2016-09-26 09:51:37 -07:00
Tianjie Xu 40bae5e1c6 Merge "Check corruption when reading uncrypt_status file"
am: 3cf815a6a9

Change-Id: Ic7404abd3026a8faffaac14a20c90ebf2ef10106
2016-09-13 22:26:03 +00:00
Treehugger Robot 3cf815a6a9 Merge "Check corruption when reading uncrypt_status file" 2016-09-13 22:20:04 +00:00
Tianjie Xu 1c1864f321 Check corruption when reading uncrypt_status file
Bug: 31383361
Change-Id: I0de920916da213528d73b742e4823b4a98c63ea1
2016-09-13 13:56:00 -07:00
Tianjie Xu 6048138e10 Merge "save uncrypt status to last_install"
am: cdf509cce2

Change-Id: I4ef51a1d2c75f42c31f419e68ed616838a3f8ead
2016-09-12 23:01:28 +00:00
Tianjie Xu cdf509cce2 Merge "save uncrypt status to last_install" 2016-09-12 22:56:31 +00:00
Tianjie Xu fe16b5ccaf save uncrypt status to last_install
Save the uncrypt time cost to /cache/recovery/uncrypt_status. Recovery
reads the file and saves its contents to last_install.

Bug: 31383361
Test: Tested on angler and uncrypt_time reports correctly.

Change-Id: I5cd3f7b6ca069d69086d09acfea8fc4f1215c833
Merged-In: I5cd3f7b6ca069d69086d09acfea8fc4f1215c833
2016-09-12 22:55:36 +00:00
Tianjie Xu c5becf0ef8 Merge "Switch recovery to libbase logging"
am: 61590bbf0d

Change-Id: I246ff0e75b0610abeedf21d3c3b1a9849a68856b
2016-09-01 23:12:01 +00:00
Tianjie Xu 61590bbf0d Merge "Switch recovery to libbase logging" 2016-09-01 23:04:37 +00:00
Tianjie Xu 7b0ad9c638 Switch recovery to libbase logging
Clean up the recovery image and switch to libbase logging.

Bug: 28191554
Change-Id: Icd999c3cc832f0639f204b5c36cea8afe303ad35
Merged-In: Icd999c3cc832f0639f204b5c36cea8afe303ad35
2016-09-01 18:33:25 +00:00
Tianjie Xu 852ae8d0fb Merge "Check an edge case when read(2) returns 0"
am: 3202b8faf4

Change-Id: I7d748b9f13c0f03f195f943cb3f5afa57c80296e
2016-09-01 17:52:10 +00:00
Treehugger Robot 3202b8faf4 Merge "Check an edge case when read(2) returns 0" 2016-09-01 17:48:39 +00:00
Tianjie Xu 71e182bc38 Check an edge case when read(2) returns 0
We might end up in an infinite loop if read(2) reached EOF unexpectedly.
The problematic code in uncrypt mentioned in the bug has been fixed
by switching to libbase ReadFully(). So I grepped through the recovery
code and fixed some other occurences of the issue.

Bug: 31073201
Change-Id: Ib867029158ba23363b8f85d61c25058a635c5a6b
2016-08-31 19:11:41 -07:00
Josh Gao aad4cef0f3 Merge "minadbd: rename adb_server_main to minadbd_main."
am: 818394869d

Change-Id: I7a8fe351a8bfa0b7bdc48c89d56647a98018af51
2016-08-30 20:27:39 +00:00
Josh Gao 818394869d Merge "minadbd: rename adb_server_main to minadbd_main." 2016-08-30 20:17:27 +00:00
Josh Gao acb2a2fa4c minadbd: rename adb_server_main to minadbd_main.
adb_server_main in adb refers to the adb server on the host, not adbd.
Since there doesn't seem to be a good reason to reuse the declaration
from adb's headers, give minadbd a main function of its own.

Change-Id: I748f1a6822dc14c726cb73ef3b533c57a6615608
2016-08-30 13:15:12 -07:00
Chih-Hung Hsieh 9968866e86 Merge "Fix clang-tidy warnings in bootable/recovery."
am: 89bf2bdc85

Change-Id: I7748981badcbcdfe24d0cbe1c41007c67f611b14
2016-08-26 23:42:05 +00:00
Treehugger Robot 89bf2bdc85 Merge "Fix clang-tidy warnings in bootable/recovery." 2016-08-26 23:29:23 +00:00
Chih-Hung Hsieh 8b23811d2a Fix clang-tidy warnings in bootable/recovery.
* Use const reference type for read-only parameters.
Bug: 30407689
* Use faster overloaded string find function.
Bug: 30411878
* Add parentheses around macro parameters.
Bug: 28705665

Test: build with WITH_TIDY=1
Change-Id: I4e8e5748bfa4ae89871f1fb5fa4624d372530d75
2016-08-26 14:54:29 -07:00
Tao Bao b3ddc0a4bf Merge "Free mmaped area if keys fail to load"
am: f599414aec

Change-Id: Id96153c211ca1fcc1cd78d6e662b0b48795c0d76
2016-08-18 06:14:46 +00:00
Tao Bao f599414aec Merge "Free mmaped area if keys fail to load" 2016-08-18 06:10:35 +00:00
WiZarD edafac6c7b Free mmaped area if keys fail to load
Keys for package verification is loaded after the update
package is mmaped into memory. This mmaped area needs
to be freed when exiting the function.

Another approach would be to mmap after loading the keys.

Change-Id: Ib77711a8acd5c363b5517da12dc311fb8f9f4605
Signed-off-by: WiZarD <WiZarD.Devel@gmail.com>
2016-08-18 05:20:40 +00:00
Tianjie Xu 4e4474c9c5 Merge ""view recovery logs" will show /tmp/recovery.log"
am: c158cf0a14

Change-Id: I1485c1c84a7caa20b11da4fd2561e0dba95fc39b
2016-08-17 22:07:44 +00:00