Commit graph

58819 commits

Author SHA1 Message Date
Treehugger Robot
e5c827a25a Merge "Add failure logs in __ashmem_open_locked()" am: 546cf270ab
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394158

Change-Id: Ic4b9148b484ed79bf4fdb73fa5e2e5905497555f
2020-08-11 23:23:45 +00:00
Treehugger Robot
546cf270ab Merge "Add failure logs in __ashmem_open_locked()" 2020-08-11 23:04:28 +00:00
Tom Cherry
cfe90f29ac Merge "Revert "liblog: use a blocking socket for sending messages to logd"" am: cadeec102c
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1397308

Change-Id: Ibb9b17338b6a00967b7981ea365a34939e3a40e7
2020-08-11 22:30:54 +00:00
Tom Cherry
cadeec102c Merge "Revert "liblog: use a blocking socket for sending messages to logd"" 2020-08-11 22:17:41 +00:00
Tom Cherry
b1eb731197 Revert "liblog: use a blocking socket for sending messages to logd"
This reverts commit 4af349b072.

Reason for revert: post submit test logs too much fails after this
Bug: 163611679

Change-Id: If9939f3c9864dad67536d0c5481f662b9d07c58e
2020-08-11 22:15:09 +00:00
Treehugger Robot
f614dd953e Merge "liblog: remove android_lookupEventTag" am: d81e1d3483
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1396175

Change-Id: I3f2e7cf013201a8a9cfc13a3b5bc2c4c0790162f
2020-08-11 19:06:22 +00:00
Yifan Hong
e92882a855 Merge changes from topic "charger_soong" am: 333149339b
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394309

Change-Id: I74f8883963fa06d4000694b037117d7298897370
2020-08-11 19:05:51 +00:00
Treehugger Robot
d81e1d3483 Merge "liblog: remove android_lookupEventTag" 2020-08-11 19:05:35 +00:00
Yifan Hong
333149339b Merge changes from topic "charger_soong"
* changes:
  charger: Add tests for loading animation resources
  charger: Move built-in resources to /system
  charger: Load default resources from /system
2020-08-11 18:51:31 +00:00
Tom Cherry
175366df44 liblog: remove android_lookupEventTag
This function has been marked deprecated for quite some time, has no
users, and isn't in liblog.map.txt.

Test: build
Change-Id: Ic3bf47c780b18a5d4f1e997b9265be76049fb824
2020-08-11 09:20:18 -07:00
Elliott Hughes
6c39be7d7f Merge "libsparse: Fix overflow of merged sparse chunk length" am: 7298ba0992
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394507

Change-Id: If23bd796c34f82cf104d86719967c6dbff4cef3f
2020-08-11 15:35:27 +00:00
Tom Cherry
fe74b01def Merge "liblog: use a blocking socket for sending messages to logd" am: d731184c38
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1395649

Change-Id: I31c95843d1c7d40d662bcb4eb31829b2241757c2
2020-08-11 15:35:20 +00:00
Elliott Hughes
7298ba0992 Merge "libsparse: Fix overflow of merged sparse chunk length" 2020-08-11 15:19:01 +00:00
Tom Cherry
d731184c38 Merge "liblog: use a blocking socket for sending messages to logd" 2020-08-11 15:13:02 +00:00
Hyeongseok Kim
e8d02c50d7 libsparse: Fix overflow of merged sparse chunk length
Merging sparse chunk can make sparse map block bigger than 4GiB,
that can't be covered by unsigned integer type. Fix this by
changing unsigned int to uint64_t type.

Test: sparse build
Bug: 162808120
Change-Id: Id4d3f88f9d531c25c3937c99b2c81efb915605ee
Signed-off-by: Hyeongseok Kim <hyeongseok@gmail.com>
Cc: hyeongseok.kim <hyeongseok.kim@lge.com>
2020-08-11 08:34:28 +09:00
Tom Cherry
4af349b072 liblog: use a blocking socket for sending messages to logd
liblog uses a non-blocking socket for sending messages to logd as a
performance/reliability trade-off, favoring not blocking processes
when they log over reliably tracking all logs.

This change asserts that the above is the wrong trade-off: that log
relability is more important than slight delays when logging. Further
points to consider:

1) The new logd implementation without chatty has lower latency and
less variance in its ::Log() function.
2) liblog also writes to /dev/pmsg0 and this call is already blocking.
3) Logging is already expensive and excess spam must be eliminated
regardless.

Bug: 151654749
Bug: 155922578
Bug: 160314220
Test: No messages are dropped by this socket
Change-Id: I163b7d51aa73a10978850f1868cb9fc4bf9ead1b
2020-08-10 15:56:15 -07:00
Eric Biggers
f79287b5cc Merge "fs_mgr: use __ANDROID_API_Q__ instead of pre_gki_level" am: 9b6922b5df
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394890

Change-Id: If9f3833dfec2f29d436fd535d64404281a93d82e
2020-08-10 22:53:51 +00:00
Eric Biggers
9b6922b5df Merge "fs_mgr: use __ANDROID_API_Q__ instead of pre_gki_level" 2020-08-10 22:35:21 +00:00
Tom Cherry
0b1ebf0475 Merge "logd: document the decision to use compression instead of chatty" am: c486371741
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394969

