Commit graph

40044 commits

Author SHA1 Message Date
TreeHugger Robot
4ae7d5c34e Merge "Make logd more aggressive when scanning for the position from which to resume logging." into pi-dev 2018-04-05 18:12:37 +00:00
Joe Onorato
4bba698245 Make logd more aggressive when scanning for the position from which to resume logging.
Events in the LogBuffer are supposed to be sorted by timestamp, but for a variety
of reasons that doesn't always happen.  When a LogReader is reading from LogBuffer,
LogBuffer starts at the newest event, and scans backward through the list, looking
for the last event.  Previously it would accept a couple that were a little bit out
of order, but if it found one that was ancient, it would just bail. This change
removes that check for the ancient messages.  They are probably indicative of
something else upstream, but since there is no invariant of the list being sorted,
this change simplifies the search algorithm, and makes it look only at the previous
300 events.

Bug: 77222120
Test: while true ; do frameworks/base/cmds/statsd/run_tests.sh 2h ; done
Change-Id: I0824ee7590d34056ce27233a87cd7802c28f50e4
2018-04-04 14:46:45 -07:00
Jaegeuk Kim
9a67c69e6c make_f2fs: specify sector size for target image size
The total sectors that we want to format is used in different meanings from
various users. This notifies its size based on 4096 bytes explicitly.

Bug: 76407663
Change-Id: I4e00f2e2289c1381f0238d2a4acb606a0ab551a9
Merged-In: I4e00f2e2289c1381f0238d2a4acb606a0ab551a9
Reported-by: katao@xiaomi.com
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-04 14:26:45 -07:00
Jayant Chowdhary
0a5bc29353 Merge "Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr." into pi-dev 2018-04-03 16:43:28 +00:00
Jayant Chowdhary
f4bda9a188 Add dummy vndk library libmkbootimg to enable abi checks on boot_img_hdr.
Bug: 74763691

Test: m -j libmkbootimg creates libmkbootimg.so.lsdump.

Test: make -j64

Merged-In: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
Change-Id: I8d716c560467aaf090f4f7ee9cfbc53a9405f05d
(cherry picked from commit 4cc755dce5)
2018-04-02 17:32:23 -07:00
TreeHugger Robot
0b637d94d6 Merge "storaged: fix divide-by-zero when updating history" into pi-dev 2018-04-03 00:12:17 +00:00
Hridya Valsaraju
88de5556ec Add a header-version argument to fastboot
The argument would set the boot header
version for flash:raw and boot
commands when they are used for boot
image creation.

Bug: 77154616
Test: Dumped the created boot image and checked
the header version using unpack_bootimg

Change-Id: I2c458996817615f4351db102b4234984108d47c0
2018-04-02 22:50:53 +00:00
Chia-I Wu
e3447826a8 Merge "graphics: add render intents and new color modes" into pi-dev 2018-04-02 22:22:28 +00:00
TreeHugger Robot
9d1f78358a Merge "Support Speck encryption." into pi-dev 2018-03-30 20:54:36 +00:00
Paul Crowley
49c27c5cb2 Support Speck encryption.
Test: Modified Pixel to support and use Speck encryption, booted.
Bug: 77227248
Change-Id: I6ec272db5e4f16e9dd4f759203c14ad2a8772cd1
2018-03-30 09:46:02 -07:00
Logan Chien
e9aaadfb2b Allow VNDK-SP extensions to use vendor lib
This commit adds a wildcard linker namespace link between the "vndk"
namespace and the "sphal" namespace of the system processes.  This is
created for VNDK-SP-Ext to load vendor libs in "sphal" namespace.

Bug: 77249955
Test: lunch aosp_walleye-userdebug && make -j8  # runs unit tests
Test: lunch aosp_sailfish-userdebug && make -j8  # runs unit tests
Test: Create a VNDK-SP-Ext, link to vendor libs, and run it.
Change-Id: I71b0fb604a84272156aa119130c272f891847008
Merged-In: I71b0fb604a84272156aa119130c272f891847008
(cherry picked from commit fbaf9767b51891491903521c24b0d4a1ec1c87e8)
2018-03-30 13:30:14 +08:00
TreeHugger Robot
adf13a65b9 Merge changes from topic "recovery-dtbo" into pi-dev
* changes:
  Add a script to unpack boot image
  Add a recovery DTBO section to boot image
