Commit graph

58998 commits

Author SHA1 Message Date
Automerger Merge Worker
6a0d14ac15 Merge "adbd: shrink libadbd.so, libadbd_services.so." am: cb76bf0558 am: e7d5ae30c6
Change-Id: I55dd7c315e2222584972ded39571d845a3f7fffa
2020-03-16 21:38:02 +00:00
Automerger Merge Worker
e7d5ae30c6 Merge "adbd: shrink libadbd.so, libadbd_services.so." am: cb76bf0558
Change-Id: I4546c84bfcff6a43ba5f94558d69aeea084003d3
2020-03-16 21:25:10 +00:00
Treehugger Robot
cb76bf0558 Merge "adbd: shrink libadbd.so, libadbd_services.so." 2020-03-16 21:05:28 +00:00
Automerger Merge Worker
626b6c2325 Merge "init: use a no-op signal handler instead of SIG_IGN for SIGPIPE" am: 4a02b23d92 am: e7033d9c6d
Change-Id: I800b3b6fe7556f39fd0e5c209073422df9ae9952
2020-03-16 19:51:59 +00:00
Automerger Merge Worker
e7033d9c6d Merge "init: use a no-op signal handler instead of SIG_IGN for SIGPIPE" am: 4a02b23d92
Change-Id: I6850984f0796c371e70c5c0fad1570bf7522dc1f
2020-03-16 19:37:32 +00:00
Automerger Merge Worker
9893e49082 [automerger skipped] Merge changes Ice773436,Ib8a4835c into rvc-dev am: adc2a7c520 -s ours
am skip reason: Change-Id Ice773436e85d3bf636bb0a892f3f6002bdf996b6 with SHA-1 802864c782 is in history

Change-Id: I5d9baa362fe10e66c7043f47aff86ce6d63e83a0
2020-03-16 19:25:53 +00:00
Tom Cherry
4a02b23d92 Merge "init: use a no-op signal handler instead of SIG_IGN for SIGPIPE" 2020-03-16 19:22:34 +00:00
Tom Cherry
adc2a7c520 Merge changes Ice773436,Ib8a4835c into rvc-dev
* changes:
  init: handle property messages asynchronously #2
  Revert "init: handle property service callbacks asynchronously"
2020-03-16 19:09:36 +00:00
Josh Gao
c151a1ba28 adbd: shrink libadbd.so, libadbd_services.so.
We were ending up with multiple copies of the proto runtime in the
recovery image, when we need zero.

Before:
    784K	recovery/root/system/lib64/libadbd_services.so
    832K	recovery/root/system/lib64/libadbd.so

After:
    360K	recovery/root/system/lib64/libadbd_services.so
    344K	recovery/root/system/lib64/libadbd.so

Bug: http://b/150317254
Test: treehugger
Change-Id: I39fbb3959128994f0de2ae0ea47dbc0800c516fe
2020-03-16 11:30:09 -07:00
Tom Cherry
fd470e87cc init: use a no-op signal handler instead of SIG_IGN for SIGPIPE
We want to ignore SIGPIPE within init, but if we use SIG_IGN, that
would be inherited by child processes through exec(), which we do not
want to have happen.  We instead set up a real signal handler with a
no-op handler function, that will ignore SIGPIPE within init, but will
not be inherited across exec().

This fixes c29c2baa69 ("init: Add support for native service
registration with lmkd"), when SIG_IGN was introduced.
Note that we caught this issue before shipping a release with that
change, so the major motivation here is to not cause a behavior change
in init.

Bug: 151581751
Test: children of init that don't explicitly block SIGPIPE exit when
      sent SIGPIPE
Test: children of init that do explicitly block SIGPIPE do not exit
      when sent SIGPIPE
Test: init does not exit when sent SIGPIPE
Test: init exits when sent SIGABRT
Change-Id: Ieda8555fd03836bcd672a422fe673a8369ad9beb
2020-03-16 10:31:34 -07:00
Tom Cherry
0c19d6c99f init: handle property messages asynchronously #2
A previous change moved property_service into its own thread, since
there was otherwise a deadlock whenever a process called by init would
try to set a property.  This new thread, however, would send a message
via a blocking socket to init for each property that it received,
since init may need to take action depending on which property it is.
Unfortunately, this means that the deadlock is still possible, the
only difference is the socket's buffer must be filled before init deadlocks.

This change, therefore, adds the following:
1) A lock for instructing init to reboot
2) A lock for waiting on properties
3) A lock for queueing new properties

