Commit graph

59033 commits

Author SHA1 Message Date
Yurii Zubrytskyi
4e7bede912 Merge changes Ifda7de48,Ie33505f9 into rvc-dev am: c2872d831d
Change-Id: I632830b0a15bdada757230c2a1d6ec4f48ce51ee
2020-03-18 03:38:50 +00:00
Yurii Zubrytskyi
c2872d831d Merge changes Ifda7de48,Ie33505f9 into rvc-dev
* changes:
  [adb incremental] send priority blocks first
  [adb data server] wait for installation results before terminates
2020-03-18 03:21:24 +00:00
Songchun Fan
8cdefd4f95 [adb incremental] send priority blocks first
Before this change, "Success" is returned after all data is streamed,
around 7.5 seconds for Megacity.

After this change, "Success" is returned in about 1.5 seconds, before
streaming finishes.

BUG: 151676293
Test: manual
Change-Id: Ifda7de48da8e82623c99ae0194f70cb162fd72fa
2020-03-17 20:19:49 -07:00
Songchun Fan
c4a9d16ef1 [adb data server] wait for installation results before terminates
Currently the server often quits before installation finishes. As a
result, there is no difference in the commandline output between a
successful installation and a failed one.

Let adb client wait till installation fails or succeeds by parsing the
output from the inc-server process.

Test: $ adb install --incremental ~/Downloads/base.apk
Test: Performing Incremental Install
Test: Serving...
Test: All files should be loaded. Notifying the device.
Test: Failure [INSTALL_PARSE_FAILED_NOT_APK: Failed to parse /data/app/vmdl749343150.tmp/base.apk: Failed to load asset path /data/app/vmdl749343150.tmp/base.apk]
Test: Install command complete (ms: 91 total, 0 apk prep, 91 install)

BUG: b/150865433
Change-Id: Ie33505f9cc08fc6d60ad4a5d709526e7aa9a0ad1
2020-03-17 20:19:47 -07:00
TreeHugger Robot
f7247f080b Merge "base: dlopen/dlsym for liblog when SDK_VER <= 29" into rvc-dev am: 2e46b62e6c
Change-Id: I3a4a6dde6867b49ae23212189ff877f95e9d1da0
2020-03-18 01:14:04 +00:00
TreeHugger Robot
2e46b62e6c Merge "base: dlopen/dlsym for liblog when SDK_VER <= 29" into rvc-dev 2020-03-18 00:58:01 +00:00
Treehugger Robot
ec68fc521d Merge "libziparchive: move the array of error strings into the implementation." am: b962d6bee5 am: 8289cce4e1
Change-Id: I91ce79ebbbcbea7635c05c51aa7ac96d3182cde2
2020-03-18 00:02:22 +00:00
Treehugger Robot
8289cce4e1 Merge "libziparchive: move the array of error strings into the implementation." am: b962d6bee5
Change-Id: I459ee083a27c8c2d14079376dc9fc70b35a68007
2020-03-17 23:42:22 +00:00
Treehugger Robot
b962d6bee5 Merge "libziparchive: move the array of error strings into the implementation." 2020-03-17 23:25:45 +00:00
Tom Cherry
2beb180560 Merge "liblog: correct new APIs per the API review" into rvc-dev am: 4b0161cd3e
Change-Id: I071b2971b6aa48132df9517cd7dc5d71520b9a8f
2020-03-17 21:39:00 +00:00
Tom Cherry
4b0161cd3e Merge "liblog: correct new APIs per the API review" into rvc-dev 2020-03-17 21:17:01 +00:00
Elliott Hughes
bda268636a libziparchive: move the array of error strings into the implementation.
Test: treehugger
Change-Id: Iaffc29f77912d268c3335b74eb712a58914ce945
2020-03-17 14:10:59 -07:00
Steven Moreland
cb5f45725c Merge "init: init_kill_services_test" am: df78c43412 am: be9c155e8f
Change-Id: I244a48dede5ea5011fa9c26a210087fe3cd585b5
2020-03-17 21:07:25 +00:00
Steven Moreland
be9c155e8f Merge "init: init_kill_services_test" am: df78c43412
Change-Id: I4ed76484d0921174e32ac4ef9dafbe587704bc07
2020-03-17 20:46:03 +00:00
Steven Moreland
df78c43412 Merge "init: init_kill_services_test" 2020-03-17 20:30:49 +00:00
Automerger Merge Worker
c06969c034 Merge "Move the implementation of cd entry map to a separate file" am: 780528e86b am: 47f4d14e78
Change-Id: Iec8b1726226e86b1008db6c8156642bd48e7faa8
2020-03-17 19:28:15 +00:00
Automerger Merge Worker
716ee97737 Merge "Add std::map implementation for cd entry map" am: f496d286c6 am: f1c48d51ba
Change-Id: I55b8aafa4b1aa1240c8707283cf785e990ae580a
2020-03-17 19:27:52 +00:00
Automerger Merge Worker
47f4d14e78 Merge "Move the implementation of cd entry map to a separate file" am: 780528e86b
Change-Id: I544a6650ef20d6599e2857064941931b44013306
2020-03-17 19:12:30 +00:00
Automerger Merge Worker
f1c48d51ba Merge "Add std::map implementation for cd entry map" am: f496d286c6
Change-Id: If34072616b7e78671ac2be87832a550920278530
2020-03-17 19:11:45 +00:00
Tianjie Xu
780528e86b Merge "Move the implementation of cd entry map to a separate file" 2020-03-17 19:00:36 +00:00
Tianjie Xu
f496d286c6 Merge "Add std::map implementation for cd entry map" 2020-03-17 19:00:23 +00:00
Steven Moreland
6cce3f7f90 init: init_kill_services_test
Kill processes and make sure the phone recovers. This adds a basic level
of testing, but it could be improved by:
- trying to kill all running processes on the device
- improving metrics for 'recovery'