2018-03-29 23:51:09 +00:00
TreeHugger Robot
bd920a25a9 Merge "Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode" into pi-dev 2018-03-29 23:45:15 +00:00
Elliott Hughes
465704dbb2 Merge "Add "require partition-exists=" support." into pi-dev 2018-03-29 22:12:50 +00:00
Hridya Valsaraju
d71e39ae57 Add a script to unpack boot image
The script prints out the boot image header
contents and extracts the kernel, ramdisk,
second bootloader and recovery DTBO images.

Bug: 74763691
Test: unpack_bootimg --boot_img $OUT/recovery.img

Change-Id: Iadbca81c157d9e4607f808a14468ab5542347507
Merged-In: Iadbca81c157d9e4607f808a14468ab5542347507
(cherry picked from commit 02c08cc347)
2018-03-29 21:35:46 +00:00
Jaekyun Seok
f328b0d935 Allow vendor-init-actionable for ro.board.platform and sys.boot_from_charger_mode
ro.board.platform and sys.boot_from_charger_mode are already
public-readable, but they should be used as action triggers as well for
some products including Android Go devices.

Bug: 75987246
Test: succeeded building and tested with taimen
Change-Id: I140a8f7ef3fa9823ceced94b00a413800518c240
Merged-In: I140a8f7ef3fa9823ceced94b00a413800518c240
(cherry picked from commit 1f90ccefb6)
2018-03-30 06:13:12 +09:00
Elliott Hughes
9b7cd9ad04 Add "require partition-exists=" support.
The Pixel 2 system images release was a bit of a disaster because anyone
using an old version of fastboot would blindly flash too few partitions,
potentially bricking their device. This change lets us add a line to
the android-info.txt file for a device with a new partition.

Also error out sooner in such cases by checking the requirements
immediately, rather than optimistically unpacking everything first.

Switch Action over to C++ to fix memory issues.

Bug: http://b/77158188 (partition checking)
Bug: http://b/74444116 (error out sooner)
Test: manual testing with a modified android-info.txt

(cherry picked from commit 5620d224b6)

Change-Id: Ib97af6f9392f7672430ff71228484e6ee7af6fbf
2018-03-29 10:46:46 -07:00
Hridya Valsaraju
6bacea2bec Add a recovery DTBO section to boot image
For non-A/B devices, the recovery partition should
be self-sufficient and not depend on any other
partition. Since recovery may need access to devices
added to the DT by overlays(for eg.display), we need to
make sure that the the recovery image also contains
the information from the DTBO image.

The following fields are added to the boot image
header for this purpose:
-boot header version
-header size
-recovery dtbo size
-recovery dtbo address

Bug: 74763691
Test: unpack_bootimage --boot_img $OUT/recovery.img
      diff out/extracted_dtbo $TOP/device/google/wahoo-kernel/dtbo.img

Change-Id: I1969859038b84fac1e4a71f79f2f546b9cacffc8
Merged-In: I1969859038b84fac1e4a71f79f2f546b9cacffc8
(cherry picked from commit 147b355bb3)
2018-03-29 17:31:10 +00:00
David Srbecky
12d902961b Cache DWARF location rules for a given pc.
Decoding the DWARF opcodes is expensive so make sure we cache it.

This speeds unwinding in simpleperf by over a factor of 3x.

Add unit tests for this new behavior.

Bug: 77258731

