Commit graph

53928 commits

Author SHA1 Message Date
Suren Baghdasaryan
36973153fa Add libcutils_test into TEST_MAPPING
libcutils_test is fixed for all architectures and handles cases when
schedtune and/or cpuset cgroup controllers are not enabled. Include it
into presubmit test list.

Test: ran tests
Change-Id: I294220e18aae5e5760e7e6bdee7a2fe4d9c6d6a4
Signed-off-by: Suren Baghdasaryan <surenb@google.com>
2019-11-07 01:04:25 +00:00
Treehugger Robot
af7999097e Merge "BatteryMonitor: init health info properly." 2019-11-07 00:52:55 +00:00
Treehugger Robot
e4cb2c49e3 Merge "Move comments into selinux.h and fix" 2019-11-07 00:52:42 +00:00
Treehugger Robot
a8854d3460 Merge "Trace.h: explicitly use global namespace" 2019-11-07 00:18:29 +00:00
Treehugger Robot
0a4fcfb9cf Merge "libcutils: update fs_config tests for current behavior" 2019-11-06 23:23:07 +00:00
Elliott Hughes
56b266686a Merge "libbase: add a README.md covering the most frequent question." 2019-11-06 22:01:41 +00:00
Tom Cherry
f8baa897ec libcutils: update fs_config tests for current behavior
Update fs_config tests for the new behavior in
a8eb00720c.

Before the above CL, fs_config_cmp() would match any partition prefix
to any path, even if there is not a logical relationship between them.
For example, these two lines in the test the demonstrate the changed
behavior:

{ true,  "vendor/lib",             "system/vendor/lib/hw",    true },
{ true,  "system/vendor/lib",      "vendor/lib/hw",           true },

The first line should match and does; it is testing that files located
at system/vendor/lib/hw are matched by an fs_path_config entry
specified as vendor/lib.  This is to allow for applying the policy we
have for the vendor partition to files in /system/vendor in the case
that there is no vendor partition.

The second line should not match.  This is testing that a file
that's located at vendor/lib/hw is matched by an fs_path_config entry
specified as system/vendor/lib.  This is backwards; we do not want to
have policy specified for system/vendor to impact policy for the
vendor partition.

Also, we never have any relationships from /system/oem to /oem or
/system/odm to /odm, so these are logically unrelated and should fail
to match.  We do however have a relationship from /vendor/odm to /odm,
so this test is added.

Test: libcutils unit tests pass on CF
Change-Id: I026f0233e00bbd0aad9bc0fb701aef000d2a037c
2019-11-06 09:40:33 -08:00
Elliott Hughes
10dc4ca3cd libbase: add a README.md covering the most frequent question.
Test: N/A
Change-Id: Iebea3e74bb7d59778fa0d2342e51bb4ffc5450a3
2019-11-06 09:38:21 -08:00
Steven Moreland
5f46923634 Trace.h: explicitly use global namespace
Imagine an AIDL file:
  package android.foo;
  interface IFoo {}

The AIDL C++ backend will generate classes like "::android::foo::IFoo".
In order to avoid ODR conflict, the NDK (Stable C) backend linking
against libbinder_ndk puts everything under the "::aidl" namespace. So,
we have "::aidl::android::foo::IFoo". When using ScopedTrace in a class
implementing a class from this backend, there is this problem.

Bug: 141828236
Test: works
Change-Id: Iafadea11788d4c011229657b4f53063bcf65f8d8
2019-11-05 17:59:46 -08:00
Yifan Hong
6cabe9bbc7 BatteryMonitor: init health info properly.
HIDL enum values are zero initialized, not the first value
of the enum. They need to be initialized properly.

Test: pass
Change-Id: I2adb8b851e6ac607ac4f547a6a6600604d07816f
2019-11-06 01:37:01 +00:00
Daniel Colascione
2aabeed1fd Merge "Properly finish daemon init when initial USB scan complete" 2019-11-05 23:44:25 +00:00
Josh Gao
e24a4b37b4 Merge changes from topic "adbd_apex"
* changes:
  Move adbd to an apex.
  adbd: use libadbd_auth for authentication.