A previous version of this change was reverted and added locks around
all service operations and allowed the property thread to spawn
services directly.  This was complex due to the fact that this code
was not designed to be multi-threaded.  It was reverted due to
apparent issues during reboot.  This change keeps a queue of processes
pending control messages, which it will then handle in the future.  It
is less flexible but safer.

Bug: 146877356
Bug: 148236233
Bug: 150863651
Bug: 151251827
Test: multiple reboot tests, safely restarting hwservicemanager
Merged-In: Ice773436e85d3bf636bb0a892f3f6002bdf996b6
Change-Id: Ice773436e85d3bf636bb0a892f3f6002bdf996b6
(cherry picked from commit 802864c782)
2020-03-16 09:21:18 -07:00
Tom Cherry
0188274148 Revert "init: handle property service callbacks asynchronously"
This is apparently causing problems with reboot.

This reverts commit d2dab830d3.

Bug: 150863651
Test: build
Merged-In: Ib8a4835cdc8358a54c7acdebc5c95038963a0419
Change-Id: Ib8a4835cdc8358a54c7acdebc5c95038963a0419
2020-03-16 09:20:22 -07:00
Automerger Merge Worker
eb2f13b8e8 [automerger skipped] Merge "Convert gsid to use the dynamic AIDL service infrastructure" into rvc-dev am: e3a22ca19d -s ours
am skip reason: Change-Id Ia5f32579a8dcf62d700d974c7f4e3c65647f3b8b with SHA-1 f6abdf6e0d is in history

Change-Id: Id8977e85ca282f029babf366881a283d64329967
2020-03-16 07:15:05 +00:00
PO HUNG CHEN
e3a22ca19d Merge "Convert gsid to use the dynamic AIDL service infrastructure" into rvc-dev 2020-03-16 06:56:16 +00:00
Automerger Merge Worker
2d5553a77d Merge "Restore fastboot delete-logical-partition command for VTS" am: 01c8eccca3 am: cabb934d41
Change-Id: I3ba780cafca58ddf742fbd53b5a67ae38ec6b64a
2020-03-15 23:00:28 +00:00
Automerger Merge Worker
cabb934d41 Merge "Restore fastboot delete-logical-partition command for VTS" am: 01c8eccca3
Change-Id: I6667ecf7dafc16f800ca5d5bbb0908ec024a040c
2020-03-15 22:44:06 +00:00
Treehugger Robot
01c8eccca3 Merge "Restore fastboot delete-logical-partition command for VTS" 2020-03-15 22:28:34 +00:00
Automerger Merge Worker
cde607bfed Merge "Implement the new v4 signing scheme in adb" into rvc-dev am: 742ef23ee9
Change-Id: I1f30ddb248fca223a47a532ad8d02e5dcc6a0c59
2020-03-14 02:35:08 +00:00
TreeHugger Robot
742ef23ee9 Merge "Implement the new v4 signing scheme in adb" into rvc-dev 2020-03-14 02:28:40 +00:00
Automerger Merge Worker
5377188a43 Merge "Set GC threshold when mounting with checkpointing" into rvc-dev am: 9cfc622cb2
Change-Id: I0de0e72cb4ae834c28f54f21f1f8a7fa73ab3833
2020-03-14 00:25:44 +00:00
Daniel Rosenberg
9cfc622cb2 Merge "Set GC threshold when mounting with checkpointing" into rvc-dev 2020-03-14 00:09:18 +00:00
Automerger Merge Worker
1e91c993c2 [automerger skipped] Merge "liblog: move LOG_ID_DEFAULT into the log_id enum" into rvc-dev am: bec237bdee -s ours
am skip reason: Change-Id Id67203bbfbc3e116b6b6efd40428afe48203dcfc with SHA-1 6085cd5a64 is in history

Change-Id: I858a04a8ee2d28599b5f0105919ffffb5e230cf9
2020-03-14 00:01:14 +00:00
TreeHugger Robot
bec237bdee Merge "liblog: move LOG_ID_DEFAULT into the log_id enum" into rvc-dev 2020-03-13 23:57:30 +00:00
Automerger Merge Worker
1283ef04b5 [automerger skipped] Merge "liblog: fix header guards ordering" into rvc-dev am: 8a1aba349c -s ours
am skip reason: Change-Id I2e0bc055ac0c7ba8262875801cdaed9cc30d2cef with SHA-1 227ac56454 is in history