Bug: 148236233
Test: init_kill_services_test
Change-Id: I8aaca7bf4bb0be588decf741d1f6e1c5787cea84
2020-03-17 10:58:02 -07:00
Automerger Merge Worker
ab43bfb170 Merge "freezer: allow dynamic changes to freezer.state" into rvc-dev am: 3eb99ecf0f
Change-Id: Ic3db6564a360117d748fabcec29106e695e737a8
2020-03-17 16:24:31 +00:00
Marco Ballesio
3eb99ecf0f Merge "freezer: allow dynamic changes to freezer.state" into rvc-dev 2020-03-17 16:07:27 +00:00
Jooyung Han
22207e6590 base: dlopen/dlsym for liblog when SDK_VER <= 29
libbase doesn't have to rely on dlopen/dlsym to use liblog's new symbols
when it is built for __ANDROID_SDK_VERSION__ > 29.

Bug: 150860940
Test: TARGET_BUILD_APPS="com.android.adbd com.android.resolv" m
      objdump -T ...shared_com.android.resolv/libbase.so | grep LIBLOG_R
        => should be none because resolv apex is targeting 29
      objdump -T ...shared_com.android.adbd/libbase.so | grep LIBLOG_R
        => should list all new symbols because adbd apex is targeting R
      objdump -T ...shared/libbase.so | grep LIBLOG_R
        => should list all new symbols

Change-Id: I7f7f16510d7637cd380fe35ea9ff3e804f38851d
2020-03-17 14:04:01 +09:00
Automerger Merge Worker
e832ae0471 [automerger skipped] init: Fix restorecon for /metadata. am: 054e6a388e -s ours
am skip reason: Change-Id I1f928f519ae2c75aeedb74b70d513743e86bcf2b with SHA-1 4bb500fa9a is in history

Change-Id: I865a88b0590d57d72bc82bb8b381376c07993bce
2020-03-17 00:55:02 +00:00
Tianjie Xu
323c09c3d0 Move the implementation of cd entry map to a separate file
Move the entry map classes to a separate file to make the hierarchy
clear.

Test: unittests pass
Change-Id: Ie01d7835359daa4f59af75a0eda204c696d5658e
2020-03-16 17:43:49 -07:00
Automerger Merge Worker
109b59aaa0 Merge "init: Fix restorecon for /metadata." am: 8a178c184f am: c5aca531a5
Change-Id: I52ade85cf346695f3fc089c303821f3f81b1d0e3
2020-03-17 00:18:16 +00:00
Automerger Merge Worker
c5aca531a5 Merge "init: Fix restorecon for /metadata." am: 8a178c184f
Change-Id: I69af5d614fb92522c301249289ac60867df8370a
2020-03-17 00:00:59 +00:00
David Anderson
8a178c184f Merge "init: Fix restorecon for /metadata." 2020-03-16 23:40:16 +00:00
Tianjie Xu
0ef9783c57 Add std::map implementation for cd entry map
Add the std::map implementation to be used later in zip64 format.
Also move the entry map classes to a separate file to make the hierarchy
clear.

Test: unittests pass
Change-Id: I74d95f53207cc8ca871b955e2a15c184d5497833
2020-03-16 15:42:22 -07:00
Tom Cherry
d6699b6b81 liblog: correct new APIs per the API review
1) Rename __android_logger_data to __android_log_message and rename
   __android_log_write_logger_data to
   __android_log_write_log_message. Move the const char* message
   argument into __android_log_message.
2) Add @param, @return, and "Available since API level 30." to the
   documentation of new functions.
3) Document that the user defined aborter should but may not abort.
4) Document the line separation is the responsibility of the log
   function provided to __android_log_set_logger().

Bug: 150898477
Test: build, liblog and libbase unit tests
Change-Id: I07c41011ef25b3e7cc4943f3f1e240a2f6aa2802
2020-03-16 15:31:52 -07:00
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
David Anderson
054e6a388e init: Fix restorecon for /metadata.
Since new files can be introduced to /metadata after the initial
restorecon, we need to skip hashing.

Bug: 150907679
Test: rollback, ls -lZ /metadata/ota
Change-Id: I1f928f519ae2c75aeedb74b70d513743e86bcf2b
Merged-In: I1f928f519ae2c75aeedb74b70d513743e86bcf2b
2020-03-16 14:00:54 -07: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
Marco Ballesio
c1e763a95b freezer: allow dynamic changes to freezer.state
create new profiles to allowing thawing and freezing back the freezer
cgroup

Bug: 151225245
Test: Manually verified that using the SetTaskProfiles method on the
profiles thaws and freezes back the freezer cgroup.

Change-Id: I7f3e193ebe79b49c1f6ac52b6138ff4ec26fc570
2020-03-16 09:11:36 -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