Commit graph

24201 commits

Author SHA1 Message Date
Treehugger Robot
8cf0bd75f7 Merge "init: account for "init.svc." prefix in IsValidName" 2016-10-24 17:33:08 +00:00
Iliyan Malchev
00860da2f0 init: account for "init.svc." prefix in IsValidName
For each service ${service} described in a .rc file, init creates the
property init.svc.${service}.  This implies that service-name lengths
are bound by the maximum size of a property.  This patch accounts for
the "init.svc." prefix and the maximum property-name length when
validating a service name.

Test: pass

Change-Id: I32dffa37363b41a8211f7644600b81973d30a3b2
Signed-off-by: Iliyan Malchev <malchev@google.com>
2016-10-24 08:46:06 -07:00
Treehugger Robot
0ca2fe4c43 Merge "Move CapturedStderr to test_util library" 2016-10-23 00:44:10 +00:00
Elliott Hughes
620469a4ac Merge "Move "adb shell" over to getopt(3), and allow -tt on old devices." 2016-10-22 18:06:46 +00:00
Wei Wang
8c176302e6 Move CapturedStderr to test_util library
Bug: 32181382
Test: run /data/nativetest(64)/binderTextOutputTest
Change-Id: Ifb2e1f6af2c3f57b5cbed7dde65efb31253c52a2
2016-10-22 10:35:21 -07:00
Treehugger Robot
74552a9e7b Merge "libion: open /dev/ion read-only" 2016-10-22 00:19:39 +00:00
Jeff Vander Stoep
1ba4e981db libion: open /dev/ion read-only
/dev/ion driver does not recognize the write operation [1] so open it
read-only.

[1] http://lxr.free-electrons.com/source/drivers/staging/android/ion/ion.c?v=4.5#L1369

Test: Angler builds and boots
Bug: 32120194
Change-Id: I9b26d43ea32cb24426404668701df1f1648d336c
2016-10-21 14:29:22 -07:00
Elliott Hughes
cabfa1177f Move "adb shell" over to getopt(3), and allow -tt on old devices.
From the bug:

  Say we run a new adb against an old device (like KitKat). Even with a new
  client ADB, in this configuration, "adb shell" will create a remove tty
  unconditionally. So if the user runs "adb shell -t -t", we shouldn't fail
  with a message about the remote device not supporting -tT options --- the
  user asked to create a tty unconditionally, and since we're going to create
  a tty unconditionally, we should just succeed. (That it's going to succeed
  due to protocol inadequacy instead of succeeding on purpose is irrelevant.)

  That adb fails in this case makes scripts more complicated, since they can't
  just pass "-t -t" unconditionally if they want a tty and to work on all
  device versions, even if the script requires a new-ish adb locally.

Bug: http://b/32216152
Bug: http://b/32219151
Test: test_device.py
Change-Id: I8ab7c8dfa212209a7ab43c1f0832eeac26d2e42f
2016-10-21 14:22:40 -07:00
Mark Salyzyn
c75a32aae3 Merge "logd: mLastWorstPidOFSystem crash" 2016-10-21 20:14:21 +00:00
Mark Salyzyn
fa07f9dc4b logd: mLastWorstPidOFSystem crash
mLastWorstPidOfSystem is filled with iterator references
that are not from AID_SYSTEM to aid the performance. But
we only clear entries from the list during erase if they
are from AID_SYSTEM. Remove the filter check in erase so
the stale references will be removed.

The conditions that caused this failure are difficult to
reproduce and are rare.

Test: gTests logd-unit-tests, liblog-unit-tests and logcat-unit-tests
Bug: 32247044
Bug: 31237377
Change-Id: Ie405dd643203b816cac15eef5c97600551cee450
2016-10-21 10:20:55 -07:00
Treehugger Robot
c741dd4838 Merge "Add license to ndk_headers." 2016-10-20 22:12:40 +00:00
Colin Cross
fc75f94643 Merge "Add missing host ldlibs" 2016-10-20 19:21:25 +00:00
Mark Salyzyn
27d2d49f48 Merge "system/core: preparation to pull back interfaces from android/log.h" 2016-10-20 17:53:45 +00:00
Colin Cross
53783b1976 Add missing host ldlibs
Host builds were compiling without -Wl,--no-undefined.  Add missing
host ldlibs so that -Wl,--no-undefined can be added again.

Test: m -j host
Bug: 32305815
Change-Id: I0ceabc3f4ec74e2f737afaac58810c5d53d6ccb6
2016-10-20 10:39:51 -07:00
Yabin Cui
d55705796e Merge "libbase: add parsedouble.h." 2016-10-20 17:18:36 +00:00
Dan Albert
286b2eaa52 Add license to ndk_headers.
Test: make ndk
Bug: None
Change-Id: Iaba7368b89ec446b5c65c7c127a98914bd949496
2016-10-20 10:18:27 -07:00
Mark Salyzyn
cfd5b080af system/core: preparation to pull back interfaces from android/log.h
Point to log/log.h where necessary, define LOG_TAG where necessary.
Accept that private/android_logger.h is suitable replacement for
log/logger.h and android/log.h.

