Commit graph

11756 commits

Author SHA1 Message Date
Yabin Cui
631965a32e am e862350b: Merge "Kill HAVE_PTHREADS."
* commit 'e862350bb2eb3d3eda526da7f3b6d5c2dd40a445':
  Kill HAVE_PTHREADS.
2015-01-27 22:45:14 +00:00
Yabin Cui
e862350bb2 Merge "Kill HAVE_PTHREADS." 2015-01-27 22:33:28 +00:00
Yabin Cui
4a6e5a3b64 Kill HAVE_PTHREADS.
Bug: 19083585
Change-Id: Ic09eb3dd250bc5c5b63cac7998f99f5fa007f407
2015-01-27 14:23:22 -08:00
Elliott Hughes
a3029782d4 am c6091d6b: Merge "adb: Win32: set socket buffer sizes properly"
* commit 'c6091d6bfd1c74df7f5352b3de2b3dbdd64a98bd':
  adb: Win32: set socket buffer sizes properly
2015-01-27 18:33:49 +00:00
Elliott Hughes
c6091d6bfd Merge "adb: Win32: set socket buffer sizes properly" 2015-01-27 18:17:40 +00:00
Spencer Low
f055c193b8 adb: Win32: set socket buffer sizes properly
On Windows, adb_socket_setbufsize() was taking a file descriptor value
from the compatibility layer in sysdeps_win32.c (namely, an index into
the _win32_fhs array) and passing it to the Winsock setsockopt() call,
which wants a Winsock SOCKET handle. Basically, adb_socket_setbufsize()
was passing `fd` instead of `_fh_from_int(fd)->fh_socket`, resulting in
adb effectively setting a socket buffer size on a random socket in the
process.

The fix is to introduce adb_setsockopt() which just calls setsockopt()
on non-Win32, and which uses the Winsock SOCKET handle on Win32. The
change also moves Win32 disable_tcp_nagle() to a header and adds an
extra sanity check to adb_shutdown().

Change-Id: I4354e818d27538f7ff5b0e70b28bdb6300e1b98b
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-01-26 21:56:26 -08:00
Dan Albert
40c6d42034 am a76f057a: Merge "Protect from eng vs userdebug build breaks."
* commit 'a76f057af81b7a03c9c18af0bcb763f7e7f03fbf':
  Protect from eng vs userdebug build breaks.
2015-01-27 02:23:38 +00:00
Dan Albert
72760253f0 am fe685787: Merge "Fix userdebug build."
* commit 'fe68578716290d93fd42005622adade8d345de3c':
  Fix userdebug build.
2015-01-27 02:18:48 +00:00
Dan Albert
3346eb65f9 am accebbfc: Merge "Fix win_sdk build."
* commit 'accebbfc3e05005719ef3a1510f4b19c22978333':
  Fix win_sdk build.
2015-01-27 02:18:47 +00:00
Dan Albert
73f4d91481 am 64a5ff96: Merge "Begin moving code from adb to libadb."
* commit '64a5ff963c894f9ff622ae1de370a98f2bd5af62':
  Begin moving code from adb to libadb.
2015-01-27 02:08:49 +00:00
Christopher Ferris
5661de2f9b am 55dfa96b: Merge "Remove the pt_regs_mips_t structure."
* commit '55dfa96b1f3587f6c003f3c9d0f4ff794a5fc329':
  Remove the pt_regs_mips_t structure.
2015-01-27 02:08:48 +00:00
Dan Albert
a76f057af8 Merge "Protect from eng vs userdebug build breaks." 2015-01-27 02:04:57 +00:00
Dan Albert
1f09bdaf59 Protect from eng vs userdebug build breaks.
Using a const bool rather than an ifdef means the compiler can still
protect us from breaking code paths that aren't included in every
build variant.

Change-Id: Ic45c8fb52cd66c3ce090d760cdb92104e31265f5
2015-01-26 17:49:17 -08:00
Dan Albert
fe68578716 Merge "Fix userdebug build." 2015-01-27 01:30:24 +00:00
Dan Albert
accebbfc3e Merge "Fix win_sdk build." 2015-01-27 01:16:06 +00:00
Dan Albert
030b76fc1d Fix userdebug build.
Apparently this code I thought was unused is just unused for eng
builds...

Bug: 17626262
Change-Id: I2e5f411a2ead7f23d9f5822935de66c992750a03
2015-01-26 17:14:23 -08:00
Dan Albert
4626b71057 Fix win_sdk build.
Hadn't caught this in the previous submission because I tested the
build with another change on top of it that also fixes this.