2019-11-05 23:36:39 +00:00
Tianjie Xu
7cfb77ed8d Merge "Grant adb auth under recovery for unlocked & userdebug devices" 2019-11-05 21:37:07 +00:00
Paul Crowley
f831f10abe Move comments into selinux.h and fix
Make comments imperative, remove redundant words, clarify API level.

Bug: 26641735
Test: treehugger
Change-Id: Icad6001321aa2274b70fdcc74f6fe176f0b2d0db
2019-11-05 09:48:24 -08:00
Elliott Hughes
4b3e5e1de8 Merge "Darwin: include <libgen.h> for basename(3)." 2019-11-05 05:05:38 +00:00
Elliott Hughes
f1b255a6ad Darwin: include <libgen.h> for basename(3).
Test: treehugger
Change-Id: I11858430f13cbb22895c9dd0befb8054308efb19
2019-11-04 19:27:33 -08:00
Tianjie Xu
a933b43c02 Grant adb auth under recovery for unlocked & userdebug devices
During automatic tests, we sometimes want to reboot the device out of
the rescue party remotely. And per http://go/recovery-adb-access, we
need to grant the adb authorization to enable the adb access. The auth
are only granted for userdebug devices and those with an unlocked
bootloader. Since the user can always flash a custom recovery image if
the bootloader is unlocked.

This cl ignores the ro.adb.secure property under recovery. The other
option is to default this property to 0 when building the boot/recovery
image.

Bug: 141247819
Test: unlock bootloader, run adb under recovery in user build
Change-Id: I424cfed5bf51a1e31d8687256ae4c6eaaa5e6249
2019-11-04 16:12:00 -08:00
Josh Gao
594f70ffb8 Move adbd to an apex.
Test: adb shell "su 0 readlink /proc/\`pidof adbd\`/exe"
Change-Id: I84dfe4d1b28b619f98c03a2c8eeef2c783d30af2
2019-11-04 15:52:16 -08:00
Josh Gao
275232667d adbd: use libadbd_auth for authentication.
Bug: http://b/137798163
Test: for i in `seq 1 100000`; do echo $i; adb wait-for-device shell "su 0 stop; su 0 start; sleep 10"; adb disconnect; done
Change-Id: Ie481e79a48c4aabf18ef797317ba18f207808c63
2019-11-04 15:46:20 -08:00
Yifan Hong
50e102c51d Merge changes from topic "libsnapshot_flash"
* changes:
  libsnapshot: Fix MergeCannotRemoveCow
  libsnapshot: fix re-flash after update
  [REFACTOR] libsnapshot: Add InitiateMergeAndWait
2019-11-04 22:10:05 +00:00
Daniel Colascione
3aef5c82f7 Properly finish daemon init when initial USB scan complete
Call adb_notify_device_scan_complete when we finish enumerating USB
devices. The original intent of the code appears to have been to have
adb_wait_for_device_initialization return as soon as we've finished
looking around at the system USB environment on daemon startup, but at
some point, we forgot to actually notify the init thread that we
finished scanning all the USB devices, forcing the wait on init_cv to
time out after three seconds on every daemon initialization.

After this change, the daemon starts in a few milliseconds on my Linux
machine

Test: killall adb && sleep 1 && time adb server && adb shell ls
Change-Id: I0bc1da7a597d2077dd2b591560d03798b05905b7
2019-11-04 11:43:20 -08:00
Nikita Ioffe
57292aa684 Merge "Fix typo in userspace-reboot-requested trigger" 2019-11-04 18:25:37 +00:00
Elliott Hughes
2ea7c7d39f Merge "unzip: fix Mac build." 2019-11-04 05:23:39 +00:00
Elliott Hughes
bcd810622b unzip: fix Mac build.
Turns out the Mac doesn't have <error.h>. Add our own "die" function
instead, and use it everywhere so the Mac isn't using an untested
codepath.

