Commit Graph

26636 Commits

Author SHA1 Message Date
Myles Watson 6632536c0d libcutils: Use strnlen for default property values
am: e67abec514

Change-Id: I6ca6f239d62da491c8a9379a18fa89674c894fa1
2016-12-22 19:12:56 +00:00
Myles Watson 9fdf778dd0 Use clang-format to fix up properties.c
am: 22c0962ab9

Change-Id: Ic8eee14c2e415b6d39eb418fc2cfb96afe02f51f
2016-12-22 19:12:49 +00:00
Treehugger Robot 69eb60be5d Merge changes Idafeb835,Ie1a9bf85
* changes:
  libcutils: Use strnlen for default property values
  Use clang-format to fix up properties.c
2016-12-22 18:52:19 +00:00
Myles Watson e67abec514 libcutils: Use strnlen for default property values
Add unit tests to test the corner cases.

Test: unit tests pass before and after the change.
Change-Id: Idafeb8354cd6c7db2a68cd398dafe153453a3940
2016-12-22 09:21:06 -08:00
Myles Watson 22c0962ab9 Use clang-format to fix up properties.c
BasedOnStyle: Google
IndentWidth: 4
ColumnLimit: 100

Test: unit tests pass
Change-Id: Ie1a9bf85c001ef1a2dcdafdc5bf696b9267116f7
2016-12-22 09:20:57 -08:00
Paul Crowley da7fe657d3 Merge "Ask the user before wiping if crypto policy fails."
am: 1d5965e40f

Change-Id: I93c46878aada1835a1159b54950ce9f8b3fdb777
2016-12-22 15:57:56 +00:00
Treehugger Robot 1d5965e40f Merge "Ask the user before wiping if crypto policy fails." 2016-12-22 15:52:44 +00:00
David Pursell c56d63e59d fastboot: update getvar documentation.
The protocol doc states that calling `fastboot getvar` for an unknown
variable should return an empty OKAY message, but in reality modern
devices return a FAIL response in this case (tested with marlin and
shamu).

Additionally, some A/B logic in fastboot expects a FAIL response for
unknown variables in order to function properly.

This CL changes the documentation to match reality.

Bug: http://b/33756193
Test: none
Change-Id: I41f7c80585be73e60ca0ac216787596c4d60a1d5
2016-12-21 15:59:50 -08:00
Jaekyun Seok 86e80b9be0 Use shared lib of libutils, libz and libbase.
libutils, libz and libbase are being used as shared lib by many other
modules.
So using their shared lib will reduce total image size.

Size diffs on angler build image are as follows.

libziparchive.so  : 103844 -> 41680 (-62164)
libnativeloader.so:  50824 -> 25104 (-25720)
total             : (-87884)

Test: building succeeded, and the image was tested on angler.
Bug: 33056637
Change-Id: I015afe5b8f4d87d495b706e2e78d60f44a910e87
2016-12-22 07:03:26 +09:00
Mark Salyzyn 342276b428 Merge "liblog: add IF_ALOG_RATELIMIT"
am: 3d6d5b101a

Change-Id: I762185e364279f2478b601b74379a8daaa4297e0
2016-12-21 22:00:20 +00:00
Treehugger Robot 3d6d5b101a Merge "liblog: add IF_ALOG_RATELIMIT" 2016-12-21 21:55:32 +00:00
Mark Salyzyn 41a117dbcb Merge "logd: LogBufferElementKey use uint32_t for uid"
am: 3fa88d8689

Change-Id: I658b42b503404b1c907c1901dc265accc9b01e61
2016-12-21 21:49:29 +00:00
Treehugger Robot 3fa88d8689 Merge "logd: LogBufferElementKey use uint32_t for uid" 2016-12-21 21:40:11 +00:00
Paul Crowley 0b8b2303ac Ask the user before wiping if crypto policy fails.
If crypto policy fails, instruct recovery to prompt the user before
wiping all data.

Test: adb shell rmdir /data/ota && adb shell mkdir -p /data/ota/forcefail && adb reboot
Bug: 28693324
Change-Id: I4d09b35a20c513a76c9ba56fe826114449a9ad68
2016-12-21 13:39:23 -08:00
Mark Salyzyn fc148f7f33 liblog: add IF_ALOG_RATELIMIT
IF_ALOG_RATELIMIT()
    ALOGE("Only one message globally using IF_ALOG_RATELIMIT()"
          " in the process may appear ever ten seconds,"
          " (%s)", strerror(errno));

static time_t last; /* initial state zero */
IF_ALOG_RATELIMIT_LOCAL(60, &last)
    ALOGE("Only one message locally may appear every minute,"
          " (%s)", strerror(errno));

