Commit graph

55850 commits

Author SHA1 Message Date
Treehugger Robot
86e13d79cc Merge "rm libbinderthreadstate" 2020-02-07 11:18:51 +00:00
Treehugger Robot
39e990d477 Merge "Convert system/core to Result::ok()" 2020-02-07 06:14:16 +00:00
Treehugger Robot
9b7d688ea4 Merge "Increases fastbootd response message size" 2020-02-07 04:27:00 +00:00
Rick Yiu
f7f4442176 Refine set_sched_policy behavior
If a thread priority is greater than or equal to
ANDROID_PRIORITY_BACKGROUND, and the new priority is less than
ANDROID_PRIORITY_BACKGROUND, set the sched policy to its parent process.

Bug: 139521784
Test: functionality verified
Change-Id: Ie6fe33e08e4fda0a119b9869e8dd1733c164d79e
2020-02-07 02:54:57 +00:00
nelsonli
1d53f839cc [vts-core] fix the test error of KernelLibcutilsTest.
Correct the test name of the Test.config.

Bug: 148629781
Test: atest KernelLibcutilsTest
Change-Id: I0307e4ddc89c016f00c6075d0549818d5b3b9382
2020-02-07 10:07:09 +08:00
Steven Moreland
f5f9e3594c rm libbinderthreadstate
This library is empty, and its functionality has moved
into libbinder/libhwbinder.

Bug: 148692216
Test: N/A
Change-Id: I306a2c18ec7770cfb6c3939b5e3d42a55c3165fb
2020-02-06 13:25:34 -08:00
David Anderson
7868246e30 Don't require bootloader fastboot for VTS compliance.
Bug: 144820025
Test: vts
Change-Id: Ib99ddbe611645fe0f89134a628ddb486b02df170
2020-02-06 13:13:56 -08:00
Tom Cherry
66196495f2 init: group source files better in Android.bp
Test: build
Change-Id: I780a82122a08840257c44bff0b93ea6b25f0b2f0
2020-02-06 12:03:05 -08:00
Tom Cherry
62662cf189 Merge "init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()" 2020-02-06 19:14:37 +00:00
Tom Cherry
91bbe9ef56 Merge "Check Errorf()/ErrnoErrorf() format string at compile time" 2020-02-06 19:14:15 +00:00
Bernie Innocenti
cecebbbacc Convert system/core to Result::ok()
No functionality changes, this is a mechanical cleanup.

Test: m
Test: cd system/core && atest
Change-Id: Ifdaa3ce1947ed578f656d5a446978726eb416c36
2020-02-06 17:04:27 +00:00
Treehugger Robot
a6bc86aae7 Merge "Add libsnapshot_test to presubmit" 2020-02-06 16:58:43 +00:00
David Anderson
24c70ea7ba Merge "libsnapshot: Restrict when snapshots can be deleted." 2020-02-06 16:46:58 +00:00
Tom Cherry
1153fbbcd3 Merge "liblog: null terminate log_msg" 2020-02-06 15:31:56 +00:00
Alessio Balsini
9ab7fe2768 Add libsnapshot_test to presubmit
Add libsnapshot test to the TEST_MAPPING's presubmit of fs_mgr to run
the test on TH whenever changes are applied to the fs_mgr contents.
Some of the tests are temporarily disabled due to a WIP bug.

Test: TH
Bug: 142513589
Change-Id: I2a283645b433ed1fd2b08d1c4919cac26d19cf16
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-06 14:58:25 +00:00
Bernie Innocenti
4df09e4685 Merge "Add macros to check for successful Result" 2020-02-06 12:32:59 +00:00
Jerry Chang
aedac7e625 Create directory to store pre-reboot information before reboot
Bug: 145203410
Test: Built and flashed, checked directory was created
Change-Id: Ic4d43fba62301bde23bec459b5b8b6332be2b6dc
2020-02-06 19:42:42 +08:00
Treehugger Robot
d25c64bbf2 Merge "Add android::base::expected::ok()" 2020-02-06 08:37:49 +00:00
Bowgo Tsai
27d5fb344b Increases fastbootd response message size
Some output of `fastboot getvar` exceeds current message size.
Increases the message size to 256 to fix the issue.

Bug: 74445765
Bug: 144473561
Test: fastboot getvar system-fingerprint
Change-Id: Id5064be4bb500697ce87c473f662d86c7c344d65
2020-02-06 16:22:59 +08:00
Treehugger Robot
7bb8a000a7 Merge "bootstat: Migrate to StatsLog for metrics" 2020-02-06 07:41:39 +00:00
Bernie Innocenti
beffc028d6 Add macros to check for successful Result
These macros are meant to be used in tests:

  Result<File> maybe_a_file = OpenFile(...);
  EXPECT_OK(maybe_a_file);

On failure, the error is printed.