One upside to this is that we'll now call ourselves "unzip" even when
run as `ziptool unzip ...`, which was awkward to fix with <error.h> but
trivial if we're rolling our own anyway.

Test: still works on Linux
Change-Id: I9cb1922595a21cd9f6d55a70d67e30090f8b7f21
2019-11-03 08:30:33 -08:00
Yifan Hong
daabad7cd8 Merge "healthd: Remove libhealthd dependency from charger" 2019-11-01 23:46:31 +00:00
Treehugger Robot
7933195a36 Merge "Update OWNERS for libstatssocket" 2019-11-01 22:08:28 +00:00
Mark Salyzyn
283e41de76 Merge "first_stage_init: if console enabled allow for errors in module loading" 2019-11-01 21:52:42 +00:00
Mark Salyzyn
552bbdde38 Merge "libmodprobe: add strict bool argument to LoadListedModules" 2019-11-01 21:52:26 +00:00
Nikita Ioffe
ac692148e5 Fix typo in userspace-reboot-requested trigger
It should userspace-reboot-requested, not userspace-reboot

Test: adb reboot userspace
Bug: 135984674
Change-Id: I1e844b7705eb70ee3702a1dc0432644592666364
2019-11-01 20:56:33 +00:00
Ruchir Rastogi
2aa3d903da Update OWNERS for libstatssocket
Test: m -j libstatssocket compiles
Change-Id: I57bce83a88de51a7671b452afb5e251e9a61ffb3
2019-11-01 13:25:31 -07:00
Yifan Hong
94f476b01e Merge "init: hack for /charger symlink" 2019-11-01 18:23:46 +00:00
Jooyung Han
b435f68fd2 Merge "Use soong-generated vndk*libraries.txt files" 2019-11-01 01:57:50 +00:00
Yifan Hong
ace7795804 libsnapshot: Fix MergeCannotRemoveCow
The test is broken because now ProcessUpdateState
checks UPDATED flag as well, and partition "test-snapshot"
does not exist in super partition metadata.

Rewrite the test to mimic the update flow and use
as many public APIs as possible.

Test: libsnapshot_test
Bug: 143551390

Change-Id: I105bad8bb589616b304c511c64be902d4297bda7
2019-10-31 18:40:46 -07:00
Yifan Hong
46002d5c21 libsnapshot: fix re-flash after update
If device takes an update from slot A to
B, immediately flashes the B slot, and reboot
into B slot, libsnapshot incorrectly considers
the device booted into the new slot and refuses
to clear update states. Fix this by checking
the UPDATED flag in super partition metadata.

Test: libsnapshot_test
Bug: 143551390
Change-Id: I3cd7bb19b394da6399d4bf2f9d013bfaa7f186f1
2019-10-31 18:40:46 -07:00
Yifan Hong
8fb7f773f0 init: hack for /charger symlink
Legacy symlink from /charger to /system/bin/charger is
removed. Instead, all Android R devices are required
to use /system/bin/charger instead.

See hardware/interfaces/health/2.1/README.md for details.

Bug: 142286265
Test: charger mode
Change-Id: Ib478a864ef68647bc9fc14650ca3d382952b80c8
2019-10-31 18:37:02 -07:00
Yifan Hong
4913d7af12 [REFACTOR] libsnapshot: Add InitiateMergeAndWait
Move snapshot_ctl's merge command to SnapshotManager::
InitiateMergeAndWait function so that tests can use
it too.

Test: libsnapshot_test
Bug: 143551390

