summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Use readdir instead of readdir_r.Elliott Hughes2016-09-282-15/+6
| | | | | | | http://elliotth.blogspot.com/2012/10/how-not-to-use-readdirr3.html Test: boots. Change-Id: If75532e24fe4d17743bf8e8c9590156dee378a63
* Merge "liblog: fix errno issues with event tag map"Treehugger Robot2016-09-282-125/+96
|\
| * liblog: fix errno issues with event tag mapMark Salyzyn2016-09-262-125/+96
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleanup. Save the errno for the calls that fail, and reinstate them for return. Drop fprintf stutter, one succinct line. Solve a memory leak in close. Change android_lookupEventTag() to use an unsigned int so that we can use the full range of uint32_t tags. Make sure this file compiles clean in C++. Test: gTest liblog-unit-tests Bug: 30963384 Bug: 31456426 Change-Id: I6a5efa6fb7e991431caba75ef0971e111968f6bf
* | Merge "adb: fix host-side serial number parsing for IPv6."Treehugger Robot2016-09-282-5/+27
|\ \
| * | adb: fix host-side serial number parsing for IPv6.David Pursell2016-09-212-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the adb client sends a command to the adb server targeting a particular device serial, it looks something like this: host-serial:<serial>:<command> But if <serial> happens to be an IPv6 address (e.g. when `adb connect` targets IPv6), the current parsing code doesn't handle the additional colons properly. This CL fixes the host-serial parsing to handle this case. This only affects commands that explicitly name a device serial, e.g.: adb -s <IPv6> shell adb -s <IPv6> forward <port> <port> Implicitly using a single attached device was unaffected by this bug. Bug: http://b/30891386 Test: `adb -s [fe80::ba27:ebff:feb1:934%eth2]:5555 shell` works now, and new unittests pass. Change-Id: Iffe784e61432ae94eb96ed3c8477900a3e807329
* | | Merge "liblog: free event tag map in __android_log_close()"Treehugger Robot2016-09-282-4/+33
|\ \ \ | | |/ | |/|
| * | liblog: free event tag map in __android_log_close()Mark Salyzyn2016-09-262-4/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no leak since a reference always remained and could get reused. It just makes sense to also close the event tag map as well if logging is closed. If we close we also have to fix a tagArray leak in android_closeEventTagMap(). NB: __android_log_close() already makes an assumption that another thread is not logging at the same time, which is true in all callers at this time. There are some partial mitigation strategies if __android_log_close() is called asynchronously, but not completely solved at the cost of a lock for every logging call. Test: gTest liblog-unit-tests Bug: 30963384 Bug: 31456426 Change-Id: Ib76ad9302dba4d3f35250213f4dfef22498af238
* | | Merge "Migrate liblog to ndk_library."Treehugger Robot2016-09-273-0/+42
|\ \ \
| * | | Migrate liblog to ndk_library.Dan Albert2016-09-233-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | Test: make native Bug: http://b/30465923 Change-Id: I3db7ede817a57b3505c0556ea28f08b9e8331e1a
* | | | Merge "adb: fix IOKit handle leaks on OS X."Josh Gao2016-09-271-0/+5
|\ \ \ \
| * | | | adb: fix IOKit handle leaks on OS X.Josh Gao2016-09-271-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: https://code.google.com/p/android/issues/detail?id=219085 Test: Removed sleep in RunLoopThread, compared before/after this patch Change-Id: Ia65bbedfb7d47bdb02bdfb69778784e5e855900b
* | | | | Merge changes from topic 'b/31458381'Treehugger Robot2016-09-263-0/+14
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * changes: init.rc: have hwservicemanager start the HAL class Add hwbinder dev node permissions.
| * | | | | init.rc: have hwservicemanager start the HAL classIliyan Malchev2016-09-262-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b/31458381 Test: passing build and runtime tests Change-Id: I1d26af5ca1d0e9c7bbd97cfd88d0b432b50b7216 Signed-off-by: Iliyan Malchev <malchev@google.com>
| * | | | | Add hwbinder dev node permissions.Martijn Coenen2016-09-261-0/+1
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | b/31458381 Test: pass Change-Id: I8ec92a29287b17636c363c55a8565dacab19043d Signed-off-by: Iliyan Malchev <malchev@google.com>
* | | | | Merge "Switch adb to <android-base/properties.h>."Treehugger Robot2016-09-269-131/+81
|\ \ \ \ \
| * | | | | Switch adb to <android-base/properties.h>.Elliott Hughes2016-09-269-131/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: http://b/23102347 Test: manual Change-Id: Iffa66258c01f84f41b9af99ab5e768a0a2669106
* | | | | | Merge "Add fastboot --skip-reboot flag"Treehugger Robot2016-09-261-2/+9
|\ \ \ \ \ \ | |_|/ / / / |/| | | | |
| * | | | | Add fastboot --skip-reboot flagMitchell Wills2016-09-261-2/+9
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add a flag to fastboot that will cause it to not reboot the device after performing commands like update and flashall. Fixed: 31743001 Test: run fastboot update with and without --skip-reboot flag Change-Id: I7f4056249a52779c7fc752c9d1009a58a44762df
* | | | | Merge "Base: Remove LOG_S variants."Treehugger Robot2016-09-263-374/+141
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Base: Remove LOG_S variants.Andreas Gampe2016-09-243-374/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Partially reverts commit 436f5a031f3dfa195919be36873300a221376b53. Remove the variants taking a fully qualified LogSeverity. Instead use a lambda with "using" statements to translate both qualified and unqualified names into valid expressions. Compile-time regression was measured as 0.1s for a thousand LOG statements on a z840. Update tests. Bug: 31338270 Test: m Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64 Change-Id: I36fdf30a9d535b19543307b85d1b3c19a97f20dd
* | | | | Merge "Add std::string system property functions."Treehugger Robot2016-09-244-1/+274
|\ \ \ \ \ | |/ / / / |/| | | |
| * | | | Add std::string system property functions.Elliott Hughes2016-09-234-1/+274
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes it easier to write correct code in a world where the maximum property key/value lengths change. Bug: http://b/23102347 Test: libbase_test64 Change-Id: I100f00904221bbcef9e8786a4e6e30428039bb49
* | | | | Merge "Base: Check severity in destructor"Treehugger Robot2016-09-232-28/+95
|\ \ \ \ \
| * | | | | Base: Check severity in destructorAndreas Gampe2016-09-232-28/+95
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Bug: 31338270 Test: m Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64 Change-Id: Ic077822bcfd591bd11f4fa9d4b6e440b461c70c1
* | | | | | Merge "Flattenable: switch from assignment to memcpy()."David Pursell2016-09-231-2/+9
|\ \ \ \ \ \
| * | | | | | Flattenable: switch from assignment to memcpy().David Pursell2016-09-231-2/+9
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FlattenableUtils read() and write() currently use assignment to copy bytes. However, by casting the void* buffer to type T, the compiler is allowed to assume that buffer obeys the alignment requirements of T, which is not necessarily the case during serialization. On some architectures, we can get SIGBUS when this alignment is violated. We don't want the users of these routines to have to worry about alignment when packing structures, so use memcpy() instead which should always be safe since the compiler won't assume any alignment for the void* buffer. On architectures that can handle unaligned direct read/write of type T, the compiler should be smart enough to optimize this code back to a direct read/write anyway, but architectures that can't handle it will fall back to memcpy; this means that this change shouldn't have any impact on current Android devices. See the linked bug for more details. Bug: http://b/31671510 Test: libgui Sensor serialization no longer gives SIGBUS. Test: libgui.so unchanged on Shamu before and after this CL. Change-Id: I2197127e8cbfb43f4f553bda6464f6ebe087febd
* | | | | | Merge "Move android_get_control_socket out of line"Treehugger Robot2016-09-233-22/+24
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | |
| * | | | | Move android_get_control_socket out of lineColin Cross2016-09-233-22/+24
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | android_get_control_socket has a warning from the implicit cast from long to int. The warning was being hidden because cutils/sockets.h was included with -isystem. Move android_get_control_socket to sockets.cpp, since we don't want header only dependencies anyways, and fix the warning with a range check and a static_cast. Bug: 31492149 Test: m -j <module that uses sockets.h and -Wall> Change-Id: I1f394ab26d4ec8a7dd0e7907c10416d7f8647624
* | | | | Merge "Give wifi_hal_legacy access to netlink"Treehugger Robot2016-09-231-0/+3
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Give wifi_hal_legacy access to netlinkMitchell Wills2016-09-131-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | Bug: 31352200 Change-Id: I02bbbbc2be028b482d5c3d3e903ed2c9addebd77
* | | | | Merge "Base: Add more log macros"Treehugger Robot2016-09-222-28/+465
|\ \ \ \ \
| * | | | | Base: Add more log macrosAndreas Gampe2016-09-222-28/+465
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add WOULD_LOG to determine whether a given severity would be logged. Add LOG_STREAM to have direct access to a logging stream. Add LOG_S variants that take a fully qualified severity. This allows complex expressions as parameters, e.g., ternaries for conditional severity levels. Add tests. Bug: 31338270 Test: m Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64 Change-Id: I242b960594e68caff6db9cd8aaa4ce8aaf90474c
* | | | | | Merge "Fix warnings in libutils headers"Treehugger Robot2016-09-2214-85/+115
|\ \ \ \ \ \
| * | | | | | Fix warnings in libutils headersColin Cross2016-09-2214-85/+115
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system/core/include is included in the global include path using -isystem, which hides all warnings. Fix warnings in libutils headers in preparation for moving from -isystem to -I. - Fix implicit cast from int64_t to long in Condition.h. Remove the __LP64__ check and always compare against LONG_MAX before casting. - Fix implicit cast from size_t to ssize_t in KeyedVector.h - Fix -Wshadow-field-in-constructor warnings in Looper.h and RefBase.h - Move destructors for MessageHandler and LooperCallback to Looper.cpp and ReferenceRenamer and VirtualLightRefBase to RefBase.cpp to prevent vtables in every compilation unit. - Declare template variables in Singleton.h - Fix old-style casts in StrongPointer.h and TypeHelpers.h - Use template metaprogramming in TypeHelpers.h to avoid warnings on memmove on non-trivial types. - Add an assignment operator to key_value_pair_t to complete rule-of-three - Use memcpy instead of dereferencing a reinterpret_casted pointer to treat the bits of a float or double as int32_t or int64_t - Escape unicode sequences inside doxygen comments between \code and \endcode - Remove WIN32 ZD definition in Compat.h, %zd works fine with mingw - Fix WIN32 printf warnings in Filemap.cpp - Initialize mNullValue with 0 in LruCache.h, some of the tests use a non-pointer type for TValue. Test: m -j native Bug: 31492149 Change-Id: I385a05a3ca01258e44fe3b37ef77e4aaff547b26
* | | | | | Merge "Remove has_trivial_move trait from Vector<T>"Colin Cross2016-09-223-15/+0
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Remove has_trivial_move trait from Vector<T>Colin Cross2016-09-223-15/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Vector<T> objects are a dynamic type with a vtable, which is not trivially moveable. Impact on aapt for frameworks-res is negligible, ~3%. Bug: 31595853 Test: m -j framework-res Change-Id: I8a3269c35d95affb6e86d60588bcfca46db7f445
* | | | | | Merge "We should break from loop after getting connected."Treehugger Robot2016-09-221-0/+1
|\ \ \ \ \ \
| * | | | | | We should break from loop after getting connected.Tao Wu2016-09-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now it always connects to multiple address of same host and just return one socket while other sockets get leaked. Also, it cause trouble on machine with dual stack. adb connect localhost:* just connect to IPv4 and IPv6 at same time and finally it doesn't work since emulator can only handle one adb connection. To test this, start an emulator with non-standar port and killall adb daemon on linux work station and then do following test. Test: adb connect localhost:12345;lsof -n -p `pgrep adb` Change-Id: I1e0f6824efc1db8e179377de068e3b5535aff3f7
* | | | | | | Merge "Ignore setsid error in some cases."Treehugger Robot2016-09-221-1/+3
|\ \ \ \ \ \ \
| * | | | | | | Ignore setsid error in some cases.Tao Wu2016-09-201-1/+3
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the calling process has already been a leading process of session. setsid just fail with EPERM, ignore such error. Test: killall adb;exec 3>f;adb fork-server server --reply-fd 3 & cat f Change-Id: I1aeac079f29e10aa63ed724b5a43663f25c25ad5 Signed-off-by: Tao Wu <lepton@google.com>
* | | | | | | Merge "Add missing include."Treehugger Robot2016-09-221-0/+1
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | |
| * | | | | | Add missing include.Dan Albert2016-09-211-0/+1
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Test: mm Bug: None Change-Id: I8be335ed677e8646d3912ac3db49451bff66eb65
* | | | | | Merge "Fix warnings in system/ headers"Treehugger Robot2016-09-224-11/+29
|\ \ \ \ \ \
| * | | | | | Fix warnings in system/ headersColin Cross2016-09-214-11/+29
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system/core/include is included in the global include path using -isystem, which hides all warnings. Fix warnings in system/core/include/system in preparation for moving from -isystem to -I. - Fix invalid doxygen syntax in graphics.h - Use a pragma to hide a C99 extension warning on the flexible length array in graphics.h - Make static functions in radio.h static inline - Fix size_t printf and size_t vs. ssize_t comparision in qemu_pipe.h - Fix old style cast in window.h Test: m -j native Bug: 31492149 Change-Id: I857f289e4c8e303494831873282bbb69de155c10
* | | | | | Merge "adb: kill adb_mutex_t, adb_cond_t."Treehugger Robot2016-09-2211-277/+142
|\ \ \ \ \ \
| * | | | | | adb: kill adb_mutex_t, adb_cond_t.Josh Gao2016-09-2111-277/+142
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that we have support for std::mutex and std::condition_variable on Windows, remove our mutex compatibility layer in favor of the C++ one. Bug: http://b/31653591 Test: mma && $ANDROID_HOST_OUT/nativetest64/adb_test/adb_test && \ python test_adb.py && python test_device.py (also on Windows) Change-Id: I5b7ed9c45cc2a32edcf4e77b56dc28e441f15f34
* | | | | | | Merge "Remove net_bt_stack group and replace it with bluetooth"Ajay Panicker2016-09-223-8/+6
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | |
| * | | | | | Remove net_bt_stack group and replace it with bluetoothAjay Panicker2016-09-203-8/+6
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | Bug: 31549206 Change-Id: I667963e5f9fd1a5dc9ad74378b318e3b782e6883
* | | | | | Merge "Hide warning in cutils/trace.h"Colin Cross2016-09-223-2/+9
|\ \ \ \ \ \
| * | | | | | Hide warning in cutils/trace.hColin Cross2016-09-213-2/+9
| | |_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | system/core/include is included in the global include path using -isystem, which hides all warnings. cutils/trace.h has an ignored return value warning, move the implementation to trace-dev.c so it doesn't cause warnings in every module that includes it in preparation for moving from -isystem to -I. Test: m -j native Bug: 31492149 Change-Id: If8b3fe13059c9e59c2d5208294d427d84fa6e588