Change-Id: I5d9df6eae40cb7c53ba2738fdfd96494eb6625b2
2020-08-10 22:04:31 +00:00
Tom Cherry
c486371741 Merge "logd: document the decision to use compression instead of chatty" 2020-08-10 21:47:39 +00:00
Hridya Valsaraju
9a147033f8 Add failure logs in __ashmem_open_locked()
Bug: 160984921
Test: build, boot
Change-Id: I754c961289828463af6de905d8b057b4350f5f07
2020-08-10 14:14:13 -07:00
Tom Cherry
edc1ba6a1d logd: document the decision to use compression instead of chatty
Open README.compression.md in a markdown viewer for details.

Test: vscode and gitiles render this correctly
Change-Id: Iaa0093dc565b5c6bb016c9e97248375f0906d0c8
2020-08-10 11:53:51 -07:00
Eric Biggers
75ebdd9c7c fs_mgr: use __ANDROID_API_Q__ instead of pre_gki_level
The name "pre_gki_level" is causing some confusion because not all
devices launching with Android R are subject to the GKI requirement.
(See b/161563110#comment11.)  E.g., devices that use a 4.14-based kernel
are exempt from GKI.  However, the encryption requirements still apply.

Just use __ANDROID_API_Q__ directly instead.

No change in behavior.

Change-Id: I4242745ccc9f88e084a1adfab5796daa9bc59b6e
2020-08-10 11:43:52 -07:00
Elliott Hughes
354d814409 Merge "Add second batch of fuzzers for libutils" am: 2cfea97ba3
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1356122

Change-Id: Iadc65ea6bd352afa4cabcbff70add97010e7d94a
2020-08-10 15:57:32 +00:00
Elliott Hughes
2cfea97ba3 Merge "Add second batch of fuzzers for libutils" 2020-08-10 15:40:44 +00:00
Treehugger Robot
c7a2225665 Merge "Add uptimeNanos to SystemClock" am: 52c8422ea1
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1394287

Change-Id: I540cfc5c783411ff513bb1cda1d9e3e5a2f0b3b9
2020-08-08 01:22:15 +00:00
Treehugger Robot
52c8422ea1 Merge "Add uptimeNanos to SystemClock" 2020-08-08 01:04:09 +00:00
Yifan Hong
c2bed97e10 charger: Add tests for loading animation resources
Bug: 143907179
Test: run it

Change-Id: I1b1dfe4947210932c674657689e396ae909013c2
2020-08-07 17:07:09 -07:00
Yifan Hong
5109c8ce04 charger: Move built-in resources to /system
Convert rules to build charger resources to Soong
assuming BOARD_CHARGER_NO_UI is not set. As of now,
no devices in the source tree sets this variable. Also,
these images should be installed to the system image
regardless of this variable.

This change moves battery_fail and battery_scale to
/system/etc/res/images/charger.

Test: build and inspect system/etc/res/images/charger
Fixes: 143907179
Change-Id: Idccf5631371c7520cbfcfa6e92d1e88d0f3f95e7
2020-08-07 17:07:09 -07:00
Yifan Hong
abda7153fe charger: Load default resources from /system
When charger resources are missing from /product, before this change,
images are loaded from /res/images/charger. After this change, charger
first checks if the resource exists at that location, and if not, use
resource under /system/etc/res/images/charger.

On devices that uses resources from /product, this change has no effect.
On devices that uses resources from /res,
- if an old image is mounted at /, charger continues to load resources
  from /res.
- if a new image is mounted at /, that is, battery_fail and
  battery_scale may not exist under /res, charger loads them from /system.
  There are no font files installed by modules defined here, so any
  device-specific font files stay at /res.

Also create virtual function wrappers over minui APIs to be mocked
later.

See next change on moving battery_scale and battery_fail images to
/system.

Test: build and inspect system/etc/res/images/charger
Bug: 143907179
Change-Id: I4895b9602274fa4a1ebb4d7d3b842622b81b7b51
2020-08-07 17:07:09 -07:00
Jooyung Han
28d0dba1f5 Merge "Fix the order for boot scripts scanning" am: ccab04e5b5
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393378

Change-Id: I948be36054a73a0cf673a726d4d8426990b2736e
2020-08-07 23:43:01 +00:00
Jooyung Han
ccab04e5b5 Merge "Fix the order for boot scripts scanning" 2020-08-07 23:21:55 +00:00
Dylan Katz
7168f2726e Add second batch of fuzzers for libutils
This adds fuzzers for:
- CallStack
- Looper
- LruCache
- Printer
- ProcessCallStack
- PropertyMap
- RWLock
- RefBase
- StopWatch.
Test: Ran each fuzzer for 10 minutes. Rough coverage est. (likely far below actual value): 10.97%

Signed-off-by: Dylan Katz <dylan.katz@leviathansecurity.com>
Change-Id: I2f9f35c18b13338c282fb7f9c3ea4099ecb2c56f
2020-08-07 15:36:39 -07:00
Suprabh Shukla
a55ef96ea7 Add uptimeNanos to SystemClock
Test: system/core/libutils/SystemClock_test.cpp

Bug: 162791194
Change-Id: I0e3ea2004146eb7442c89bb35a9f3a2171d9c4b8
2020-08-07 14:36:07 -07:00
Yifan Hong
833c1b98b3 Merge "Fix allowlist for unreliable pinning." am: 0198ce0ca7
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393698

Change-Id: I73c57a7fa8bceadc2b5bb71c92f353574a25ab33
2020-08-07 17:58:25 +00:00
Yifan Hong
60e1be9200 Merge "libsnapshot_test: skip global setup on non-VAB devices." am: 75d5e98401
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393640

Change-Id: I78c01b7ad442a1a98278d6f3664828308be1eb77
2020-08-07 17:58:14 +00:00
Treehugger Robot
6252e97df4 Merge "logd: consolidate command handling and fix an error check" am: 2666aaba84
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393638

Change-Id: I01ec49a6f32a647e5e33df83abda206f51da31f1
2020-08-07 17:57:59 +00:00
Yifan Hong
0198ce0ca7 Merge "Fix allowlist for unreliable pinning." 2020-08-07 17:57:13 +00:00
Yifan Hong
75d5e98401 Merge "libsnapshot_test: skip global setup on non-VAB devices." 2020-08-07 17:57:00 +00:00
Treehugger Robot
2666aaba84 Merge "logd: consolidate command handling and fix an error check" 2020-08-07 17:41:14 +00:00
Tom Cherry
94b299ab43 logd: consolidate command handling and fix an error check
Consolidate command handling for commands that take a buffer ID as
their first argument.  Further use ParseUint instead of atoi(), since
atoi("bad string") returns `0` is the same as LOG_ID_MAIN.

Test: these commands are handled property
Test: `echo -n 'getLogSize ignoreme!\0' | nc -U /dev/socket/logd`
      returns an error
Change-Id: I3e84a6157e16f4c110681da453e1ae1a920da7c4
2020-08-07 09:48:16 -07:00
Treehugger Robot
f0461b29d8 Merge "Delete fiemap_image_test_presubmit" am: 4b3229b216
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1393701

Change-Id: I9093ec3808d44890d7ca9e09b6d78f7908c97c97
2020-08-07 02:43:25 +00:00
Treehugger Robot
4b3229b216 Merge "Delete fiemap_image_test_presubmit" 2020-08-07 02:23:13 +00:00
Jooyung Han
f7c2585f6d Fix the order for boot scripts scanning
To support "override" services, we need to scan partitions from least
speicific to most specific.

Bug: 163021585
Test: m
Change-Id: I26a6de4f7fb571c60038e803137a4b1c237792fd
2020-08-07 10:44:14 +09:00
Yifan Hong
0074cc1831 Merge changes from topic "healthd_test" am: 17ed9c4fb6
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1392638

Change-Id: I5410990c3b920f655bd73c1e218c06855a851333
2020-08-07 01:14:28 +00:00
Yifan Hong
17ed9c4fb6 Merge changes from topic "healthd_test"
* changes:
  Add libhealthd_charger_test to presubmit.
  Convert healthd_test to Soong
  Fix AnimationParser remove_prefix test
2020-08-07 00:38:50 +00:00
Yifan Hong
f0cb5a04f3 Delete fiemap_image_test_presubmit
No tests are skipped in presubmit now.

Test: presubmit
Fixes: 148874852

Change-Id: Ic0ce7489ff4a92ab90986dd76f836c262f5aa3fc
2020-08-06 17:38:02 -07:00
Yifan Hong
a7c00a0943 libsnapshot_test: skip global setup on non-VAB devices.
On non-VAB devices, fake super image creation may fail because it
may not support f2fs file pinning.

Also changes global setup to a testing::Environment object because it is
the recommended way in gtest's guide. SnapshotTestEnvironement::TearDown
is automatically executed before RUN_ALL_TEST returns.

Test: vts_libsnapshot_test
Test: make IsVirtualAbEnabled() return false, then all tests are
skipped.

Bug: 162557082
Change-Id: I1382f9a4ddec146fa2d8cfb21ac66ca22a2e110f
2020-08-06 17:21:50 -07:00
Tom Cherry
b19bbaeb41 Merge "Query log size properties only within logd" am: ca0a46aefa
Original change: https://android-review.googlesource.com/c/platform/system/core/+/1390949

Change-Id: Ib26c90b96f0ae2c13563b84b6724a35f8d734f24
2020-08-06 22:14:57 +00:00
Yifan Hong
900fdf47ce Fix allowlist for unreliable pinning.
When checking IsUnreliablePinningAllowed, the existing code calls
IsTestDir on a value starts with "/data", but IsTestDir expects
metadata_dir_. Fix it.

Also, make subdir checks more robust and add test cases for IsSubdir.

Fixes: 162557082
Test: vts_libsnapshot_test
Test: fiemap_image_test

Change-Id: I495cfae3da11d1e0800b8abf520df10dd9a29dce
2020-08-06 15:02:56 -07:00