Change-Id: I0936c262afaca7ba445ee18465dca4e16b9416ad
2019-10-31 17:06:28 -07:00
Treehugger Robot
8578a8a8ec Merge "trusty-ut-ctrl: link statically to libtrusty" 2019-10-31 23:03:54 +00:00
Treehugger Robot
9495cda53b Merge "Update OWNERS based on Trusty team membership" 2019-10-31 22:40:33 +00:00
Matthew Maurer
d35f685a7c Update OWNERS based on Trusty team membership
Change-Id: Iafad614b6568e53209752b1c45f0f0209c95684b
2019-10-31 13:32:20 -07:00
Mark Salyzyn
a7144f7eb2 first_stage_init: if console enabled allow for errors in module loading
Allow for module load errors if first stage console is enabled, userdebug
development builds, load what you can and continue.

Test: compile
Bug: 141311820
Change-Id: I30f3ee1129373f6ffedcf03807c212c60d4c39aa
2019-10-31 10:30:45 -07:00
Mark Salyzyn
d478271b2b libmodprobe: add strict bool argument to LoadListedModules
Continue loading remaining modules after error if strict flag false.

Test: libmodprobe_test
Bug: 141311820
Change-Id: Ib21d4eade1254b16621e7bf2c9efaa173092e7c7
2019-10-31 10:30:35 -07:00
Elliott Hughes
4645210097 Merge "Remove Mac/Windows quick_exit() implementation." 2019-10-31 14:44:20 +00:00
Tom Cherry
0ae1272269 Merge changes from topic "logcatd-shell"
* changes:
  logcat: fix logpersist.stop and logpersist.clear
  logcat: fix logcatd / logpersist
2019-10-31 13:45:21 +00:00
Tom Cherry
2249b07eb8 logcat: fix logpersist.stop and logpersist.clear
Test: these work
Change-Id: Ib0b0b5408c93a05f39d1b585256a2c7c34736e7e
2019-10-31 06:43:47 -07:00
Tom Cherry
98c6c3304a logcat: fix logcatd / logpersist
Removing the rest of liblogcat broke logcatd since LogcatPanic() now
actually calls exit(), whereas logcatd relied on it to return
normally.

We can achieve the expected behavior with a small shell script, so
this change does that as well.

Test: logcatd / logpersist work
Change-Id: Icde36a4811a0db987a801978485e1af1dfc3d38c
2019-10-31 06:43:47 -07:00
Treehugger Robot
e88b568442 Merge "COW device initialized by zeroing the whole first chunk" 2019-10-31 11:19:56 +00:00
Paul Crowley
7df60cee92 Merge "fs_mgr: Add stable_inodes flag to encrypted ext4" 2019-10-31 03:17:23 +00:00
Jooyung Han
a18363cb97 Use soong-generated vndk*libraries.txt files
linkerconfig reads vndk-related libraries.txt files. Now these files are
generated by soong.

Bug: 142963962
Bug: 141450808
Test: m && device boots && TH
Change-Id: I98c2f934815238cacd4ec8536ce2f9f24bbf1b32
2019-10-31 11:40:22 +09:00
David Anderson
c399ccb345 Merge "fastboot: Implement helper commands for Virtual A/B." 2019-10-31 01:11:49 +00:00
David Anderson
ab8f466107 fastboot: Implement helper commands for Virtual A/B.
This introduces two new commands to the fastboot protocol:

  - getvar snapshot-update-status - Return "none", "snapshotted", or
    "merging" depending on the current status set by the boot control
    HAL.
  - snapshot-update [cancel] - Cancel any pending snapshot-based updates
    via the boot control HAL. After this, the HAL should return
    MergeStatus::CANCELLED and "update-merge-status" should be "none".
    If no argument is specified, the snapshot-update-status is returned
    via an INFO response.

Bootloaders are expected to implement this in a manner consistent with
the boot control HAL.

Fastboot-based tooling should expect wipes of userdata to fail when
update-merge-status returns "merging". Thus, the force flag now cancel
any pending snapshots.

Bug: 139154945
Test: fastboot getvar snapshot-update-status
      fastboot snapshot-update cancel
      fastboot snapshot-update

Change-Id: Idc423fe7656b212e929e64eb0e6b85b453e0e8dc
2019-10-31 01:11:16 +00:00