Commit Graph

20449 Commits

Author SHA1 Message Date
Yabin Cui cfb0c5cd91 Merge "adb: retry connecting disconnected emulators instead of always looping."
am: 50e91fec0e

* commit '50e91fec0e33b92e7991622ac1e8be8817208692':
  adb: retry connecting disconnected emulators instead of always looping.

Change-Id: Ifa2dcddea99aa8070b6cdb1cddabfe20e701aca0
2016-05-26 01:58:01 +00:00
Yabin Cui 50e91fec0e Merge "adb: retry connecting disconnected emulators instead of always looping." 2016-05-26 01:32:53 +00:00
Michael Ryleev 420d64de7b Merge "trusty: storageproxyd: use upstream kernel headers"
am: ed01d17e1b

* commit 'ed01d17e1bf54edad1989c2da7505e0efb673a9b':
  trusty: storageproxyd: use upstream kernel headers

Change-Id: Ia527c3f104caaced60b0a1597951358861019be1
2016-05-25 15:47:55 +00:00
Michael Ryleev ed01d17e1b Merge "trusty: storageproxyd: use upstream kernel headers" 2016-05-25 15:40:05 +00:00
Yabin Cui b74c6498aa adb: retry connecting disconnected emulators instead of always looping.
Previously we loop through local ports every second, this patch improves
the strategy by retrying only just disconnected emulators.

Bug: 26468076
Bug: 19974213
Bug: 22920867

Change-Id: I43ccb746922d104202b0f81a3d163d850bbc890e
2016-05-24 16:38:47 -07:00
Michael Ryleev 462461bd28 trusty: storageproxyd: use upstream kernel headers
Force usage of upstream kernel headers to pull in
definition of rpmb related structures.

This change is required until b/25567964 is resolved.

Change-Id: Ic710d32281dcdd093f6308b82ee937143b692613
Bug: 25567964
2016-05-24 14:52:38 -07:00
Michael Ryleev 5cf2f5946c Merge changes I40c9ea47,I593aeed5
am: c7878469be

* commit 'c7878469be6be610a38da4e41ae1fe1d63d431eb':
  trusty: storage: add tests
  trusty: storage: add client lib for testing

Change-Id: I74fb708a0cf211202eb50b1f5e097a9cd587a88d
2016-05-24 19:37:30 +00:00
Michael Ryleev c7878469be Merge changes I40c9ea47,I593aeed5
* changes:
  trusty: storage: add tests
  trusty: storage: add client lib for testing
2016-05-24 19:23:50 +00:00
Yabin Cui 3082ca20a0 Merge "adb: close ep0 on disconnection."
am: 18013f2083

* commit '18013f2083d9372cc03d9c9281bc3a168e049da9':
  adb: close ep0 on disconnection.

Change-Id: I3d65b981a568ec606c09e35874474a5179f10e6c
2016-05-24 02:40:28 +00:00
Treehugger Robot 18013f2083 Merge "adb: close ep0 on disconnection." 2016-05-24 02:32:57 +00:00
Yabin Cui 638420ef31 adb: close ep0 on disconnection.
adbd on device kicks the usb connection when usb IO fails. But to notify
adb on host to reconnect it, adbd needs to close ep0 to reset the usb
connection. Otherwise, adb on host cann't connect the device unless the
usb cable is reconnected or adb host server is restarted.

This can be tested by using `adb reconnect device` command.

Bug: 25935458

Change-Id: I80979d6029e60b9cfd218f7b9b5201810238ec07
(cherry picked from commit 69e97e4bee)
2016-05-23 17:17:46 -07:00
Hans Boehm 1e081a8c5f Merge "Fix SharedBuffer. Remove aref."
am: 069517574e

* commit '069517574eede4fa8fd69a0e1bc4e5d70c18149c':
  Fix SharedBuffer. Remove aref.

Change-Id: I32fda0aee04aa890fa03b1e56fefbebab3d50531
2016-05-23 22:18:07 +00:00
Hans Boehm 069517574e Merge "Fix SharedBuffer. Remove aref." 2016-05-23 22:11:02 +00:00
Hans Boehm 3e4c076ef2 Fix SharedBuffer. Remove aref.
Add comment that SharedBuffer is deprecated.

