Commit graph

29481 commits

Author SHA1 Message Date
Dan Willemsen
dff208c80c Merge "Convert libusbhost to Android.bp"
am: a58c4b5bcd

Change-Id: I71112a018a735a1ba20ca17e652f87fbdade2fed
2017-04-20 17:19:58 +00:00
Treehugger Robot
a58c4b5bcd Merge "Convert libusbhost to Android.bp" 2017-04-20 17:07:43 +00:00
Dan Willemsen
a5c6017d8f Convert libusbhost to Android.bp
See build/soong/README.md for more information.

Test: mmma -j system/core/libusbhost
Change-Id: I57109380678bd452af545d4c5b1b9d2356b356b8
2017-04-20 08:37:12 -07:00
Mark Salyzyn
2ad8ed5138 Merge "logd: statistics add logspan"
am: e32517d773

Change-Id: I92ec192fdd5d2cf7469b3ac77fdb387e3e19e54a
2017-04-20 15:25:50 +00:00
Mark Salyzyn
e32517d773 Merge "logd: statistics add logspan" 2017-04-20 15:19:05 +00:00
Christopher Ferris
0597e4a8af Merge "Add function definitions for MapInfo."
am: 4c1560ce5c

Change-Id: Ifb6d06f5349c737c3bd826564d32ada0f7734887
2017-04-20 02:12:24 +00:00
Christopher Ferris
4c1560ce5c Merge "Add function definitions for MapInfo." 2017-04-20 02:08:33 +00:00
Steven Moreland
004f8f9633 Merge changes from topic 'system-vendor-internal-pick'
am: 3dfaa44491

Change-Id: I9e782c46d9ddf43b61c8feb5e2c33f2a295e8358
2017-04-20 01:50:40 +00:00
Steven Moreland
74f60ea50a libsync: vendor_available
am: 9990de1f64

Change-Id: Ia345026f98a48b3975e9694681848b49f1880e2a
2017-04-20 01:50:24 +00:00
Steven Moreland
af13aaf618 Remove VNDK warning.
am: 2bd4342234

Change-Id: If5f2e965e944180e77132a105227c4efb344087e
2017-04-20 01:50:05 +00:00
Steven Moreland
45102312a3 libbase: make vendor_available
am: d10a023208

Change-Id: I34554045272dcb8c74179010ee6cde4eb899eef3
2017-04-20 01:49:47 +00:00
Steven Moreland
d4010ad4b8 libcutils: vendor_available
am: 385fe692cc

Change-Id: I3f729a42636ea2f00ac42c1a134f1a0600db1bee
2017-04-20 01:49:30 +00:00
Steven Moreland
9529a0fe6f libbacktrace: make vendor_available
am: bb11af88e2

Change-Id: I718890b9ea326dd0f8ae5e70b311e32cadf382d0
2017-04-20 01:49:05 +00:00
Steven Moreland
10a28989b8 libbase: add libbase_headers
am: 3c71bbdde3

Change-Id: Id7d32390e1e6963b2a472526ade0de0ff70a968a
2017-04-20 01:48:44 +00:00
Treehugger Robot
3dfaa44491 Merge changes from topic 'system-vendor-internal-pick'
* changes:
  libbase: fix build breakage
  libsync: vendor_available
  Remove VNDK warning.
  libbase: make vendor_available
  libcutils: vendor_available
  libbacktrace: make vendor_available
  libbase: add libbase_headers
2017-04-20 01:39:23 +00:00
Elliott Hughes
e6b808ea5b Merge "Fix various adb error reporting bugs."
am: 8dead17a58

Change-Id: I4587f92de271d11137fad4e6e843abc17267cbcf
2017-04-20 00:47:18 +00:00
Treehugger Robot
8dead17a58 Merge "Fix various adb error reporting bugs." 2017-04-20 00:37:38 +00:00
Steven Moreland
da511bba64 Merge "libprocessgroup: Android.mk -> Android.bp"
am: 9401a0b9d1

Change-Id: I20ca048bad19d4646aeeeb48bdc680c4cd0e8e21
2017-04-19 23:35:04 +00:00
Mark Salyzyn
3bcb013833 Merge changes Ie7a5303e,I2b3c2ac4
am: 3a052c42be

