Commit graph

40067 commits

Author SHA1 Message Date
Josh Gao
2e05dfa2f2 adb: properly calculate packet size on Mac.
OS X reports maxPacketSize as wMaxPacketSize * (bMaxBurst + 1) in the
deprecated GetPipeProperties function. Use the also-deprecated
GetPipePropetiesV2 API to get bMaxBurst and figure out what
wMaxPacketSize is. (This file is going to go away eventually, so don't
bother with switching to the recommended GetPipePropertiesV3, since
it would be a substantially larger charge.)

libusb is unaffected.

Bug: http://b/77733422
Test: python test_device.py
Change-Id: I66517d699a4f39b93ba5eb7882bd8ee6c70f3672
(cherry picked from commit 2ea46521f3)
2018-04-11 11:44:26 -07:00
Mathew Inwood
8aafb0d7f5 Merge "Add event log tag for hidden API access logging." into pi-dev 2018-04-11 16:45:27 +00:00
TreeHugger Robot
44fd93d0d3 Merge "fastboot, fs_mgr: set fsverity feature bit" into pi-dev 2018-04-11 03:59:58 +00:00
TreeHugger Robot
aeee02f290 Merge "Use the non-LTO, non-PGO version of libhwbinder" into pi-dev 2018-04-10 18:14:42 +00:00
Mathew Inwood
8ec1c7ea7c Add event log tag for hidden API access logging.
This new event is logged by ART when hidden API accesses are detected.

Test: m
Test: $ adb lolcat -b events
Bug: 64382372
Bug: 77517571
Change-Id: I5ebb1424d83686dade0d34b118944b0c4c0c7bb1
2018-04-10 14:32:23 +01:00
Pirama Arumuga Nainar
9dddfbc77a Use the non-LTO, non-PGO version of libhwbinder
Bug: http://b/77320844

Android.mk doesn't have support for PGO either.  This causes linker
error (about missing __llvm_profile symbols) in the PGO-instrumentation
enabled builds in the release branch.

Test: m ANDROID_PGO_INSTRUMENT=ALL
Change-Id: I84fda4f1ac4f00ac26869507c6f5640b4ec9f6f3
2018-04-09 10:40:06 -07:00
Elliott Hughes
6d2f2135ee Merge "Support /odm and /product in "adb remount" and "adb sync"." into pi-dev 2018-04-09 15:41:00 +00:00
Yifan Hong
c867941783 Merge "health service can write kernel log" into pi-dev 2018-04-06 21:03:34 +00:00
TreeHugger Robot
715700a5a1 Merge "Use non-LTO variant of libhwbinder" into pi-dev 2018-04-06 20:25:02 +00:00
Jaegeuk Kim
b68b02ca5a fastboot, fs_mgr: set fsverity feature bit
Bug: 74604441
Bug: 67380979
Change-Id: Ia336be99eed42bbd0eab1b22e2cc3179a92d5233
Signed-off-by: Jaegeuk Kim <jaegeuk@google.com>
2018-04-06 10:18:21 -07:00
Luis Hector Chavez
2685c77c34 adb: Correctly drop caps when ambient capabilities are used
This change splits the capability-dropping step of adbd into two. This
is more robust when ambient capabilities are being used, since minijail
cannot currently handle that case.

Bug: 77146512
Test: grep Cap /proc/`pidof adbd`/status
      CapInh: 0000000000000000
      CapPrm: 0000000000000000
      CapEff: 0000000000000000
      CapBnd: 00000000000000c0
      CapAmb: 0000000000000000

Change-Id: I0476a8d80f7a2497600196932542045f3bc87537
Merged-In: I0476a8d80f7a2497600196932542045f3bc87537
(cherry picked from commit daacf4f6f3)
2018-04-06 06:40:14 -07:00
Elliott Hughes
792581f183 Support /odm and /product in "adb remount" and "adb sync".
Bug: http://b/77587036
Test: `adb remount` and `adb sync` still work on hikey