Bug: 17626262
Change-Id: Ia40127618a5466e382081760d614ff7fc09d50a3
2015-01-26 17:07:47 -08:00
Dan Albert
64a5ff963c Merge "Begin moving code from adb to libadb." 2015-01-27 00:50:49 +00:00
Dan Albert
630b9afeb0 Begin moving code from adb to libadb.
Much of adb is duplicated in bootable/recovery/minadb and fastboot.
Changes made to adb rarely get ported to the other two, so the trees
have diverged a bit. We'd like to stop this because it is a
maintenance nightmare, but the divergence makes this difficult to do
all at once. For now, we will start small by moving common files into
a static library. Hopefully some day we can get enough of adb in here
that we no longer need minadb.

Bug: 17626262
Change-Id: Ic8d5653bfcc0fec4e1acbece124402355084b864
2015-01-26 16:45:34 -08:00
Christopher Ferris
55dfa96b1f Merge "Remove the pt_regs_mips_t structure." 2015-01-27 00:44:00 +00:00
Christopher Ferris
b817094081 Remove the pt_regs_mips_t structure.
The kernel finally has the pt_regs structure properly defined for mips,
so we don't need to define it ourselves.

Change-Id: Ifdf75ed827cd2390962e9b3a182bdbbf02fe0732
2015-01-26 13:52:35 -08:00
Christopher Ferris
d848d7038b am fb538fb1: Merge "Fix the v2 descriptor handling."
* commit 'fb538fb13d930a7398695d1044ceaaf854949018':
  Fix the v2 descriptor handling.
2015-01-26 21:44:43 +00:00
Christopher Ferris
fb538fb13d Merge "Fix the v2 descriptor handling." 2015-01-26 21:28:06 +00:00
Christopher Ferris
c49f51c451 Fix the v2 descriptor handling.
There was a misinterpretation of how the v2 header works. The flags
in the header indicate what is in the rest of the structure.

Bug: 19127803

Change-Id: I5fa0dae6da51522c9afc4c94838eb6f462208683
2015-01-26 12:50:35 -08:00
Mike Lockwood
c8cc8ea221 am 5abd3d0b: Merge "adbd: tcpip command uses port number from uninitialized memory"
* commit '5abd3d0b79d4f4690058f9d70bf723ebaa99616e':
  adbd: tcpip command uses port number from uninitialized memory
2015-01-26 19:17:14 +00:00
Mike Lockwood
5abd3d0b79 Merge "adbd: tcpip command uses port number from uninitialized memory" 2015-01-26 19:04:43 +00:00
Paul Lawrence
7e890a4d32 am bda62724: Make encryption configurable
* commit 'bda6272446454886339841a62daaa1b66c07ad60':
  Make encryption configurable