Change-Id: Ib8a9ca85340333b3fd093cdae364e5add5631f6e
2017-04-19 23:34:44 +00:00
Treehugger Robot
9401a0b9d1 Merge "libprocessgroup: Android.mk -> Android.bp" 2017-04-19 23:29:23 +00:00
Mark Salyzyn
3a052c42be Merge changes Ie7a5303e,I2b3c2ac4
* changes:
  liblog: log_time add usec() and msec()
  logd: replace stats.add+stats.subtract with stats.addTotal
2017-04-19 23:18:14 +00:00
Christopher Ferris
0d7cf3e8dd Add function definitions for MapInfo.
Bug: 23762183

Test: All new unit tests pass.
Change-Id: I26a1f6e84bf1a02447eff48ff6e35068554330fe
2017-04-19 15:48:02 -07:00
Steven Moreland
419ce36c7d libprocessgroup: Android.mk -> Android.bp
Test: links
Test: (sanity) boot marlin in recovery + to system UI
Bug: 37512442
Change-Id: Ie19c02bda9df7c0cfdeeaf34c48f251b2b93961d
2017-04-19 14:29:08 -07:00
Tom Cherry
a0b0c8a18e Merge "init: Stop combining actions"
am: 8d644d2c96

Change-Id: Iea55e5b88f42013ad83fab68682c1b5403eff0b0
2017-04-19 20:06:00 +00:00
Treehugger Robot
8d644d2c96 Merge "init: Stop combining actions" 2017-04-19 20:00:50 +00:00
Chris Fries
ab74c778df Merge "libsparse: Fix odd-sized input files total_blks"
am: 652ce94f40

Change-Id: I4f942ca03bb06c716d9cebbb648b114107c86cf7
2017-04-19 19:22:57 +00:00
Treehugger Robot
652ce94f40 Merge "libsparse: Fix odd-sized input files total_blks" 2017-04-19 19:14:47 +00:00
Tom Cherry
012c573e26 init: Stop combining actions
In the past, I had thought it didn't make sense to have multiple
Action classes with identical triggers within ActionManager::actions_,
and opted to instead combine these into a single action.  In theory,
it should reduce memory overhead as only one copy of the triggers
needs to be stored.

In practice, this ends up not being a good idea.

Most importantly, given a file with the below three sections in this
same order:

on boot
  setprop a b

on boot && property:true=true
  setprop c d

on boot
  setprop e f

Assuming that property 'true' == 'true', when the `boot` event
happens, the order of the setprop commands will actually be:

setprop a b
setprop e f
setprop c d

instead of the more intuitive order of:

setprop a b
setprop c d
setprop e f

This is a mistake and this CL fixes it.  It also documents this order.

Secondly, with a given 'Action' now spanning multiple files, in order
to keep track of which file a command is run from, the 'Command'
itself needs to store this.  Ironically to the original intention,
this increases total ram usage.  This change now only stores the file
name in each 'Action' instead of each 'Command'.  All in all this is a
negligible trade off of ram usage.

Thirdly, this requires a bunch of extra code and assumptions that
don't help anything else.  In particular it forces to keep property triggers
sorted for easy comparison, which I'm using an std::map for currently,
but that is not the best data structure to contain them.

Lastly, I added the filename and line number to the 'processing
action' LOG(INFO) message.

Test: Boot bullhead, observe above changes
Test: Boot sailfish, observe no change in boot time
Change-Id: I3fbcac4ee677351314e33012c758145be82346e9
2017-04-19 11:26:29 -07:00
Tom Cherry
2b78f9c0a9 Merge "init: add warning that start is not synchronous"
am: 06039e58d8

Change-Id: Ie90e08c41d22c4fcb2e6f98150b1331467423709
2017-04-19 18:18:21 +00:00
Tom Cherry
06039e58d8 Merge "init: add warning that start is not synchronous" 2017-04-19 18:12:41 +00:00
Steven Moreland
e131f31db5 libbase: fix build breakage
Two changes were merged at the same time that conflicted.