Correct liblog/README

Effectively a cleanup and controlled select revert of
'system/core: drop or replace log/logger.h' and
'system/core: Replace log/log.h with android/log.h'.

Test: compile
Bug: 30465923
Change-Id: Ic2ad157bad6f5efe2c6af293a73bb753300b17a2
2016-10-20 08:11:39 -07:00
Treehugger Robot
1edd61ce5d Merge "adb: fix undefined behavior" 2016-10-20 04:32:52 +00:00
Ting-Yuan Huang
ef57d54f80 adb: fix undefined behavior
system/core/adb/shell_service_protocol_test.cpp:94:14: warning: Null
passed to a callee that requires a non-null 1st parameter
            !memcmp(data, protocol->data(), data_length));

C99 requires memcmp() to take non-null pointers.

Bug: none
Test: clang-tidy doesn't complain
Change-Id: I77b8d9373fa257a070ffc7fd318231c2c9ea84c3
2016-10-19 19:39:44 -07:00
Yabin Cui
997cba4271 libbase: add parsedouble.h.
Bug: http://b/24905115
Test: run libbase_test --gtest_filter=parsedouble.smoke.
Change-Id: I604424772f2082b420935e6647da03981c0b8929
2016-10-19 11:19:42 -07:00
Mark Salyzyn
6da6d37c81 Merge "logd: Use private interfaces for buffer size properties" 2016-10-19 14:31:04 +00:00
Mark Salyzyn
094004bf42 Merge "liblog: Add private interfaces for buffer size properties" 2016-10-18 23:22:18 +00:00
Tao Bao
5062b87eba Merge "init: use libbootloader_message." 2016-10-18 21:48:23 +00:00
Yabin Cui
1051e107f2 init: use libbootloader_message.
Bug: 29582118
Change-Id: I6285b29774a11d6dda8496c7c73e4c1d17a672bd
(cherry picked from commit 0b1252cca0)
2016-10-18 11:37:52 -07:00
Tianjie Xu
4bc51d1ea4 Merge "Add functions in recovery/minzip to libziparchive" 2016-10-18 17:30:02 +00:00
Mark Salyzyn
f10e273790 logd: Use private interfaces for buffer size properties
Test: gTest logd-unit-tests, liblog-unit-tests and logcat-unit-tests
Bug: 31750617
Change-Id: I692577cfdf4bf8c93616f32df4b56786918aef1c
2016-10-18 09:49:51 -07:00
Mark Salyzyn
e455373b57 liblog: Add private interfaces for buffer size properties
Add private function __android_logger_get_buffer_size() to read
properties and compose the default buffer size.  This interface
complements the existing android_looger_get_size() which returns
the logd setting which can differ at runtime.  For use in logd
and dumpstate.  Side effect is we also add the private functions
__android_logger_property_get_bool() and
__android_logger_valid_buffer_size() for reuse in logd.

Test: gTest liblog-unit-test, logd-unit-tests and logcat-unit-tests in
      combination with commit 'logd: Use private interfaces for
      buffer size properties'
Bug: 31750617
Change-Id: Id95cb68f775ef6b427c122e10f6f8291d336d184
2016-10-18 09:48:55 -07:00
Treehugger Robot
c1f74ca5aa Merge changes Ibf4774f7,I6568eea0,I35e83679,I9faf8826,I8ee9d999
* changes:
  fs_mgr: use __android_log_is_debuggable()
  adb: use __android_log_is_debuggable()
  debuggerd: use __android_log_is_debuggable()
  logd: use __android_log_is_debuggable()
  libcutils: use __android_log_is_debuggable()
2016-10-18 16:33:28 +00:00
Treehugger Robot
915d620359 Merge "liblog: LIBLOG_ABI_PRIVATE __android_log_is_debuggable()" 2016-10-17 21:46:37 +00:00
Treehugger Robot
6da1ea0e48 Merge "liblog: __android_log_pmsg_file_write() cleanup" 2016-10-17 14:16:46 +00:00
Tianjie Xu
18c25920c2 Add functions in recovery/minzip to libziparchive
Add two functions libziparchive that libminzip has. And create
corresponding unit tests.
1. Open a zip archive from a memory mapped region.
2. A new writer that takes a call back function pointer.
(Used by the OTA updater to stream the data.)