2015-01-26 16:22:49 +00:00
Spencer Low
943ef23b3d adbd: tcpip command uses port number from uninitialized memory
If you run `adb tcpip`, adbd tries to process a string of 'tcpip:' using
this code:

    } else if(!strncmp(name, "tcpip:", 6)) {
        int port;
        if (sscanf(name + 6, "%d", &port) == 0) {
            port = 0;
        }
        ret = create_service_thread(restart_tcp_service, (void *) (uintptr_t) port);

If a zero-length string is passed to sscanf(), it returns EOF (-1) which
causes the if statement to skip the block, leaving the port variable
uninitialized.

I found this by running `adb tcpip` and sometimes getting 'invalid port'
and sometimes a device would start listening on a random port number.

The fix is to check the sscanf() return value for the success case (the
number of items successfully parsed), as is already done in other parts
of the adb code. I also fixed-up another instance of the same
code-pattern in services.c.

Change-Id: I8c9c33485ad076828da0ac74f048fdad561669d3
Signed-off-by: Spencer Low <CompareAndSwap@gmail.com>
2015-01-25 17:38:36 -08:00
Elliott Hughes
406865adcb am e21d7ae8: Merge "Remove obsolete BUILD_TINY_ANDROID."
* commit 'e21d7ae89e91a1f6797b74bf7f744b87eb6d2148':
  Remove obsolete BUILD_TINY_ANDROID.
2015-01-25 20:42:52 +00:00
Elliott Hughes
68a6f887e6 am ae79cb5a: Merge "Add missing <string.h> includes."
* commit 'ae79cb5a819bd5bbd86a3496141d45c22db8c86b':
  Add missing <string.h> includes.
2015-01-25 20:42:49 +00:00
Elliott Hughes
e21d7ae89e Merge "Remove obsolete BUILD_TINY_ANDROID." 2015-01-25 16:08:06 +00:00
Elliott Hughes
110dd4b24b Remove obsolete BUILD_TINY_ANDROID.
Change-Id: I876bce99efb40cd791256535d8d6c0d046b7aeae
2015-01-24 22:39:10 -08:00
Elliott Hughes
ae79cb5a81 Merge "Add missing <string.h> includes." 2015-01-25 05:06:52 +00:00
Elliott Hughes
2b7d75d2e6 Add missing <string.h> includes.
Change-Id: I3d1ad54418f69f947e2d829d63b53d44581bfd86
2015-01-24 20:03:09 -08:00
Elliott Hughes
31eac784e2 am d0984932: Merge "Remove obsolete BUILD_TINY_ANDROID check from libsysutils makefile"
* commit 'd09849329347d6dadc1ff79f9b87071ee6875ee8':
  Remove obsolete BUILD_TINY_ANDROID check from libsysutils makefile
2015-01-24 18:18:05 +00:00
Elliott Hughes
d098493293 Merge "Remove obsolete BUILD_TINY_ANDROID check from libsysutils makefile" 2015-01-24 18:06:26 +00:00
Trevor Drake
d1ad84cfa4 Remove obsolete BUILD_TINY_ANDROID check from libsysutils makefile
Change-Id: I3cd1430b1555a5cd27b31ed3eebc1663f43e7b3b
2015-01-24 07:02:50 +00:00
Elliott Hughes
0e0fbdd1fc am 492dd1e5: Merge "Remove obsolete BUILD_TINY_ANDROID check from healthd makefile"
* commit '492dd1e5c1c47bc8a804b58bed941c8eaa94d9a3':
  Remove obsolete BUILD_TINY_ANDROID check from healthd makefile
2015-01-24 05:33:56 +00:00
Elliott Hughes
492dd1e5c1 Merge "Remove obsolete BUILD_TINY_ANDROID check from healthd makefile" 2015-01-24 05:22:14 +00:00
Trevor Drake
27d53d3d86 Remove obsolete BUILD_TINY_ANDROID check from healthd makefile
Change-Id: I7e23236e7725891d07368dd8ea8d667014d7dc78
2015-01-24 04:26:16 +00:00
Chih-Hung Hsieh
7e3fc71ee2 am cb4ae20d: Merge "Enable clang for init, after fix of global .mk files."
* commit 'cb4ae20d7280f0376a79a6e993fd1e9cee1c403d':
  Enable clang for init, after fix of global .mk files.
2015-01-24 01:24:13 +00:00
Chih-Hung Hsieh
cb4ae20d72 Merge "Enable clang for init, after fix of global .mk files." 2015-01-24 01:14:23 +00:00
Mark Salyzyn
49f38385c9 am 3e57869c: Merge "logd: fix persistent blocking reader performance"
* commit '3e57869cccf89fc6f700e61fd13049a17a57637a':
  logd: fix persistent blocking reader performance
2015-01-24 00:31:04 +00:00
Mark Salyzyn
3e57869ccc Merge "logd: fix persistent blocking reader performance" 2015-01-24 00:17:03 +00:00
Dragoslav Mitrinovic
8e8e8db549 logd: fix persistent blocking reader performance
logd suffers major performance degradation when persistent (blocking)
client reader connects to it (e.g. logcat). The root cause of the
degradation is that each time when reader is notified of the arrival
of new log entries, the reader commences its search for the new entries
from the beginning of the linked list (oldest entries first).

This commit alters the search to start from the end of the linked list
and work backwards. This dramatically decreases logd CPU consumption
when blocking reader is connected, and increases the maximum logging
throughput (before the logs start getting lost) by a factor ~ 20.

Change-Id: Ib60955ce05544e52a8b24acc3dcf5863e1e39c5c
2015-01-24 00:10:34 +00:00
Mark Salyzyn
982421df45 am 91581f19: Merge "liblog: add pstore write"
* commit '91581f19906ade01eabc6e10a7dac209e710117a':
  liblog: add pstore write
2015-01-23 23:59:45 +00:00
Mark Salyzyn
95a68d3b5b am 69bdba21: Merge "liblog: use private/android_logger.h"
* commit '69bdba21f6915735c15aa4ba9ad33b9048d7032d':
  liblog: use private/android_logger.h
2015-01-23 23:59:44 +00:00
Mark Salyzyn
f0cc42f525 am 4730328d: Merge "logd: create private/android_logger.h"
* commit '4730328da72ef9b7aeaefc120358155fdfd8dde8':
  logd: create private/android_logger.h
2015-01-23 23:59:43 +00:00
Mark Salyzyn
91581f1990 Merge "liblog: add pstore write" 2015-01-23 23:33:43 +00:00
Mark Salyzyn
d91ab5815d liblog: add pstore write
Used to push the Android log messages into pstore
(when available, and no propagation of error).

Change-Id: I9def8cf796d35d347f502d9745d5f42ec1200253
2015-01-23 23:33:31 +00:00