Commit Graph

24156 Commits

Author SHA1 Message Date
Elliott Hughes 5dc7e6a79a Merge "Switch adb to <android-base/properties.h>."
am: d9a23b5733

Change-Id: I09a1832143d9f54cd67128602c9e518a1b398b5c
2016-09-26 22:19:04 +00:00
Treehugger Robot d9a23b5733 Merge "Switch adb to <android-base/properties.h>." 2016-09-26 21:58:16 +00:00
Mitchell Wills d62dcfa03f Merge "Add fastboot --skip-reboot flag"
am: 60a99eb8f7

Change-Id: Id3ee7f6603437fae7ed26e8af93235f6531e0219
2016-09-26 21:13:23 +00:00
Treehugger Robot 60a99eb8f7 Merge "Add fastboot --skip-reboot flag" 2016-09-26 21:08:07 +00:00
Elliott Hughes ffdec18017 Switch adb to <android-base/properties.h>.
Bug: http://b/23102347
Test: manual
Change-Id: Iffa66258c01f84f41b9af99ab5e768a0a2669106
2016-09-26 13:14:14 -07:00
Mitchell Wills 31dce302db Add fastboot --skip-reboot flag
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
2016-09-26 11:27:16 -07:00
Andreas Gampe 8ca0a71c51 Merge "Base: Remove LOG_S variants."
am: aa00f5852f

Change-Id: Iac81601db10497ac7416752c25cc4cddb3434756
2016-09-26 00:42:28 +00:00
Treehugger Robot aa00f5852f Merge "Base: Remove LOG_S variants." 2016-09-26 00:37:13 +00:00
Andreas Gampe 1f5fb43047 Base: Remove LOG_S variants.
Partially reverts commit 436f5a031f.

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
2016-09-24 10:18:38 -07:00
Elliott Hughes 621127a2cb Merge "Add std::string system property functions."
am: 3f049c3f19

Change-Id: Ib8c802c8c4e00e7b601c5eb1e6d64693954f5b94
2016-09-24 04:59:55 +00:00
Treehugger Robot 3f049c3f19 Merge "Add std::string system property functions." 2016-09-24 04:52:59 +00:00
Andreas Gampe 1f03df8155 Merge "Base: Check severity in destructor"
am: 19a7696488

Change-Id: I07f89e907304d754523f9026f857b5c94601b6e3
2016-09-23 23:15:49 +00:00
Treehugger Robot 19a7696488 Merge "Base: Check severity in destructor" 2016-09-23 23:12:09 +00:00
David Pursell bb276d8555 Merge "Flattenable: switch from assignment to memcpy()."
am: b2356a6993

Change-Id: I3d4cb834d67693c65e71af6a7c360eb82b31b055
2016-09-23 22:51:49 +00:00
David Pursell b2356a6993 Merge "Flattenable: switch from assignment to memcpy()." 2016-09-23 22:46:03 +00:00
Elliott Hughes 1e88c8c0ac Add std::string system property functions.
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
2016-09-23 15:30:22 -07:00
David Pursell 2ebce7384b Flattenable: switch from assignment to memcpy().
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
2016-09-23 13:56:40 -07:00
Colin Cross 4873829953 Merge "Move android_get_control_socket out of line"
am: 4b5abcdba2

Change-Id: If427dfca41a23d94f2f026edbeb0dc8cd73a4724
2016-09-23 20:56:39 +00:00
Treehugger Robot 4b5abcdba2 Merge "Move android_get_control_socket out of line" 2016-09-23 20:49:19 +00:00
Andreas Gampe 19ff8f1e57 Base: Check severity in destructor
Bug: 31338270
Test: m
Test: mmma system/core/base && $ANDROID_HOST_OUT/nativetest64/libbase_test/libbase_test64
Change-Id: Ic077822bcfd591bd11f4fa9d4b6e440b461c70c1
2016-09-23 13:31:52 -07:00
Colin Cross e8ffa449fd Move android_get_control_socket out of line
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
2016-09-23 11:26:08 -07:00
Mitchell Wills c3d7cb95cc Merge "Give wifi_hal_legacy access to netlink"
am: 6fc7eaaad0

Change-Id: Ia3a6d48dab8123a5dc4e42d4b0d271d2e2c880e2
2016-09-23 16:32:57 +00:00
Treehugger Robot 6fc7eaaad0 Merge "Give wifi_hal_legacy access to netlink" 2016-09-23 16:27:41 +00:00
Andreas Gampe 9148006e85 Merge "Base: Add more log macros"
am: 58af713d8a