Test: builds
(cherry picked from commit 72b9d28423)
Merged-In: Ia6c730804cd5a3b2655e6d69b8e4f346d198dabb
Change-Id: Ia6c730804cd5a3b2655e6d69b8e4f346d198dabb
2017-04-19 10:39:54 -07:00
Steven Moreland
9990de1f64 libsync: vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 33241851
Test: build and flash internal marlin
Test: m -j libsync
Test: build with BOARD_VNDK_VERSION := current
(cherry picked from commit d0b26edf30)
Merged-In: I5b23d2c1f41b842e5a9b7ea257921133b80c3f98
Change-Id: I5b23d2c1f41b842e5a9b7ea257921133b80c3f98
2017-04-19 10:32:51 -07:00
Steven Moreland
2bd4342234 Remove VNDK warning.
Added todo once usages are fixed.

Bug: 33241851
Test: things with -Werror now compile in VNDK
(cherry picked from commit 81626e48cb)
Merged-In: I6c4a148dca4d4710912fe62a8854cb8077651701
Change-Id: I6c4a148dca4d4710912fe62a8854cb8077651701
2017-04-19 10:32:49 -07:00
Steven Moreland
d10a023208 libbase: make vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 33241851
Test: build and flash internal marlin
Test: m -j libbase
Test: build with BOARD_VNDK_VERSION := current
(cherry picked from commit c28517f956)
Merged-In: I720a00deada4e62628e6fbc4ac830265de9c669f
Change-Id: I720a00deada4e62628e6fbc4ac830265de9c669f
2017-04-19 10:32:47 -07:00
Steven Moreland
385fe692cc libcutils: vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 36426473
Bug: 36079834
Test: m -j libcutils
Test: attempt to compile with BOARD_VNDK_VERSION := current
Test: (sanity) boot internal marlin
(cherry picked from commit 9610c548a8)
Merged-In: I76f9b28ef08a26d84d1365881e00696cc1dcfe5d
Change-Id: I76f9b28ef08a26d84d1365881e00696cc1dcfe5d
2017-04-19 10:32:45 -07:00
Steven Moreland
bb11af88e2 libbacktrace: make vendor_available
By setting vendor_available, the following may become true:

* a prebuilt library from this release may be used at runtime by
  in a later releasse (by vendor code compiled against this release).
  so this library shouldn't depend on runtime state that may change
  in the future.
* this library may be loaded twice into a single process (potentially
  an old version and a newer version). The symbols will be isolated
  using linker namespaces, but this may break assumptions about 1
  library in 1 process (your singletons will run twice).

Background:

This means that these modules may be built and installed twice --
once for the system partition and once for the vendor partition. The
system version will build just like today, and will be used by the
framework components on /system. The vendor version will build
against a reduced set of exports and libraries -- similar to, but
separate from, the NDK. This means that all your dependencies must
also mark vendor_available.

At runtime, /system binaries will load libraries from /system/lib*,
while /vendor binaries will load libraries from /vendor/lib*. There
are some exceptions in both directions -- bionic(libc,etc) and liblog
are always loaded from /system. And SP-HALs (OpenGL, etc) may load
/vendor code into /system processes, but the dependencies of those
libraries will load from /vendor until it reaches a library that's
always on /system. In the SP-HAL case, if both framework and vendor
libraries depend on a library of the same name, both versions will be
loaded, but they will be isolated from each other.

It's possible to compile differently -- reducing your source files,
exporting different include directories, etc. For details see:

https://android-review.googlesource.com/368372

None of this is enabled unless the device opts into the system/vendor
split with BOARD_VNDK_VERSION := current.

Bug: 33241851
Test: build and flash internal marlin
Test: m -j libbacktrace
Test: build with BOARD_VNDK_VERSION := current
(cherry picked from commit 4c0e956c76)
Merged-In: Idab4880e011416ebc40b225205c30fb5ed8661db
Change-Id: Idab4880e011416ebc40b225205c30fb5ed8661db
2017-04-19 10:32:43 -07:00
Steven Moreland
3c71bbdde3 libbase: add libbase_headers
Test: can include headers in other soong modules
Bug: 33241851
(cherry picked from commit 8f56c1ecd7)
Merged-In: Ie3d11d1559f5aae46125695fd1f3a63da8e429ae
Change-Id: Ie3d11d1559f5aae46125695fd1f3a63da8e429ae
2017-04-19 10:32:41 -07:00
Keun-young Park
3794d11454 Merge "run e2fsck -f selectively with mount retry"
am: 380a3bb4c2

