Properly reset the value of max_fd when it becomes invalid.

When max_fd becomes invalid, iolooper_fd_count() re-counts it.
However, previous implementation forgets resetting max_fd to
be -1. This will leave max_fd with its previous invalid value when
there are no fds to count. max_fd is properly initialized to be
-1 in this commit.

Change-Id: I810fe2fd34b8de64fed5ff025e08d93d34b7085d
Disable the adb qemud pipe by default.

This change sets ro.adb.qemud to 0 by default.  adb sporadically hangs
when it uses the qemud pipe for communication.  Therefore, disable the
pipe unless it has been explicitly enabled.

Change-Id: Ifecdbd1d85793861fa4ad9065e45d47765d0953f
Merge "Disable the adb qemud pipe by default."
Force network port for adb qemu communication.

Ignore the value of the build property ro.adb.qemud and always
use a network port for communication with adb.  This avoids
adb hangs for system images that set ro.adb.qemud=1, which
has been the default setting for several years.

Change-Id: I5595db2ec1efd2daba16f29ebd072850fccebc47
Merge "Force network port for adb qemu communication."
Merge "Properly reset the value of max_fd when it becomes invalid." into idea133
Merge "Properly reset the value of max_fd when it becomes invalid." into idea133
automerge: c9e7514

* commit 'c9e75145085456c626cda712149590c4a722dcd4':
  Properly reset the value of max_fd when it becomes invalid.
android-configure.sh: Use GCC 4.8 on Linux.

Using GCC 4.8 was disabled because it broke MIPS emulation,
however GCC 4.6 was removed from the aosp/master platform
manifest, making android-configure.sh fail when trying
to run it from an AOSP master checkout.

This patch re-enables GCC 4.8, and a future patch will un-break
MIPS support by upgrading the code generator (TCG).

Change-Id: I287c58fd971dee346a27fd64fa12dfa32a355188
TCG: Update to QEMU 2.0.0 version.

QEMU 2.0.0 was just released, so upgrade TCG to its version,
this matches the changes up to the following upstream commit:

  1a8e80d7e82aa385ad887dba5d039e399a18264b

For the record, this fixes MIPS emulation on 32-bit Linux (which
crashed the emulator), but also degrades regular ARM emulation by
about 10% (sadly, due to upstream changes we can't control here).

Change-Id: I6da1ee5a59c3b636455abcbed23feb854366354a
Merge changes I6da1ee5a,I287c58fd

* changes:
  TCG: Update to QEMU 2.0.0 version.
  android-configure.sh: Use GCC 4.8 on Linux.
android/base/containers/TailQueueList.h: new helper class.

A new class template used to implement tail-queue lists.

Change-Id: I134ce9178c8654645a38b8b6ea7f80f5e88d6b58
android/base/containers/HashUtils.h: new helper class.

Change-Id: Id7b88b7bbd9fb54c9d224a56a0959890a4b204db
android/base/containers/PointerSet.h: new container class.

Change-Id: I11ae4503bc0a84f709084403f192ed115960c4cb
android/base/containers/ScopedPointerSet.h: new helper class.

Change-Id: I3a65018b7febdff7ad3e85de4bd321b2f1b4c4b9
android/base/sockets/{ScopedSocket,SocketUtils}.h: new headers.

Change-Id: Idce92ac84dea349677db0f7e3eca2445065e4fd1
android/base/sockets/SocketWaiter.h: new helper class.

This patch implements a new helper class (SocketWaiter) which
can be used to wait on i/o events on multiple sockets at once.

Change-Id: If1b8f65b4fbd22c077a518fb0369694a87a9ac5d
android/base/async/Looper.h: new helper class

Change-Id: Ia83eed52900d1e5e57845dbf8d369ccb27954691
android/iolooper.h: Refactor on top of SocketWaiter

Refactor the implementation of android/iolooper.h to use the
SocketWaiter class from android/base/.

Change-Id: I072325a99d697b84e2b6802662290091e9e92ed8
android/looper.h: Refactor with android/base/async/Looper.h

This gets rid of android/looper-generic.c and introduces
android/looper-base.cpp which uses our android/base/async/Looper.h
to implement the same thing.

Change-Id: Ice3b6494bd44b015ea00804d21d0660465d0bc85
android/qemu/base/async/Looper.h: new helper class.

This patch implements an ::android::base::Looper class that is based
on the QEMU main event loop.

Change-Id: I5ed3252b05783487cd4090b0ba09ab7be44ae6ff