Change-Id: Ifc303527ec4a360247213698fce6a54ba43676b6
2020-03-13 23:56:38 +00:00
Automerger Merge Worker
f745ce5184 [automerger skipped] liblog: use int32_t and uint32_t for new NDK APIs am: a9a6d49ec0 -s ours
am skip reason: Change-Id I0c1dd57f7499e432bb881e1da1beb55f1ff7de05 with SHA-1 f1a975bece is in history

Change-Id: Iab9e62aa760829029ba7b5f17ff0f5ba5d812940
2020-03-13 23:56:21 +00:00
TreeHugger Robot
8a1aba349c Merge "liblog: fix header guards ordering" into rvc-dev 2020-03-13 23:46:52 +00:00
Tom Cherry
1dc67f3015 liblog: fix header guards ordering
__ANDROID_API__ isn't defined on host, so this check will fail due to
-Wundef.  The || is short circuited through, so we can check for host
first and only have the right side of the || evaluated for device
builds.

Bug: 150898477
Bug: 151255209
Test: build
Merged-In: I2e0bc055ac0c7ba8262875801cdaed9cc30d2cef
Change-Id: I2e0bc055ac0c7ba8262875801cdaed9cc30d2cef
(cherry picked from commit 227ac56454)
2020-03-13 14:12:46 -07:00
Tom Cherry
bc2e58d6c2 liblog: move LOG_ID_DEFAULT into the log_id enum
As requested during the API review.

Bug: 150898477
Test: liblog and libbase unit tests
Merged-In: Id67203bbfbc3e116b6b6efd40428afe48203dcfc
Change-Id: Id67203bbfbc3e116b6b6efd40428afe48203dcfc
(cherry picked from commit 6085cd5a64)
2020-03-13 14:10:08 -07:00
Tom Cherry
a9a6d49ec0 liblog: use int32_t and uint32_t for new NDK APIs
As requested during the API review.

Bug: 150898477
Test: liblog and libbase unit tests
Merged-In: I0c1dd57f7499e432bb881e1da1beb55f1ff7de05
Change-Id: I0c1dd57f7499e432bb881e1da1beb55f1ff7de05
(cherry picked from commit f1a975bece)
2020-03-13 14:09:59 -07:00
Automerger Merge Worker
40d3e4fc42 Merge "init: handle property messages asynchronously #2" am: a0702789d5 am: 38d2c7709a
Change-Id: I0e372c7a76fd0e2a0639d9df4a24bfcbc83aab32
2020-03-13 21:01:06 +00:00
Automerger Merge Worker
38d2c7709a Merge "init: handle property messages asynchronously #2" am: a0702789d5
Change-Id: I9b9a21d5eb365fb7383cb45354d63f43d5d0fe31
2020-03-13 20:48:12 +00:00
Automerger Merge Worker
0687292e09 Merge "Support atom-level annotations within AStatsEvent" into rvc-dev am: e4e0566e02
Change-Id: I909a789ea2c0f7759d28cce06abbd25e5d40274a
2020-03-13 20:31:35 +00:00
Tom Cherry
a0702789d5 Merge "init: handle property messages asynchronously #2" 2020-03-13 20:30:14 +00:00
Ruchir Rastogi
e4e0566e02 Merge "Support atom-level annotations within AStatsEvent" into rvc-dev 2020-03-13 20:16:51 +00:00
Daniel Rosenberg
7c59f1ae9d Set GC threshold when mounting with checkpointing
This steps up our garbage collection threshold over time when mounting
userdata with checkpointing=disable for f2fs. With this scheme, we step
up the percent of disk we will tolerate being unusable during
checkpointing. At 100%, the filesystem will be able to always mount.
This means we will attempt to mount at most 10 times, for a max time of
about 50 seconds.

Also logs mount time under ro.boottime.init.mount.[target]

If the device does not support checkpoint=disable:[n%], it will mount
with checkpoint=disable, which is equivalent to checkpoint=disable:0%

Test: Boot in checkpointing mode
Bug: 150506496
Change-Id: I047ff98513f4ea832e1216b91e454a57fd2e8bf6
2020-03-13 20:12:02 +00:00
Automerger Merge Worker
980e2a79f1 [automerger skipped] Merge "init.rc: disable kernel module autoloading" into rvc-dev am: fcdaee4861 -s ours
am skip reason: Change-Id I4132fe1a491e7b789311afcf693c1f6493fb9dc5 with SHA-1 843f46e674 is in history