Change-Id: I3411d17aa175b608172dbc7cec253f66bc157536
2017-04-19 17:16:16 +00:00
Keun-young Park
380a3bb4c2 Merge "run e2fsck -f selectively with mount retry" 2017-04-19 17:09:51 +00:00
Mark Salyzyn
03393e6f63 Merge "init.rc: move load_system_props to beginning of 'on fs'"
am: 798ac73dcf

Change-Id: I0bf0a8ca7b88ca827a9ded5d33b482fa25cb31a2
2017-04-19 16:43:45 +00:00
Treehugger Robot
798ac73dcf Merge "init.rc: move load_system_props to beginning of 'on fs'" 2017-04-19 16:35:23 +00:00
Mark Salyzyn
03bb7593e4 logd: statistics add logspan
Logspan down to the millisecond.  Show a percentage if trimmed by
Chatty messages, a subspan from the newest to the newest chatty in
the log buffer.  Sniff stats.add(elem), stats.subtract(elem) and
stats.dropped(elem) to generate the logspan data.

Test: gTest liblog-unit-tests, logd-unit-tests and logcat-unit-tests
Test: manual check Logspan statistics for being in range, added
      temporary internal instrumentation to confirm expectations.
Bug: 37254265
Change-Id: I09c0d9375d5580315543c747b37976f9eeb9e408
2017-04-19 09:18:51 -07:00
Mark Salyzyn
0dd92d5b92 liblog: log_time add usec() and msec()
Test: build
Bug: 37254265
Change-Id: Ie7a5303e85e565800f2066e53e19a83496acae72
2017-04-19 09:18:40 -07:00
Mark Salyzyn
02dd2f42f8 logd: replace stats.add+stats.subtract with stats.addTotal
Replace stats.add(elem) + stats.subtract(elem) with a new more
efficient method stats.addTotal(elem).

Test: gTest liblog-unit-test, logd-unit-tests and logcat-unit-tests
Bug: 37254265
Change-Id: I2b3c2ac44209772b38f383ae46fe6c4422b542cf
2017-04-19 09:16:30 -07:00
Mark Salyzyn
f58558d6b9 Merge "liblog: __android_logger_property_bool svelte+eng default"
am: 8b318d0c26

Change-Id: I57810f41f8eff2cdbf943613d1fb5acbbcc53469
2017-04-19 16:09:39 +00:00
Chris Fries
3738968ed8 libsparse: Fix odd-sized input files total_blks
If the input file isn't a multiple of block_size, count the trailing
bit as a block in the output, otherwise bootloader will try to write
past the last declared block in the sparse file.

Test: Run sparse_test
Bug: 37339998
Change-Id: Iec143107d15795c6a6f4d3ea7b7515f6f16adcae
2017-04-19 10:32:45 -05:00
Mark Salyzyn
3510359a3c init.rc: move load_system_props to beginning of 'on fs'
ro.logd.kernel, ro.config.low_ram, ro.logd.timestamp and ro.debuggable
need to be retrieved prior to logd start in order for the service to
behave in a configured manner.  Other essential services are also
dependent on these system properties as well, so it just makes sense
to pick them all up first in 'on fs'.

Test: smoke test
Bug: 37425809
Change-Id: I33ad185f397ee527ed3c84cc2bcb40ff8ca785b5
2017-04-19 14:55:35 +00:00
Mark Salyzyn
8b318d0c26 Merge "liblog: __android_logger_property_bool svelte+eng default" 2017-04-19 14:55:20 +00:00
Keun-young Park
40db04d640 run e2fsck -f selectively with mount retry
- Do not use -f if it was cleanly shutdown.
- For unclean shutdown or other operation failures like
  mount, tune2fs failure, run full check.
- Still old image will run full check once in 5 reboots
  while new image will not run full check unless something
  fails.
- Add retry for final mount. If mount fails once, run full fsck
  once and try again.

bug: 32246772
bug: 35366616
Test: many reboots
Change-Id: I86949732ffe1955636ac179d553c91e52910f73e
2017-04-18 19:28:55 -07:00
Tom Cherry
19866bf19f init: add warning that start is not synchronous
Bug: 36571736
Bug: 37481363
Change-Id: I5d360cbb3635f00453a492ee4e3650fb80f390f5
2017-04-19 00:46:44 +00:00