Test: Unit tests passed
Bug: 19472796
Change-Id: I2b2daec71174afe221030357e39bff5faea51e72
2016-10-15 23:16:34 -07:00
Treehugger Robot
14a7725f26 Merge "Continue using the legacy NDK android/log.h." 2016-10-14 21:03:54 +00:00
Dan Albert
b7c3996f7c Continue using the legacy NDK android/log.h.
system/core/android/log.h needs some work before it can be included in
the NDK. It defines a *lot* of macros that previously were usable
names in NDK sources that used android/log.h. As an example, the
following file defines LOG_TAG as a variable, but the variable name
gets macro replaced if we use the current android/log.h.
4adc1515f8/framework/platform/android/tcuTestLogParserJNI.cpp (41)

For now, we keep a copy of the old NDK android/log.h in
legacy-ndk-includes.

Test: make checkbuild
Bug: http://b/30465923
Change-Id: I8ce942d1ee2f8f0d4c27130802c03992a1b85ec4
2016-10-14 13:12:29 -07:00
Treehugger Robot
5171bebf41 Merge "Remove socket_loopback_client." 2016-10-14 18:21:38 +00:00
Mark Salyzyn
e528be5e7d fs_mgr: use __android_log_is_debuggable()
Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: Ibf4774f742e5a5b7db75d17642ff483a4a0fc0c5
2016-10-14 11:12:24 -07:00
Mark Salyzyn
97787a00e6 adb: use __android_log_is_debuggable()
Test: compile and months of adb functionality use
Bug: 27566046
Bug: 31456426
Change-Id: I6568eea0eda8dc67dec2ba34cd4c3f56fb0ff0e9
2016-10-14 11:12:24 -07:00
Mark Salyzyn
dafe384207 debuggerd: use __android_log_is_debuggable()
Test: compile and signal 8 to some component
Bug: 27566046
Bug: 31456426
Change-Id: I35e83679fbc40d54217850521bff23d9306d86f8
2016-10-14 11:12:16 -07:00
Mark Salyzyn
5740a46e4e logd: use __android_log_is_debuggable()
Test: gTest logd-unit-tests
Bug: 27566046
Bug: 31456426
Change-Id: I9faf88263fe62ce5bba80dc2cb928e6dbe73dbb2
2016-10-14 08:04:21 -07:00
Mark Salyzyn
b5aa4e7125 libcutils: use __android_log_is_debuggable()
Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: I8ee9d999a2e6a0336e45b6180ce6fd7975c113dc
2016-10-14 08:04:19 -07:00
Mark Salyzyn
9ea359fce0 liblog: LIBLOG_ABI_PRIVATE __android_log_is_debuggable()
Allow our own libraries to use this privately instead of
running the less efficient get_properties and doing the math.

Test: compile and boot smoke test
Bug: 27566046
Bug: 31456426
Change-Id: I2f677276d27fbcb6af01b600ac1d9891c8938d43
2016-10-14 08:00:41 -07:00
Treehugger Robot
955648a915 Merge "Rely on the platform -std default." 2016-10-14 02:28:38 +00:00
Elliott Hughes
a4398c1abe Merge "Move off std::sto* function which abort on failure." 2016-10-14 01:51:10 +00:00
Treehugger Robot
c32d7fd66f Merge "Fallback to IPv6 when IPv4 is not available in adb" 2016-10-14 01:35:43 +00:00
Elliott Hughes
dd92a0a812 Remove socket_loopback_client.
Bug: http://b/31537253
Test: builds
Change-Id: If02c8107206fb60e4622f8937bee0d0a362e1c7d
2016-10-13 16:51:46 -07:00
Elliott Hughes
da46b392f1 Move off std::sto* function which abort on failure.
Bug: http://b/31403370
Test: builds, boots, libbase tests pass
Change-Id: I89cd7ca3d8f1c8a1bad0ddf3043439449d19a293
2016-10-13 15:34:05 -07:00
Chia-I Wu
d790aae4bc Merge "Add native_handle_init" 2016-10-13 22:18:11 +00:00
Mark Salyzyn
db8a266aea liblog: __android_log_pmsg_file_write() cleanup
__android_log_pmsg_file_write() will open /dev/pmsg0 if not
already, and will close it if we opened it.

Added atomic access to the android_log_context as insurance.

Fortify and correct pmsg tests.

Test: gTest liblog-unit-tests --gtest_filter=liblog.__android_log_pmsg_file_*
Bug: 31958686
Change-Id: I2cf6f971b6968938f471fda67367efe20dae3004
2016-10-13 21:43:42 +00:00
Treehugger Robot
bf0cf4e22d Merge "Use process_vm_readv to read memory." 2016-10-13 17:14:31 +00:00
Tao Wu
7b700763f5 Fallback to IPv6 when IPv4 is not available in adb
Test: manual - make sure it works in both IPv4/IPv6 env.
BUG: 31537253
Change-Id: Ica492bff34a8c0441516a213d0e8b78fcdfd3282
Signed-off-by: Tao Wu <lepton@google.com>
2016-10-13 08:54:43 -07:00
Elliott Hughes
58f7f61266 Merge "Start retiring socket_loopback_client." 2016-10-13 14:38:48 +00:00