Change-Id: I6d6130bd197b3fbd2df32f8d387d1e58ac1526e5
2020-03-13 19:26:19 +00:00
Eric Biggers
fcdaee4861 Merge "init.rc: disable kernel module autoloading" into rvc-dev 2020-03-13 19:10:19 +00:00
Alex Buynytskyy
33ac1b05f9 Implement the new v4 signing scheme in adb
To be submitted along with changes in apksigner tool and the framework.
Merged to AOSP after that.

Test: adb install --incremental <apk>

go/apk-v4-signature-format

Bug: b/151241461
Change-Id: I26e187f8e389e31e2759037057b96fc6c9cb1e94
2020-03-13 11:04:17 -07:00
Automerger Merge Worker
8a4bc851e4 Merge changes Id67203bb,I0c1dd57f am: c74afeaa8b am: b9b4a4489d
Change-Id: I5e629c025c198c0f07cd4d05dff2c757f232bd66
2020-03-13 16:34:31 +00:00
Automerger Merge Worker
b9b4a4489d Merge changes Id67203bb,I0c1dd57f am: c74afeaa8b
Change-Id: Ia0599ca98ff5e7914e1ccad0a148e6bc2628b8e0
2020-03-13 16:27:57 +00:00
Automerger Merge Worker
ff651c06b8 Merge "liblog: fix header guards ordering" am: cd61376986 am: 8493f16832
Change-Id: Ia07ce585835d447a9ad468d58457ce635f85a957
2020-03-13 16:27:42 +00:00
Tom Cherry
c74afeaa8b Merge changes Id67203bb,I0c1dd57f
* changes:
  liblog: move LOG_ID_DEFAULT into the log_id enum
  liblog: use int32_t and uint32_t for new NDK APIs
2020-03-13 16:10:35 +00:00
Automerger Merge Worker
8493f16832 Merge "liblog: fix header guards ordering" am: cd61376986
Change-Id: I060d05016fe048c7f643f30f62f476ac190dd846
2020-03-13 16:03:13 +00:00
Tom Cherry
cd61376986 Merge "liblog: fix header guards ordering" 2020-03-13 15:48:19 +00:00
Automerger Merge Worker
1939280381 Merge "adb: support wait-for- with multiple states." am: 4fe694a9c1 am: a13edaac4e
Change-Id: Ia1b1aaf24eb18adf9d3905d6e43ec40367af366a
2020-03-13 15:43:21 +00:00
Automerger Merge Worker
a13edaac4e Merge "adb: support wait-for- with multiple states." am: 4fe694a9c1
Change-Id: Icd22ce47af70439a3ab3d28006e8a777585937ed
2020-03-13 15:30:59 +00:00
Elliott Hughes
4fe694a9c1 Merge "adb: support wait-for- with multiple states." 2020-03-13 15:19:34 +00:00
Automerger Merge Worker
b45c98f856 [automerger skipped] Merge "Make libselinux a stub library" into rvc-dev am: a94047be70 -s ours
am skip reason: Change-Id If418cbe3abdeacb759d59052e6dca4c2067678dd with SHA-1 3ffdad0cb5 is in history

Change-Id: If52caf2e5cc308faef47086fbd749e731eeb1caa
2020-03-13 05:39:31 +00:00
Jiyong Park
a94047be70 Merge "Make libselinux a stub library" into rvc-dev 2020-03-13 05:16:49 +00:00
Jiyong Park
8ce4a3067c Make libselinux a stub library
libselinux is currently being copied to APEXes. This is risky because
the library is not designed to be portable; part of it is tied to the
specific version of the Android that it was developed for.

This change fixes the problem by declaring that the library supports
a stub with the list of C APIs that are included in the stub. Then there
is only one copy of libselinux in /system/lib and other APEXes use the
copy by dynamically linking to it.

Also, adbd no longer statically links to it, because doing so brings
libselinux in it.

Bug: 151053366
Test: m com.android.adbd. It doesn't include libselinux in it.
Test: m com.android.adbd-deps-info. then inspect
out/soong/com.android.adbd-deps-info.txt. The dependency to libselinux
is shown as '(external)'.

Exempt-From-Owner-Approval: cherry-pick from AOSP

Merged-In: If418cbe3abdeacb759d59052e6dca4c2067678dd
(cherry picked from commit 3ffdad0cb5)
Change-Id: If418cbe3abdeacb759d59052e6dca4c2067678dd
2020-03-13 05:16:28 +00:00