Change-Id: Ia8a446e8e2609f2d7e31bcfb1eec83fc82bbeebb
2016-09-22 23:59:10 +00:00
Treehugger Robot 58af713d8a Merge "Base: Add more log macros" 2016-09-22 23:56:48 +00:00
Colin Cross 0f79b62bf6 Merge "Fix warnings in libutils headers"
am: 65a1633ec3

Change-Id: I65b7448a5aeaa868e40dfdda2b7cd8a6eb54a9e2
2016-09-22 21:55:34 +00:00
Treehugger Robot 65a1633ec3 Merge "Fix warnings in libutils headers" 2016-09-22 21:24:49 +00:00
Colin Cross 17b5b82d64 Fix warnings in libutils headers
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
2016-09-22 13:03:15 -07:00
Colin Cross 85942090f6 Merge "Remove has_trivial_move trait from Vector<T>"
am: 588b3b0c03

Change-Id: I0af14f7684649780f2f98c4cd613d8b946e80466
2016-09-22 19:57:04 +00:00
Andreas Gampe 436f5a031f Base: Add more log macros
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
2016-09-22 12:47:40 -07:00
Colin Cross 588b3b0c03 Merge "Remove has_trivial_move trait from Vector<T>" 2016-09-22 19:44:28 +00:00
Colin Cross 097395532b Remove has_trivial_move trait from Vector<T>
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
2016-09-22 10:14:05 -07:00
Tao Wu 646a70b1fb Merge "We should break from loop after getting connected."
am: 53171e5f97

Change-Id: I442495aee3fe8815379efc4f039e98c6d61151f1
2016-09-22 08:22:28 +00:00
Tao Wu 324acdce69 Merge "Ignore setsid error in some cases."
am: 3562fd0fa8

Change-Id: I8ff768ce0e4ddd5e2810e40302bf597e2f39387b
2016-09-22 08:22:14 +00:00
Dan Albert a8b88e1de7 Merge "Add missing include."
am: 55123dfa39

Change-Id: Ie0aafdd29e500d1d7c074c73b54e2a7ee8a95e93
2016-09-22 08:21:58 +00:00
Colin Cross 299df0bf01 Merge "Fix warnings in system/ headers"
am: d7f60fd871

Change-Id: I616548e002f517fe9f85b49aef9d9b6a5548127e
2016-09-22 08:21:43 +00:00
Josh Gao 72c679d6d0 Merge "adb: kill adb_mutex_t, adb_cond_t."
am: 7e4d1db957

Change-Id: I3e10b6e3039e3aeb966f8ca27df69b61fa8aa0cc
2016-09-22 08:21:30 +00:00
Ajay Panicker f924c252bd Merge "Remove net_bt_stack group and replace it with bluetooth"
am: 7875407bb7

Change-Id: Idd864e20abbe5d9394c63e92ab8a8ac2b020c2e7
2016-09-22 08:09:39 +00:00
Treehugger Robot 53171e5f97 Merge "We should break from loop after getting connected." 2016-09-22 06:41:49 +00:00
Treehugger Robot 3562fd0fa8 Merge "Ignore setsid error in some cases." 2016-09-22 06:28:51 +00:00
Treehugger Robot 55123dfa39 Merge "Add missing include." 2016-09-22 05:40:11 +00:00
Treehugger Robot d7f60fd871 Merge "Fix warnings in system/ headers" 2016-09-22 02:46:51 +00:00
Tao Wu 9b7341fe57 We should break from loop after getting connected.
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
2016-09-21 19:45:54 -07:00
Treehugger Robot 7e4d1db957 Merge "adb: kill adb_mutex_t, adb_cond_t." 2016-09-22 02:15:00 +00:00
Ajay Panicker 7875407bb7 Merge "Remove net_bt_stack group and replace it with bluetooth" 2016-09-22 01:32:34 +00:00
Colin Cross a802e570b3 Merge "Hide warning in cutils/trace.h"
am: 5cf3db6d2b

Change-Id: Ie32731764880823560d79aa6cbcc17faf5cd5bf8
2016-09-22 00:55:11 +00:00
Colin Cross 9eb3592e62 Merge "Hide gnu extension warnings in log/log.h"
am: 21049e5c91

Change-Id: Ie25019ffacd234d06e46d40547858009d8341fa3
2016-09-22 00:54:58 +00:00
Colin Cross 7c7990e6fd Fix warnings in system/ headers
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
2016-09-21 17:46:59 -07:00
Colin Cross 5cf3db6d2b Merge "Hide warning in cutils/trace.h" 2016-09-22 00:46:13 +00:00
Colin Cross 9993e799f1 Hide warning in cutils/trace.h
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
2016-09-21 17:45:31 -07:00