Commit Graph

24183 Commits

Author SHA1 Message Date
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
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
Chia-I Wu b843791b61 Add native_handle_init
HIDL requires file descriptors to be wrapped in native_handle_t.  We want
a low overhead way to do that when the number of file descriptors is known
at compile time.  Instead of

  // wrap an fd in native_handle_t
  native_handle_t* fd_handle = native_handle_create(1, 0);
  if (!fd_handle) {
    // clean up and return error
  }
  fd_handle->data[0] = fd;

  hidl_cb(..., fd_handle);

  native_handle_delete(fd_handle);

this change adds native_handle_init to allow for

  // wrap an fd in native_handle_t
  NATIVE_HANDLE_DECLARE_STORAGE(fd_storage, 1, 0);
  native_handle_t* fd_handle = native_handle_init(fd_storage, 1, 0);
  fd_handle->data[0] = fd;

  hidl_cb(..., fd_handle);

Test: make libcutils
Bug: 32021609
Change-Id: If1fd07482243d37492fdea57c602a1b13c8953cc
2016-10-12 18:04:41 -07:00
Treehugger Robot 5980fe4aff Merge "logcat: test: report system(command) details" 2016-10-12 21:28:49 +00:00
Christopher Ferris 279843e139 Use process_vm_readv to read memory.
Modify BacktracePtrace::Read to use the process_vm_readv syscall
instead of doing multiple ptrace calls.

Test: Ran the backtrace unit tests on host and on x86_64 emulator.

Change-Id: I24c2787f6713d8eb44312f3aa751d1f6d9d34719
2016-10-12 12:43:55 -07:00
Mark Salyzyn 56cddcd72e logcat: test: report system(command) details
Provide more details regarding test failures

Test: manual, forced a failure, reports actual command issued
Bug: 30566487
Change-Id: I2431dbd335685b5eaef54ba6bd688b8588018aa9
2016-10-12 12:10:08 -07:00
Treehugger Robot f7a1c476ff Merge "Fix adb flakiness on reboot" 2016-10-12 00:25:11 +00:00
Lingfeng Yang 1197952e71 Fix adb flakiness on reboot
bug: 31950237

There are two lists of active ADB transports (devices),
and with the emulator, they can go out of sync.

This CL more conservatively checks if there are no
transports in either list before commiting to
register a new transport for the emulator.

(cherry picked from commit edaedfd5da)

Change-Id: Id1201dc59c70825881dad80925c2e5bcc13dbd5e
2016-10-11 23:19:51 +00:00
Elliott Hughes 139b372fab Start retiring socket_loopback_client.
Bug: http://b/31537253
Test: can still talk to adb
Change-Id: Icfd7f00d35cf963befc139e81904790b4b8b67c0
2016-10-11 13:45:03 -07:00
Treehugger Robot bd6c6eb0e4 Merge "Remove useless arguments from is_adb_interface." 2016-10-10 22:50:13 +00:00
Treehugger Robot 09dac589f1 Merge "liblog: adb: move security interfaces to private" 2016-10-10 21:54:31 +00:00
Elliott Hughes 36e0d390a2 Rely on the platform -std default.
Bug: http://b/32019064
Test: builds
Change-Id: I18a1d816d63b64601485045070851f32d44e85eb
2016-10-10 14:31:12 -07:00
Treehugger Robot 06928658c4 Merge "debuggerd: report crashes even when out of file descriptors." 2016-10-10 21:22:27 +00:00
Josh Gao 30186df0f0 Remove useless arguments from is_adb_interface.
Test: mma
Change-Id: I8b7b411d7d5ec9d401b61ed8f817b98c61114d4f
2016-10-10 13:44:00 -07:00
Tao Bao 5bc3ce85cf Merge "Update the header path for ext4_utils." 2016-10-10 20:07:32 +00:00
Christopher Ferris 54c211db2e Merge "Small clean up of fuse code." 2016-10-10 19:22:24 +00:00
Mark Salyzyn 6debf985aa liblog: adb: move security interfaces to private
Test: Compile & adb functioning
Bug: 19235719
Bug: 26552300
Bug: 31289077
Bug: 31456426
Change-Id: I7ad8963bcca3d8b5c37b547c11d163b652d35556
2016-10-10 15:15:45 +00:00
Tao Bao 6d881d6db4 Update the header path for ext4_utils.
Test: `mmma system/core`

Change-Id: I6291d10d6c8d4972aeca55596baa83f555496193
2016-10-09 10:23:36 -07:00
Glenn Kasten db7715c7dd Merge "Traverse /etc/init in a well-defined order" 2016-10-09 17:11:03 +00:00
Treehugger Robot 3dee9f1f6f Merge "mkbootfs: Fix the default st_mode for root directory." 2016-10-08 20:16:57 +00:00