Commit Graph

53943 Commits

Author SHA1 Message Date
Treehugger Robot 7e5fb6b322 Merge "migrate *.libraries.txt from Make to Soong" 2019-11-08 04:04:14 +00:00
Treehugger Robot 71ed80a229 Merge "Add require_root for libcutils tests" 2019-11-07 23:34:24 +00:00
Tom Cherry e41aded12d Add require_root for libcutils tests
7 of these tests require root

Test: these tests pass as root
Change-Id: Ife4d1ae0c8fe8a2ace288c584ac044a37bae0b3e
2019-11-07 14:06:21 -08:00
Treehugger Robot ec56c59dbb Merge "healthd: Fix incorrect return check" 2019-11-07 21:18:59 +00:00
Paul Crowley 449282c021 Merge "Make encryption action an argument to mkdir" 2019-11-07 20:06:47 +00:00
Suren Baghdasaryan 7f44a83d8f Merge "Add libcutils_test into TEST_MAPPING" 2019-11-07 16:43:54 +00:00
Treehugger Robot ad3069eb72 Merge "Turn on executable bit on system_ext/bin" 2019-11-07 15:13:56 +00:00
Nikita Ioffe 7051bb3d74 Merge "userspace reboot: unmount apexes and switch to bootstrap namespace" 2019-11-07 12:09:46 +00:00
Jeongik Cha 4e467e71e9 Turn on executable bit on system_ext/bin
Setting executable bit on system_ext/bin is missing, so add them into
list.

Bug: 144066307
Test: m && check if system_ext/bin/* have execute permission.
Change-Id: I89c9e0d2d54f965ecd058bb9e77ba77b7ed164c1
2019-11-07 16:51:49 +09:00
Nikita Ioffe ab91ee986b userspace reboot: unmount apexes and switch to bootstrap namespace
This will bring device to the state closer to the one during normal boot

Bug: 135984674
Test: adb install system/apex/shim/com.android.apex.cts.shim.v1.apex
Test: adb reboot userspace
Test: verified install succeeded
Change-Id: I6ef73bde2ca817c8a62bf19b8f1895dd0d6d2829
2019-11-07 02:13:38 +00:00
Nikita Ioffe dbee3618be Merge "Make remount into checkpointing for ext4 userdata a no-op" 2019-11-07 02:12:57 +00:00
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
Nikita Ioffe 42697d3f18 Make remount into checkpointing for ext4 userdata a no-op
We are going to teamfood userspace reboot soon, and in order to gather
as much data as possible we are fine with ignoring checkpointing for the
devices with ext4 (teamfood will be a very limited set of people that
are aware what they've signed for).

As result of this, we don't need to reset vold and kill zram backing
device. Added a TODO to restore that functionality if needed.

Since I was there, fixed yet another typo in userspace-reboot-resume -_-

Bug: 135984674
Test: adb reboot userspace
Change-Id: I2b7a93aaf738fe9bec9d606d7e11aefb325550b1
2019-11-06 20:12:08 +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
Jooyung Han c2b56dc10e migrate *.libraries.txt from Make to Soong
Migrating these files to soong modules and those modules are defined
under /packages/modules/vndk since they are highly coupled with vndk.

Bug: 141450808
Test: m llndk.libraries.txt
Change-Id: Id33366f604e3e6696a9be95dc50f40d143325697
2019-11-06 16:55:32 +09: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
John Stultz 47a6bf014d healthd: Fix incorrect return check
In commit 1d4368b494 ("[REFACTOR] healthd: BatteryMonitor
use health 2.1 types"), the mapSysfsString() function was
changed to return NULL instead of -1 on error.

Everywher else that function is used commit 1d4368b494
tweaked the return value check from (ret < 0) to (!ret),
but one spot was missed.

This patch corrects the one missed check so that we compare
against null rather then negative value, since the return
value can no longer be negative.

This issue was found by inspection, and I've not seen an actual
problem with it, but thought it should be corrected.

Change-Id: I0a6564274d01276352a5dc0660b8ffbe748b5fde
Signed-off-by: John Stultz <john.stultz@linaro.org>
2019-11-06 01:40:18 +00: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
Paul Crowley 68258e8444 Make encryption action an argument to mkdir
FscryptSetDirectoryPolicy no longer tries to infer the action from the
filename. Well mostly; it still assumes top-level directories in /data
should be encrypted unless the mkdir arguments say otherwise, but
it warns.

Bug: 26641735
Test: boot, check log messages
Change-Id: Id6d2cea7fb856f17323897d85cf6190c981b443c
2019-11-05 16:26:43 -08: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