Audio: Restore volume for all streams on headset connect/disconnect

Audio streams which play sound from both speaker and a connected device would
report to AudioService only the speaker as the playback device, meaning volumes
would not be saved for a separate device state. This patch makes it so the
connected device will be reported instead, fixing volume restore on device
change for those streams (alarm, ring, notifications).

Readded safe headset restore capping for all streams.

Patch Set 3: Changed cap to 10/15

Change-Id: Id2e690f7894475ba0086f62342b8eeb163d24da1
WebView: fix crash when moving cursor
Owner: Pawit Pornkitprasan
From: http://review.cyanogenmod.com/#/c/22595/1

Patch set 2: cleaned up, added original author

Signed-off-by: R4INS <joshbr85@gmail.com>
Change-Id: I693548599a3e9f3a9c1908a725942ec219bc4f57
fix IME down arrow for custom navbar

Change-Id: Iff98d27c109d0e954819dd64842c2a151b71794b
Signed-off-by: Zaphod <mwilson@acesappraisal.com>
SamsungQualcomm RILs: throttle multiple outstanding SEND_SMS requests

  * Our radio generates a GenericFailure if a SEND_SMS request is sent
    before the previous SEND_SMS has completed.
  * Add a variable to track whether a SEND_SMS is in progress.
  * In sendSMS(), wait for the previous SEND_SMS to finish. Block for
    up to 30 seconds. If this passes with no response, blindly send the
    next SEND_SMS and let normal error handling take over.
  * In responseSMS(), notify that the SEND_SMS is complete.
  * Same thing above for the CDMA RIL
  * Algorithm credit Mike Kasick

Change-Id: I7beadc809a9e35fa100e5823bdfc3e9879ab3233
ProviderMap: remove hashmap when entire user specific entries are removed

User specific entries in  mProvidersByNamePerUser and mProvidersByClassPerUser
isn't cleared when entire user specific providers are removed. Fix is to remove
the user specific hashmap in such cases.

Change-Id: I6edf211ced873e59f3b89ffceb9eceec13ea8f3f
ActivityManagerService: stay away from zombie content providers

When the lowmemorykiller kills a content provider in an unfortunate
moment, an innocent client app can become attached to a zombie provider
and be unconditionally killed moments after, when the dead provider is
being removed.
Prevent this race by addition of isAlive function to Process.java that
determines whether a process is still running and is not only a zombie,
add a check of the state of the provider process to getContentProviderImpl.

Change-Id: Id753b8dab103e4b447c4138468938ca9f5cb857d
ContentProviderRecord: Remove external process reference when finalized

ContentProviderRecords is removed from provider map by activity manager service
when the process hosting the content providers terminates and this causes GC
to free the content provider records but the reference to external process
using the content provider isn't cleared. Fix is to clear the reference and
unlink for death notification.

Change-Id: I67fd10cee57b02257792d0c9b4569fe11dea7648
Added check of ActivityInfo launch mode when starting activity.

When starting a singleTop activity from a singleInstance activity,
the onNewIntent() callback was not called when expected. The
reason for this was that only the launchMode specified on the
intent was checked and not the launchMode specified in the manifest.

Fixes issue 17137.

Change-Id: I1a9bc1007d6f5145bf93a6161534732bf5214b7a
Add hideable kill-all-button to recent switcher (1/2 FWB part)

original code done by Robin Morawetz for my IceColdSandwich ROM

Change-Id: Iaa59b337d4d16cadf003abbe34f4c1870f8c0cd4
Merge remote-tracking branch 'origin/jb' into jb