There's no equivalent EXPECT_NOT_OK() because it is a testing anti-pattern
which causes tests to pass even when the error changed as a result of a
regression. Use EPECT_EQ(result, Error(...)) instead.

Test: cd system/core && atest
Test: m
Change-Id: Ie26f90d3c62620e7b1f10013829ba43ef5364fe1
2020-02-06 15:27:26 +09:00
Bernie Innocenti
4adfde41ea Add android::base::expected::ok()
This is an alias for has_value() which is meant to be more concise, yet
more explicit than the conversions to bool.

Leave operator bool() in place for now: due to the large number of
users, removal of operator bool() needs to be broken up into incremental
stages.

Test: cd system/core && atest
Test: m
Change-Id: Ib1eb00f47d3c0f2229bb176b62687463b834f280
2020-02-06 15:27:26 +09:00
Treehugger Robot
07e74d65a2 Merge "use apex_test for test apexes" 2020-02-06 01:34:46 +00:00
David Anderson
367cca3937 libsnapshot: Restrict when snapshots can be deleted.
Do not delete snapshots for any reason other than merge-complete or a
cancel request from update_engine. Additionally, create a rollback
indicator file if booting into the source slot, so update_engine can
attempt to cancel the update.

Bug: 147819418
Bug: 147347110
Test: libsnapshot_test gtest
Change-Id: Id357a91cec467a60246c7c3d133f6c54ccb3fc93
2020-02-05 17:16:17 -08:00
Treehugger Robot
a800e1ee9d Merge changes I63b5e69b,I85c6af63
* changes:
  fiemap: add image_test and writer_test tests to presubmit
  fiemap: fix fiemap size and log message when last extent
2020-02-05 23:47:45 +00:00
Tom Cherry
d44a5f840d liblog: null terminate log_msg
Also, use LOGGER_ENTRY_MAX_LEN instead of sizeof(log_msg) for ensuring
that the read did not overflow, since sizeof(log_msg) is one byte
longer to allow for placing a null terminator already.

Bug: 148966104
Test: liblog unit tests
Change-Id: Id4fe8aa5da44e9d62f59b6541f157a4e7b038d07
2020-02-05 15:04:32 -08:00
Alessio Balsini
c352179e10 fiemap: add image_test and writer_test tests to presubmit
Add fiemap_image_test and fiemap_writer_test to TEST_MAPPING to be run
by TH as presubmits.
Because of a bug under investigation, the actual
fiemap_image_test_presubmit is used instead of the original, that has
one test case disabled.

Bug: none
Test: TH, fiemap_image_test, fiemap_writer_test
Change-Id: I63b5e69b5c245a18eceb1e5896df7bd0577f289b
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 22:08:29 +00:00
Keun young Park
606af6dfff bootstat: Migrate to StatsLog for metrics
- All events are migrated to StatsLog atoms.
- Still keep the string based name for BootEvent logging as that makes it
  easier for debugging purpose.

Bug: 132691841
Test: check boot related stats are pushed after boot up
      $ adb shell cmd stats print-stats

Change-Id: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
Merged-In: I33313695a8a2d0a3c74f7705c0843c8c4bad2133
2020-02-05 12:53:24 -08:00
Alessio Balsini
f6034544c0 fiemap: fix fiemap size and log message when last extent
Fix the total fiemap struct plus extents size allocation.
Fix also the logging in IsLastExtent, that was printing error messages
every time.

Bug: none
Test: fiemap_*_test
Change-Id: I85c6af63ba3a75b993a5e8ad7d7170dc7af59582
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-05 18:27:40 +00:00
Tom Cherry
57b9428471 init: use ErrnoErrorf() instead of ErrnoError() << StringPrintf()
Test: force init to print this line and see the log message
Change-Id: Ibb74572347f915cd76cc50f4c19126b66f562810
2020-02-05 07:57:14 -08:00
Tom Cherry
f8e6bf6d81 Check Errorf()/ErrnoErrorf() format string at compile time
fmtlib provides compile time checking of format strings that we're not
currently using.  This change makes Errorf() and ErrnoErrorf() into
macros such that we can take advantage of this capability.

Test: build successfully normally
Test: fail the build if using an invalid format string
Change-Id: Icb8ba8cb973bbd1fa4755a62e7598bdbb0113757
2020-02-05 07:57:14 -08:00
Treehugger Robot
e6211eb978 Merge "first_stage_mount: reading all avb_keys before chroot" 2020-02-05 13:42:34 +00:00
Jiyong Park
17730e7cf6 use apex_test for test apexes
... so that the build system can distinguish testing APEXes and installable APEXes, and apply
different rules to them.

Bug: 146308764
Test: m
Change-Id: I5fdab94da352e8014225b2454aacc2a5b5fc6a52
2020-02-05 18:44:10 +09:00
Bowgo Tsai
e0f5c10691 first_stage_mount: reading all avb_keys before chroot
Avb keys used to verify a partition are stored in the first-stage
ramdisk. However, after /system is mounted, init will chroot into it.
This makes those keys inaccessible for later mounts, e.g., /vendor or
/product.