Both aref and SharedBuffer had memory ordering bugs.  Aref has no
clients.

SharedBuffer had several bugs, which are fixed here:

mRefs was declared neither volatile, not atomic, allowing the
compiler to, for example, reuse a stale previously loaded value.

It used the default android_atomic release memory ordering, which
is insufficient for reference count decrements.

It used an ordinary memory read in onlyOwner() to check whether
an object is safe to deallocate, without any attempt to ensure
memory ordering.

Comments claimed that SharedBuffer was exactly 16 bytes, but
this was neither checked, nor correct on 64-bit platforms.

This turns mRef into a std::atomic and removes the android_atomic
dependency.

Bug: 28826227
Change-Id: I39fa0b4f70ac0471b14ad274806fc4e0c0802e78
2016-05-23 17:28:52 +00:00
Yabin Cui 1a78ec8f65 Merge "adb: check return value of register_socket_transport."
am: 3d981c87c9

* commit '3d981c87c929ec4946ce53d2aaa3503c86886eb1':
  adb: check return value of register_socket_transport.

Change-Id: I3b0983e1ccda4c0c29d1f971ba3402ec384ef2a8
2016-05-21 01:24:28 +00:00
Yabin Cui 3d981c87c9 Merge "adb: check return value of register_socket_transport." 2016-05-21 01:12:35 +00:00
Chih-Hung Hsieh 3252d11498 Merge "Fix misc-macro-parentheses warnings in lmkd."
am: 86ed22cf27

* commit '86ed22cf27193e5d64f617ec68c8016166c7e4f4':
  Fix misc-macro-parentheses warnings in lmkd.

Change-Id: Id5772ecec918e9ad3c8952ddfcd23e13dbf3122a
2016-05-19 22:55:44 +00:00
Treehugger Robot 86ed22cf27 Merge "Fix misc-macro-parentheses warnings in lmkd." 2016-05-19 22:42:26 +00:00
Hans Boehm d657e639cf Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp"
am: 62212954ef

* commit '62212954efc9cd4ddfa91f100ec4ecec27315e42':
  Fix memory order and race bugs in Refbase.h & RefBase.cpp

Change-Id: I4b17f76ec7162090deb84b5ec83b3e765dddb186
2016-05-19 22:09:14 +00:00
Hans Boehm 62212954ef Merge "Fix memory order and race bugs in Refbase.h & RefBase.cpp" 2016-05-19 22:01:41 +00:00
Dmitry Shmidt 7fd1c0750f Merge "HACK: libnetutils: Remove parameters from dhcpcd service call"
am: 97da9225d9

* commit '97da9225d911ffdabd4f77d9f6868f3860637b06':
  HACK: libnetutils: Remove parameters from dhcpcd service call

Change-Id: I7665738b70f70214c9a8b924ca3ff8af06b8f9a9
2016-05-19 01:05:10 +00:00
Treehugger Robot 97da9225d9 Merge "HACK: libnetutils: Remove parameters from dhcpcd service call" 2016-05-19 01:02:40 +00:00
Chih-Hung Hsieh 1cff850bb3 Merge "Fix misc-macro-parentheses warnings in liblog."
am: 2bd428e1f9

* commit '2bd428e1f9c2fb4459b37b3bda95143319d78728':
  Fix misc-macro-parentheses warnings in liblog.

Change-Id: I045e4f16264c39316456cd1e5c9b3df869c5701b
2016-05-19 00:59:57 +00:00
Chih-Hung Hsieh e98251ed61 Merge "Fix misc-macro-parentheses warnings in libion, libsparse, libmem*"
am: 3e3741aa7f

* commit '3e3741aa7fd414272a3c9c244e56e663dfa7ad1c':
  Fix misc-macro-parentheses warnings in libion, libsparse, libmem*