(cherry picked from commit 57e97cb7aa)

Change-Id: Ie49d703dac04e2fb8eda420b9253b8d45b6e1479
2018-04-05 19:45:27 -07:00
Yifan Hong
7eed10800e health service can write kernel log
Test: device without healthd still have battery level messages
Bug: 77541952
Fixes: 77661605
Change-Id: I9b66ecde0735accf8b2d67b9562795be80071dd9
2018-04-05 19:34:43 -07:00
TreeHugger Robot
a4217d03a7 Merge "Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger" into pi-dev 2018-04-05 22:34:43 +00:00
TreeHugger Robot
587004c48b Merge "Remove vendor Wifi and BT entries from fs_config.cpp" into pi-dev 2018-04-05 20:15:49 +00:00
Yifan Hong
7498160272 Merge changes from topic "healthd_deprecate2" into pi-dev
* changes:
  healthd: a.h.health@2.0-service.override removes healthd
  healthd: add healthd.rc
2018-04-05 19:30:35 +00:00
Christopher Ferris
6c985e2a08 Merge "Add a MemoryOfflineBuffer object." into pi-dev 2018-04-05 18:14:04 +00:00
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
Tom Cherry
07aa2a6131 Remove vendor Wifi and BT entries from fs_config.cpp
Their capability bits are now specified in their associated init .rc
file, which is the proper place for this to be done.

A notice is added to guide developers away from using android_files to
give services Linux capabilities and to guide them away from adding
vendor/ entries.

Bug: 74554159
Test: BT, Wifi, Tethering work on walleye
Merged-In: I13c425d022b4f5c217587cdf601884ef44650ac7
Change-Id: I13c425d022b4f5c217587cdf601884ef44650ac7
(cherry picked from commit b5e5c56401)
2018-04-05 10:40:49 -07:00
Jaekyun Seok
66797804c6 Allow vendor-init-actionable for wlan.driver.status and init.svc.surfaceflinger
They are being used as action triggers in some devices including Pixels.
So vendor-init-actionable should be allowed for them.

Bug: 74266614
Test: building succeeded and tested on a Pixel with
PRODUCT_COMPATIBLE_PROPERTY=true

Change-Id: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
Merged-In: I713c5c1a50053f8d64e1cecd1f7ab5dc18201da1
(cherry picked from commit 167ec7f1d2)
2018-04-05 23:08:39 +09: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
Yifan Hong
1cf853fb65 healthd: a.h.health@2.0-service.override removes healthd
Removes healthd from the build if -service.override
is provided. This encourages developers to deprecate healthd
for their devices when they can.

When -service.override is used, framework manifest needs
to remove the /backup instance as well; this can be done
by including manifest_healthd_exclude.xml in
DEVICE_FRAMEWORK_MANIFEST_FILE.

Test: build and boot on 2016/2017 Pixel devices
Test: build and boot on a new device
Test: lshal and vts_treble_vintf_test on all these
      devices
Bug: 77541952

Change-Id: I25744feaad3034441cd7a96a5343d4ce3eedc288
2018-04-04 14:43:58 -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
Yifan Hong
fd1aa70a0f healthd: add healthd.rc
Split healthd section from init.rc into its own. This allows
healthd.rc to be excluded from the build when healthd is excluded.

Test: builds
Test: exclude healthd from build, healthd.rc is not installed
Bug: 77541952
Change-Id: I1c055f14c5862631f359fd0029289da8f43af063
2018-04-04 14:08:04 -07:00
Christopher Ferris
f4e3ff6619 Add a MemoryOfflineBuffer object.
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
(cherry picked from commit 6633b0ca09)
2018-04-04 12:29:25 -07:00
Yi Kong
95958a74f6 Use non-LTO variant of libhwbinder
... as a workaround for build system does not currently infer non-LTO
usage from Android.mk.

Test: m
Bug: 77320844
Change-Id: Iefe5d08b907133b4cdf1516efee73b2c0161f77e
2018-04-03 12:43:13 -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