Test: libbacktrace/libunwindstack unit tests on host and target.
Test: Ran debuggerd -b on various processes on target.
Change-Id: Ia516c0fa5d3e5f76746190bb4b6fdf49fd1c9388
(cherry picked from commit 3386ebade2)
2018-03-29 08:47:49 -07:00
Christopher Ferris
8dc3f94113 Merge "Fix null pointer dereference in RegsArm." into pi-dev 2018-03-29 14:35:05 +00:00
Josh Gao
83ebd8da84 adb: fix windows test build.
The switch over to soong unintentionally turned off building the
Windows tests (and there's a bug preventing them from being turned on).
Preemptively fix the build breakages that'll happen when we turn them
back on.

Bug: http://b/74616284
Test: mma with Android.bp 's/cc_test_host/cc_binary_host' hacks
Change-Id: I6582cfc61b96052537d50d8ba90533dbb66e3e1d
(cherry picked from commit 2e1e789e2a)
2018-03-28 23:36:38 -07:00
Josh Gao
abb634308f adb: bump the local socket backlog to the maximum.
The listen backlog seems to be more meaningful on Darwin than on Linux,
resulting in connections failing with ECONNRESET. Bump it up to the
maximum supported value to make this less likely. 128 pending
connections ought to be enough for anybody.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: I5fe0205924188cf18ca1fc1204f923ab5523eeb2
(cherry picked from commit bf243a6128)
2018-03-28 23:36:34 -07:00
Josh Gao
cc9414eda4 adb: delete vestigial SHELL_EXIT_NOTIFY_FD.
There exists no path through which a value other than -1 can be written
to the SHELL_EXIT_NOTIFY_FD.

Bug: http://b/74616284
Test: adb_test
Test: adbd_test
Test: python test_device.py
Change-Id: I0630c302ba06bc76917f0445aea75d2dbe1dc865
(cherry picked from commit dcc055af64)
2018-03-28 23:36:32 -07:00
Josh Gao
7c87b0739a adb: don't immediately close a socket when write fails.
When we fail to write to a local socket peer, we might still have data
queued up to send to the other side. Defer closing the socket until
we've failed to both read and write.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: Ifc4b8fe95369b4872e475c2ae4ee611dd2d8b9d7
(cherry picked from commit 184f480547)
2018-03-28 23:36:28 -07:00
Josh Gao
3b0146cc37 adb: make fdevent_run_on_main_thread's fd nonblocking.
If we get a ton of fdevent_run_on_main_thread calls while running one
of the handlers, the socket might become full, which will result in a
deadlock in fdevent_run_on_main_thread when a write to the fd blocks
with the mutex taken. Resolve this by making the fd nonblocking, which
is safe because we always write after appending to the list, and read
before emptying the list, which guarantees that if the byte we write is
consumed, the std::function we appended will be run.

Bug: http://b/74616284
Test: adb_test
Test: python test_device.py
Change-Id: I29319bda2ad7b5a5cdcd91d1d0ddf39f7ab7d115
(cherry picked from commit 1222abc75b)
2018-03-28 23:36:24 -07:00
Josh Gao
9edb94fb6b adb: skip IPv6 test if IPv6 isn't available.
Bug: http://b/69813298
Test: none
Change-Id: I0793e793bd52c5f1c639faedf09a513df263db78
(cherry picked from commit 4abb5074be)
2018-03-28 23:36:20 -07:00
Josh Gao
fd6ffb8ad5 adb: add adb shell exit 42 stress test.
Add a test to hammer on `adb shell exit $n` for flakiness.

Bug: http://b/74616284
Test: python test_device.py
Change-Id: I6a842960f5b55ff739044698f5c9683992fc42f1
(cherry picked from commit c970aefada)
2018-03-28 23:36:17 -07:00
Josh Gao
e523e4e54b adb: improve socket tests.
Make it so that the socket tests don't leak until your machine blows up
by switching an infinite loop into an assertion failure.

Bug: http://b/74616284
Test: adb_test
Change-Id: If618c26b224b660548454f542cab79bebe46f80e
(cherry picked from commit ecb96ac04d)
2018-03-28 23:36:14 -07:00
Josh Gao
28589bbe18 adb: implement std::make_unique, start using it.
Add an implementation of std::make_unique for Windows, where we're
currently stuck with C++11, and switch some uses of new over to it.

Bug: http://b/74616284
Test: treehugger
Change-Id: I99b85f07754adda7c525243480c3e0bce9a25ce7
(cherry picked from commit 31b5be69f4)
2018-03-28 23:36:12 -07:00
Josh Gao
1430d39be6 adb: add test for flushing socket data after a write failure.
Add a currently failing test that's a reduced case of the 'concurrent
adb shell' flakiness reported in b/74616284.

Bug: http://b/74616284
Test: changed #if 0 to #if 1, test fails
Change-Id: Id170a185f7c5d2ff44f772f7849a73227f9df441
(cherry picked from commit df3bae9f06)
2018-03-28 23:36:09 -07:00
TreeHugger Robot
6c4ed57065 Merge "Adding odm.img for fastboot flashall" into pi-dev 2018-03-29 04:07:32 +00:00
Christopher Ferris
fd6b7284ee Fix null pointer dereference in RegsArm.
Fix RegsArm::GetPcAdjustment to check for an invalid elf before trying
to read memory.
Modify the tests for this so it crashes without this change.

Also modify the GetPcAdjustment for all different architectures so
that unless the relative pc is too small, it will return the minimum
amount that should be adjusted. This is to handle cases where we still
want to adjust the pc but it's in an invalid elf. Mostly this is for
handling cases when the pc is in jit gdb debug code so that we use the
right unwind information.

Bug: 77233204

Test: Passes unit tests for libbacktrace/libunwindstack.
Change-Id: Id73609adaf3b80a583584441de228156fec3afa7
(cherry picked from commit 6dbc28ece3)
2018-03-28 20:52:52 -07:00
Bowgo Tsai
de2472d63e Adding odm.img for fastboot flashall
Bug: 64195575
Test: fastboot flashall
Change-Id: Ie6c20a1004867e7c9cfa1894abab9252316a9154
Merged-In: Ie6c20a1004867e7c9cfa1894abab9252316a9154
(cherry picked from commit 017217ec57)
2018-03-29 08:18:37 +08:00
Jaekyun Seok
fce960cdf4 Allow vendor-init-actionable for ro.debuggable
Some partners are using ro.debuggable as action trigger to config a
product differently according to its value.

Bug: 75987246
Test: succeeded building and tested taimen
Change-Id: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
Merged-In: I4cc57e7b52e17fc89e585afa0a8a10925e47fac8
(cherry picked from commit 4f214c5179)
2018-03-29 04:21:22 +09:00
Tom Cherry
36a716dc1f Merge "Revert "fs_config: Move hostapd to /vendor/bin/hw"" into pi-dev 2018-03-28 18:30:49 +00:00
Tom Cherry
666464a180 Revert "fs_config: Move hostapd to /vendor/bin/hw"
This reverts commit 656b75c77c.

Capability bits are moving from fs_config.cpp to the associated init
scripts for daemons on /vendor.

Bug: 74554159
Test: wifi tethering works on walleye
2018-03-28 18:29:02 +00:00
Chia-I Wu
7d940ae4af graphics: add render intents and new color modes
Adds

  HAL_COLOR_MODE_BT2020 = 10,
  HAL_COLOR_MODE_BT2100_PQ = 11,
  HAL_COLOR_MODE_BT2100_HLG = 12,
  HAL_DATASPACE_BT2020_ITU_HLG = 302383104,
  HAL_DATASPACE_BT2020_HLG = 168165376,
  HAL_RENDER_INTENT_COLORIMETRIC = 0,
  HAL_RENDER_INTENT_ENHANCE = 1,
  HAL_RENDER_INTENT_TONE_MAP_COLORIMETRIC = 2,
  HAL_RENDER_INTENT_TONE_MAP_ENHANCE = 3,

by running update-base-files.sh.

Bug: 73824924
Test: manual
Change-Id: Ifde249074abf2228ebe016a38b5bcea8bccb5e9d
2018-03-28 10:23:09 -07:00
TreeHugger Robot
136f765fb3 Merge "lmkd: Protect against buffer overflow" into pi-dev 2018-03-28 01:44:33 +00:00
Greg Kaiser
d6d847142b lmkd: Protect against buffer overflow
We're passing a 'line' whose backing buffer is PAGE_MAX in size
into memory_stat_parse_line().  We protect overflowing the smaller
LINE_MAX 'key' buffer via some C preprocessing macros to assure
we limit the size.

Test: Local build with LMKD_LOG_STATS set for this file.
Bug: 76220622
Merged-In: I9e50d4270f7099e37a9bfc7fb9b9b95cc7adb086
Change-Id: I9e50d4270f7099e37a9bfc7fb9b9b95cc7adb086
2018-03-27 21:59:31 +00:00
David Anderson
7d74a5a2f2 storaged: fix divide-by-zero when updating history
Bug: 75984894
Test: storaged unit tests on x86/64 platforms
Change-Id: I8c491f70705c662d40d0b212bcbc43a0de279bec
Merged-In: I8c491f70705c662d40d0b212bcbc43a0de279bec
(cherry picked from commit f2dd78bb2c)
2018-03-27 14:51:28 -07:00
Christopher Ferris
af16967ec8 Method to avoid skipping frames for local unwinds.
In cases where there might be a crash in the unwind library itself,
we need a method to avoid skipping these frames or we won't be able
to see the actual crash.

Added unit test for this behavior.

Bug: 74121887

Test: Ran unit tests on host and target.
Change-Id: I45825020c174016af39dd8ffdc67acb72a24ad4d
(cherry picked from commit 458f4e725d)
2018-03-27 11:12:41 -07:00
Tom Cherry
677bed578e Merge "Verify the SELabels used in property_contexts" into pi-dev 2018-03-27 16:45:39 +00:00
TreeHugger Robot
88993acd95 Merge "Adding product.img for fastboot flashall" into pi-dev 2018-03-27 04:30:40 +00:00
Jerry Zhang
ca47ae3513 Merge "Remove sys.usb.ffs.mtp.ready property" into pi-dev 2018-03-27 02:49:02 +00:00
TreeHugger Robot
64250b5abe Merge "Allow android::base::ScopeGuard in STL containers" into pi-dev 2018-03-27 02:29:20 +00:00
Bowgo Tsai
7e50de4449 Adding product.img for fastboot flashall
Bug: 64195575
Test: fastboot flashall

Change-Id: Ifd119650dd3316508870df0dfc770099e95ae1d1
Merged-In: Ifd119650dd3316508870df0dfc770099e95ae1d1
(cherry picked from commit 0afc6b07f1)
2018-03-27 09:40:35 +08:00
Luis Hector Chavez
f6965c793a Allow android::base::ScopeGuard in STL containers
This change lets android::base::ScopeGuard be useful in STL containers
(e.g. std::vector<android::base::ScopeGuard<std::function<void()>>>). It
also provides perfect forwarding for android::base::make_scope_guard.

Bug: 34764308
Test: libbase_test

Change-Id: I7d1e5494b0f0695763cff0700efdb9ec18ae85c8
Merged-In: I7d1e5494b0f0695763cff0700efdb9ec18ae85c8
(cherry picked from commit b77035b89a)
2018-03-27 00:38:06 +00:00
Tom Cherry
daaf3aa226 Verify the SELabels used in property_contexts
Verify that the SELabels used in property_contexts correspond to a
real type in the SEPolicy and that this type has the property_type attribute.

Bug: 74078792
Test: Build property_contexts on bullhead successfully
Test: See failure when using a faulty SELabel in property_contexts
Change-Id: If1618c2c3dae4c0cd3efa5f88056478a6db6bd0b
(cherry picked from commit 882faa6448)
2018-03-26 16:32:05 -07:00
TreeHugger Robot
42c17c8ee5 Merge "Use usel_mkd_stats_log build variable while compiling lmkd with stats logging feature." into pi-dev 2018-03-26 23:14:23 +00:00
Rajeev Kumar
1c669f764d Fix compilation issue when LMKD_LOG_STATS is defined.
Note: The breakage was caused by http://ag/3621623

Test: mmma system/core/lmkd/
Change-Id: I17033aeedb3183d4777dacb89ec84430ff061b3c
Bug: 74443701
(cherry picked from commit fb25ddd9c9)
2018-03-26 18:15:25 +00:00