Change-Id: I01af8be27569a2b8c1f85e468fdb1d6ebbb23e93
2016-05-19 00:59:56 +00:00
Chih-hung Hsieh 2bd428e1f9 Merge "Fix misc-macro-parentheses warnings in liblog." 2016-05-19 00:48:44 +00:00
Chih-hung Hsieh 3e3741aa7f Merge "Fix misc-macro-parentheses warnings in libion, libsparse, libmem*" 2016-05-19 00:48:32 +00:00
Josh Gao 43c058e51a Merge "adb: use asocket\'s close function when closing."
am: 684d543922

* commit '684d543922465538dd233c99c0cf492f1f24233c':
  adb: use asocket's close function when closing.

Change-Id: Icb05f95c2cb16800dd114f52e6f301dae72ad654
2016-05-19 00:13:12 +00:00
Treehugger Robot 684d543922 Merge "adb: use asocket's close function when closing." 2016-05-19 00:11:03 +00:00
Chih-Hung Hsieh fa7569c921 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace."
am: dab7d9de03

* commit 'dab7d9de03369feeb099be6c8f7748df3f466bd3':
  Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.

Change-Id: I6fc423fc3eb08c6e44a3d7261ae0e1b87ce0e993
2016-05-19 00:02:55 +00:00
Treehugger Robot dab7d9de03 Merge "Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace." 2016-05-18 23:54:40 +00:00
Josh Gao 71c062f40a Merge changes I5e56f17f,Ie3748b6c,I4e1d56a8
am: cea14958d2

* commit 'cea14958d2903f136f8874238ccff4da1b0d38d9':
  adb: switch the socket list mutex to a recursive_mutex.
  adb: clang-format sockets.cpp.
  adb: add implementations of mutex, recursive_mutex.

Change-Id: I8ec365c99dbc1dc402d62a8401df937ae6ae3a6b
2016-05-18 23:19:42 +00:00
Treehugger Robot cea14958d2 Merge changes I5e56f17f,Ie3748b6c,I4e1d56a8
* changes:
  adb: switch the socket list mutex to a recursive_mutex.
  adb: clang-format sockets.cpp.
  adb: add implementations of mutex, recursive_mutex.
2016-05-18 23:14:42 +00:00
Dmitry Shmidt 1288f65b3b HACK: libnetutils: Remove parameters from dhcpcd service call
init is not accepting parameters, therefore adding them
will cause to serivce failure. This is a temporary solution.

Change-Id: I0faa482f76b5af5f91723b0d4ef348aafd5694df
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
2016-05-18 16:01:15 -07:00
Chih-Hung Hsieh 67867dbd79 Fix misc-macro-parentheses warnings in adb, debuggerd, libbacktrace.
Bug: 28705665
Change-Id: I469b2a882f6d1f399bfc22c75a26da245991fc33
2016-05-18 15:53:15 -07:00
Chih-Hung Hsieh f0f94fe49b Fix misc-macro-parentheses warnings in liblog.
Bug: 28705665
Change-Id: Ib272a83cb93b09d986c19a40e23a2679b9e17558
2016-05-18 15:48:50 -07:00
Chih-Hung Hsieh eabd5108b3 Fix misc-macro-parentheses warnings in libion, libsparse, libmem*
Bug: 28705665
Change-Id: I3dd5c086787f5e48ab100a71a42109ea0e417bf9
2016-05-18 15:41:16 -07:00
Chih-Hung Hsieh 2b82e918d8 Fix misc-macro-parentheses warnings in lmkd.
Bug: 28705665
Change-Id: I43388c0f9fdc8c2a0c0f4495f96bbc27e3de8a1d
2016-05-18 15:37:20 -07:00
Josh Gao 53eb31d87c adb: use asocket's close function when closing.
close_all_sockets was assuming that all registered local sockets used
local_socket_close as their close function. However, this is not true
for JDWP sockets.

Bug: http://b/28347842
Change-Id: I40a1174845cd33f15f30ce70828a7081cd5a087e
2016-05-18 14:21:53 -07:00
Josh Gao 9b587dec6d adb: switch the socket list mutex to a recursive_mutex.
sockets.cpp was branching on whether a socket close function was
local_socket_close in order to avoid a potential deadlock if the socket
list lock was held while closing a peer socket.