This change retains avb keys by reading all of them before chroot
into /system.

Note that it is intentional to perform public matching for both
preload_avb_key_blobs and fstab_entry.avb_keys in libfs_avb.
As some keys might only be availble before init chroots into /system,
e.g., /avb/key1 in the first-stage ramdisk, while other keys might
only be available after the chroot, e.g., /system/etc/avb/key2.

Bug: 147585411
Test: specify avb_keys for a partition and checks the keys are preloaded
Test: atest libfs_avb_test
Test: atest libfs_avb_internal_test
Change-Id: I6bd490c4215480db2937cdfc3fea0d616e224a91
2020-02-05 15:51:41 +08:00
Bernie Innocenti
ab65ef22a5 Merge "Delete dangerous comparison operators from base::expected" 2020-02-05 05:51:45 +00:00
Treehugger Robot
3cbb753b0d Merge "liblp: add test to presubmit" 2020-02-05 01:20:36 +00:00
Josh Gao
c71a1e7ab0 Merge "adb: report error in copy_to_file." 2020-02-04 23:49:37 +00:00
Yifan Hong
e8cd50a7a0 Merge "libsnapshot::RemoveAllUpdateState log stack" 2020-02-04 23:31:47 +00:00
Daniel Rosenberg
02e5e1ea22 Merge "Make /data/media case insensitive" 2020-02-04 23:03:38 +00:00
Treehugger Robot
405d26dacb Merge "Set e2freefrag and e2fsdroid as required by libfs_mgr_defaults" 2020-02-04 22:57:36 +00:00
Yifan Hong
c19b08a66a Merge "Make snapshotctl logging better." 2020-02-04 22:18:33 +00:00
Treehugger Robot
b34a729469 Merge "snapshot/test: Add delay to all the CreateLogicalAndSnapshotPartitions" 2020-02-04 22:16:52 +00:00
Yifan Hong
e8148150c3 libsnapshot::RemoveAllUpdateState log stack
Bug: 148818798
Test: apply OTA but cancel it in the middle, then
      delete /data/misc/update_engine/prefs/*, then
      reapply it again (to trigger CancelUpdate()).
      Stack is dumped.

Change-Id: I2dfb6b7f15b9d5854d0b81ed8ad260538d21c922
2020-02-04 14:01:24 -08:00
Yifan Hong
12fe03d470 Make snapshotctl logging better.
snapshotctl merge --logcat --log-to-file
- If --logcat, log to logcat
- If --log-to-file, log to /data/misc/snapshotctl_log/
- If both, log to both
- If none, log to stdout

Test: manually test these 4 cases
Bug: 148818798
Change-Id: I44b52936c0d095867acc6ee781c6bec04f6ebd6b
2020-02-04 14:01:24 -08:00
Josh Gao
3828ebcdd8 adb: report error in copy_to_file.
Previously, if we failed to read a file after successfully opening it,
(e.g. because it's a directory), we would return prematurely without
notifying our caller, which would then wait forever for a response that
isn't coming.

Switch all of the adb install callsites over to checking the result,
but leave the other callsites ignoring the result, because they're
either deprecated, or don't care.

Bug: http://b/145621968
Test: mkdir foo.apk; adb install foo.apk
Change-Id: Ia82f8280b144f7881e067a10cd17f9a89019cf3f
2020-02-04 13:47:57 -08:00
Treehugger Robot
1b727bce06 Merge "Extra logging for metadata errors" 2020-02-04 21:37:42 +00:00
Alessio Balsini
13d2d968d9 liblp: add test to presubmit
Add liblp_test to TEST_MAPPING to be triggered as TH presubmit test.

Bug: none
Test: liblp_test
Change-Id: If4d60e816e4e1b321603e1a5ed00e21297567d38
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 21:33:56 +00:00
Alessio Balsini
272ef868f1 Extra logging for metadata errors
Increase logging in metadata image management.

Bug: none
Test: m
Change-Id: Ie49ca9ac90cd593c95d31f4651ae724d617d5695
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 20:49:59 +00:00
Alessio Balsini
841bccc1eb snapshot/test: Add delay to all the CreateLogicalAndSnapshotPartitions
In tests CreateLogicalAndSnapshotPartitions may give flaky results
because not synchronous.
Add a bounded delay that prevents this behavior defined by a single
constexpr.

Bug: none
Test: libsnapshot_test
Change-Id: Iad3c24b1d3e82e3bd695d6dbbc8af8eab75bee32
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-04 19:33:35 +00:00
Treehugger Robot
09b9fc56a2 Merge "tests: handle legacy and new bootstat complete" 2020-02-04 19:06:42 +00:00