autosuspend_inited flag set even if initialization fails

Prevents possible SIGSEGV on second autosuspend_enable attempt when
first intialization attempt fails.  autosuspend_inited should only
be set once autosuspend_ops has been assigned.

Consider the first call to autosuspend_enable().
autosuspend_init() sets its inited flag to true, and attempts to
set autosuspend_ops.  If all the other autosuspend_*_init() attempts
fail, autosuspend_init() returns -1, which autosuspend_enable()
will return as a failure.  A second call to autosuspend_enable()
will check autosuspend_init() and see that autosuspend has already
been initialized.  It will attempt to access autosuspend_ops, which
were not set in the first initialization attempt, causing a SIGSEGV.

Change-Id: Ib2d3ee62fee4c3b6d0323e5b7f3709a23c6b923f
Fail-proof the inline directives for SMP atomic operations.

The various atomic operations are declared as inline in the header files
to cut the function call overhead. However, the plain inline keyword is
just a suggestion to the compiler which makes its own decision on whether
to inline them or not. Worst, if they are not inlined, the
-fvisibility-inlines-hidden compiler flag will render them as hidden
symbols in the object file. If they are picked up by the linker over the
ones supplied in libcutils.so the following warning will be reported:

warning: hidden symbol 'android_atomic_inc' in foo.o is referenced by
DSO bar.so

One way is to add __attribute__((visibility("default"))) to those inline
functions to suppress the linker warnings. A better way is to force
inlining as with this patch.

Change-Id: Ie4fcfdfaaf06f42d351619a0d89671a9df15ca2f
Add missing signal codes to get_sigcode.

The only common one we were missing is SI_TKILL, but we've had the full
set on the dalvik-dev branch for some time now.

Change-Id: I7cf52d352b8624e0adb17a2ed440e7a10f490dfd
Expand crasher with a "thread-" prefix to crash on another thread.

So "thread-nostack" runs the "nostack" code on a new thread, and
"thread-abort" runs the "abort" code on a new thread, and so on.

Bug: http://code.google.com/p/android/issues/detail?id=16672
Change-Id: I026a0e43eea147f1a7a74243846954599bcf4238
adb: Improve ADB's forward redirection management.

This adds a few new options/modes to 'adb forward':

  adb forward --list
  adb forward --remove <local>
  adb forward --remove-all
  adb forward --no-rebind <local> <remote>

For more context, see http://code.google.com/p/android/issues/detail?id=39631

Note that this only affects the host adb client and server programs,
i.e. it's compatible with devices running older adbd versions.

Change-Id: I9cda3ba12b5a8560a2061620bc7f948e5c1e70f7
libusbhost: permits client polling on inotify wd

Modify libusbhost to expose the inotify watch descriptor to clients

This modification permits clients to add the watch descriptor to
their polling loop so that they don't have to use a dedicated
thread only for libusbhost.

Change-Id: I615bfcd56beab978135034b228d4d93337351eab
Signed-off-by: Guillaume Ranquet <guillaumex.ranquet@intel.com>
Signed-off-by: Luc Piguet-Lacroix <lucx.piguet-lacroix@intel.com>
android_filesystem_config: allow absolute paths

SELinux policies use absolute paths, allow absolute paths in fs_config
as well.

Change-Id: Ic97ee0b4eb4df9eac965a8e819fde01df473de7e
Track the setsebool change in the emulator init.rc.

setsebool's syntax changed in November. This is the sole
caller in AOSP.

Change-Id: I0da608ee974bc3a9060372ef68a71c52726a44a6
Include page protections in the debuggerd map output.

Bug: 7941716
Change-Id: I3bf475425c628c06f7799340c8a6132aab741742
Support adb client connect to remote server

ADB client: allow user to specify hostname and port number of remote
adb server.
ADB server: bind server to all network interfaces instead of just
localhost when user gives -a flag.

Primary use-case for this change is to support remote testing of USB
devices. HostA is running some test automation software which invokes adb
client. HostB has USB-only device attached and is running adb server. adb
client on HostA makes connection to adb server on HostB to talk to the
USB device.

Change-Id: I845cc8c00350b400317f8c18f813e6fd79bd5470
Signed-off-by: Dean Kwon <daex.i.kwon@intel.com>
Signed-off-by: Jim Bride <jim.bride@intel.com>
Signed-off-by: Matt Gumbel <matthew.k.gumbel@intel.com>
The localtime_tz and mktime_tz extensions are now in bionic.

(cherry-pick of d03072ffde3279fbb60591a0d07c820d8e792762. This change
was originally committed to AOSP, is in internal master, but was somehow
lost from AOSP.)

Bug: 7012465

Conflicts:

	libcutils/Android.mk

Change-Id: I08ee8eb9b8ce5d3f9d8f2e67437d653e08697bc1