These new calls are guaranteed not to affect the value of a
non-zero errno to simplify logging of errors.  However, the
ALOGE calls in the above examples may update the errno value
upon their return.

Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_ratelimit
Bug: 33535908
Change-Id: Id8cc192fc7d14504ffd418933cf88ae945c089f2
2016-12-21 21:36:14 +00:00
Mark Salyzyn 684bdb576d logd: LogBufferElementKey use uint32_t for uid
Test: gTest liblog-unit-tests, logd-unit-tests & logcat-unit-test
Change-Id: Icae34b1fa0b3df0a45ad175ec81aaf232f322f38
2016-12-21 12:16:46 -08:00
Christian Poetzsch 3081c5ebfb libziparchive: use _FILE_OFFSET_BITS=64
On 32 bit system those calls may fail if one tries to unpack files which
are bigger than 2GB.

Use large file system support to fix this problem.

Test: unpack a file bigger than 2GB on 32 bit Android systems

Change-Id: Ibd9bd5fc4a2f8dc7df98bd595f4fd1638a4f0d4a
Signed-off-by: Christian Poetzsch <christian.potzsch@imgtec.com>
2016-12-21 12:05:10 +00:00
Dan Willemsen 453faf66d8 Merge "Add system/core/Android.bp"
am: 8a1c4b8530

Change-Id: I3152b6ff9ee59a0997753540891446c6053542a1
2016-12-20 20:33:23 +00:00
Treehugger Robot 8a1c4b8530 Merge "Add system/core/Android.bp" 2016-12-20 20:25:09 +00:00
Dan Willemsen d66e7bb7cf Add system/core/Android.bp
Test: Soong's build.ninja is identical before/after (except GlobRules)
Change-Id: I97c1e4cedad1dfc8622abb6cfed6257971199a96
2016-12-20 10:58:18 -08:00
Mark Salyzyn 741051d066 Merge "logd: trailing spaces in log statistics (part deux)"
am: 2ead17196c

Change-Id: If4ed858ba2885c532e3ffd424dada114fcd9d510
2016-12-20 18:52:39 +00:00
Mark Salyzyn 827973369d Merge "Revert "logd: trailing spaces in log statistics""
am: 1fa079b255

Change-Id: I19eb25472a59f2b82e711552aae7fa74085d93ba
2016-12-20 18:52:24 +00:00
Treehugger Robot 2ead17196c Merge "logd: trailing spaces in log statistics (part deux)" 2016-12-20 18:16:15 +00:00
Treehugger Robot 1fa079b255 Merge "Revert "logd: trailing spaces in log statistics"" 2016-12-20 18:16:00 +00:00
forfun d3435f5d31 Merge "modify a minor error in mount_with_alternatives Test: when called with end_idx = null"
am: 3080ce2fe4

Change-Id: I3b7b2167a9d3cd492bb9970e9330ca965d0fb843
2016-12-20 02:13:07 +00:00
Treehugger Robot 3080ce2fe4 Merge "modify a minor error in mount_with_alternatives Test: when called with end_idx = null" 2016-12-20 02:08:36 +00:00
Mark Salyzyn 0f3c31086d Merge "logd: sum liblog tag messages"
am: 27425fd80d

Change-Id: Iff565b1ff40c100c2d4b38d1514de0d5b1c94b8e
2016-12-19 23:50:07 +00:00
Mark Salyzyn ebfba62dcb Merge "logd: correct duplicate message state machine"
am: 9fa0215e15

Change-Id: Id08fcce15a8edb5985f76e2063a1bf8486c93b22
2016-12-19 23:49:56 +00:00
Treehugger Robot 27425fd80d Merge "logd: sum liblog tag messages" 2016-12-19 23:43:48 +00:00
Treehugger Robot 9fa0215e15 Merge "logd: correct duplicate message state machine" 2016-12-19 23:43:23 +00:00
Mark Salyzyn 704c1b9dfa Merge "logd: add android::sizesTotal() function"
am: d04fa942e5

Change-Id: I8dbf35655c0c32ebbb8c563c11b2fe62fe37084b
2016-12-19 23:25:39 +00:00
Treehugger Robot d04fa942e5 Merge "logd: add android::sizesTotal() function" 2016-12-19 23:19:11 +00:00
Mark Salyzyn b545e1c9e3 logd: trailing spaces in log statistics (part deux)
Test: manual
Bug: 30118730
Change-Id: Iafda6f95e1b1377649e01868c81c0056c116e01b
2016-12-19 15:06:42 -08:00
Mark Salyzyn d966e22680 Revert "logd: trailing spaces in log statistics"
Caused +/- field data to land under the Pruned column

This reverts commit 0adcc3e3e8.

Test: manual
Bug: 30118730
Change-Id: Ic75ce3a90baded19f3efc0cc77474fe5d9a8accd
2016-12-19 15:06:37 -08:00
Mark Salyzyn 1dfb4de436 logd: sum liblog tag messages
As an extension to the duplicate multiple message filtering, special
case liblog tagged event messages to be summed.  This solves the
inefficient and confusing duplicate message report from the DOS attack
detection such as:

liblog: 2
liblog: 2
liblog: 2
liblog: 2
liblog: 3

which would result in:

liblog: 2
chatty: ... expire 2 lines
liblog: 2
liblog: 3

And instead sums them and turns them all into:

liblog: 11

liblog messages should never be subject to chatty conversion.

Test: liblog-benchmarks manually check for coalesced liblog messages
      and make sure they do not turn into chatty messages.
      Instrumented code to capture sum intermediates to be sure.
Bug: 33535908
Change-Id: I3bf03c4bfa36071b578bcd6f62234b409a91184b
2016-12-19 14:03:38 -08:00
Mark Salyzyn 8f83a35511 logd: correct duplicate message state machine
Inspection turned up that for the case of three identical messages,
the result would be a stutter of the first message only.  Added
comments to describe the state machine, incoming variables, outcoming
and false condition outputs, for proper maintenance in the future.

Test: gTest liblog-benchmarks BM_log_maximum* and manually check
      for correct midstream chatty messages,
Bug: 33535908
Change-Id: I852260d18a484e6207b80063159f1a74eaa83b55
2016-12-19 14:01:45 -08:00
Mark Salyzyn c4b880d146 Merge "liblog: pmsg read permissions for AID_LOGD"
am: 152b003bbf

Change-Id: Ifcc860bb70ab30a387132ccfecaa29afde3f5bde
2016-12-19 16:02:25 +00:00
Mark Salyzyn 3296291cff logd: add android::sizesTotal() function
Test: gTest liblog-unit-tests, logd-unit-tests and logcat-unit-tests
Bug: 31456426
Change-Id: I6fb6cd589227fc43d22f9336e01f1bf7e3feb24c
2016-12-19 08:00:16 -08:00
Mark Salyzyn 152b003bbf Merge "liblog: pmsg read permissions for AID_LOGD" 2016-12-19 15:57:08 +00:00
Mark Salyzyn 5bd8f2d956 liblog: pmsg read permissions for AID_LOGD
Test: gTest liblog-unit-test and logd-unit-tests
Bug: 31456426
Change-Id: I7a2fe8245ecd651883f7851ce71b6c45e373af82
2016-12-19 15:57:01 +00:00
Colin Cross d233c2752b Remove obsolete mentions of LLVM_HOST_BUILD_MK
The libbacktrace common flags don't need the flags from
LLVM_HOST_BUILD_MK, they are added directly to libbacktrace_offline.
The -fno-omit-frame-pointer is unnecessary, as we no longer import
flags only used to build LLVM into everything that depends on LLVM.
Removing -Wno-extern-c-compat doesn't cause any warnings.

Test: mma -j
Change-Id: Ia01380e8572c3d84268843291a54ec8c932a327f
2016-12-17 13:34:05 -08:00
Elliott Hughes c7816ee377 Merge "Move init bootcharting onto its own thread."
am: 8766ecb78d

Change-Id: I43a00a8336f4774cf89c18f0cf78df23ca8c2bb1
2016-12-17 18:00:02 +00:00
Elliott Hughes 8766ecb78d Merge "Move init bootcharting onto its own thread." 2016-12-17 17:56:15 +00:00
Daniel Cashman c21c4e3837 Merge "Revert "Compile sepolicy on-device at early boot.""
am: 58929b0447

Change-Id: Iebc03e89240bfa77401ede8699196063b399e3db
2016-12-17 01:08:24 +00:00
Daniel Cashman 58929b0447 Merge "Revert "Compile sepolicy on-device at early boot."" 2016-12-17 00:59:43 +00:00
Daniel Cashman a26a98726e Revert "Compile sepolicy on-device at early boot."
This reverts commit 2fae5d65d5.

Change-Id: Id8bfc0f85d19e98df3759a2fcc6b3a331b4eec29
2016-12-17 00:53:45 +00:00
Nick Kralevich e733fac3ef Merge "fs_config.c: make *.prop files 0600"
am: ebc39117ee

Change-Id: I8d8700564cad1dfc6e0140313f3f656986b8da27
2016-12-17 00:50:06 +00:00
Treehugger Robot ebc39117ee Merge "fs_config.c: make *.prop files 0600" 2016-12-17 00:35:36 +00:00
dcashman 64a83f9a30 Merge "Compile sepolicy on-device at early boot."
am: 356b339b0d

Change-Id: I84dcbeb25e125cc941d32e3074bcab7891eb38df
2016-12-17 00:23:45 +00:00
Treehugger Robot 356b339b0d Merge "Compile sepolicy on-device at early boot." 2016-12-17 00:17:13 +00:00