Bug: http://b/28347842
Change-Id: I5e56f17fa54275284787f0f1dc150d1960256ab3
2016-05-18 14:21:53 -07:00
Josh Gao 52bd8526aa adb: clang-format sockets.cpp.
Bug: http://b/28347842
Change-Id: Ie3748b6c803d4e8056e9d7abd065a8b99d945a5b
2016-05-18 14:21:53 -07:00
Josh Gao 903b749f78 adb: add implementations of mutex, recursive_mutex.
Our version of mingw doesn't support std::mutex or
std::recursive_mutex, so implement our own using the Windows primitives.

Bug: http://b/28347842
Change-Id: I4e1d56a89bc5fcb5f859bf5014343697a4a85b77
2016-05-18 14:21:53 -07:00
Michael Ryleev e2d6564818 trusty: storage: add tests
Change-Id: I40c9ea47e1304ef35db3d5936b001b63f3a9795e
2016-05-18 13:31:36 -07:00
Michael Ryleev abebb89359 trusty: storage: add client lib for testing
Change-Id: I593aeed5f657b5de1fce47264ae31aa6e79f2a63
2016-05-18 13:31:36 -07:00
Mark Salyzyn 0a7dec432c Merge "liblog: log reader validate headers"
am: 0321476fe2

* commit '0321476fe2aedf9a0b960508b52681ee5f1d555e':
  liblog: log reader validate headers

Change-Id: I21832a3908161e489a04a127508e2339e7f29bce
2016-05-18 14:25:26 +00:00
Mark Salyzyn 0321476fe2 Merge "liblog: log reader validate headers" 2016-05-18 14:19:04 +00:00
Hans Boehm e263e6c633 Fix memory order and race bugs in Refbase.h & RefBase.cpp
Convert to use std::atomic directly.

Consistently use relaxed ordering for increments, release ordering
for decrements, and an added acquire fence when the count goes to
zero.

Fix what looks like another race in attemptIncStrong:
It seems entirely possible that the final adjustment for
INITIAL_STRONG_VALUE would see e.g. INITIAL_STRONG_VALUE + 1,
since we could be running in the middle of another initial
increment.

Attempt to somewhat document what this actually does, and
what's expected from the client. Hide the documentation in
the .cpp file for now.

Remove a confusing redundant test in decWeak. OBJECT_LIFETIME_STRONG
and OBJECT_LIFETIME_WEAK are the only options, in spite of some
of the original comments.

It's conceivable that either of these issues has resulted in
actual crashes, though I would guess the probability is small.
It's hard enough to reason about this code without the bugs.

Bug: 28705989
Change-Id: I4107a56c3fc0fdb7ee17fc8a8f0dd7fb128af9d8
2016-05-17 16:11:11 -07:00
Dimitry Ivanov 3457aba394 Merge "Set parent namespace for linker-namespaces"
am: ac50d0cc57

* commit 'ac50d0cc5789d8462fcd2d9f6cb225e0edf9a12f':
  Set parent namespace for linker-namespaces

Change-Id: I832b3f228873e93a8b9a00e365af561f10b41eb2
2016-05-17 22:58:45 +00:00
Josh Gao 4e1149bb15 Merge "adb: replace failing exits in adbd with abort()."
am: eb62619ff9

* commit 'eb62619ff9211ecee2a5c6ce4475b7d6baf9cb0e':
  adb: replace failing exits in adbd with abort().

Change-Id: I6b5b5b61c18b6afb2e1e96cab6ba8704d9115bcc
2016-05-17 22:58:38 +00:00
Josh Gao 32045567be Merge "adb: add track-jdwp and track-devices commands."
am: f8f40a1e2e

* commit 'f8f40a1e2e6162b7f334f83a10f6a5d9ef44f75f':
  adb: add track-jdwp and track-devices commands.

Change-Id: I96e185b1235aaa2c82371a53415fa44c57444dac
2016-05-17 22:58:34 +00:00
Treehugger Robot ac50d0cc57 Merge "Set parent namespace for linker-namespaces" 2016-05-17 22:43:01 +00:00