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
Add support for hdmi out on 1920x1200 tablet

Patch Set 2: Fix case for when tablet is in portrait mode

Change-Id: I6c75f5aa8edf8788105ddd4e1474f2a3e58dabb3
Fix SkBitmap::fPixels not being locked correctly

In some cases bitmap's pixels where freed during encoding, which
caused a null pointer dereference.
This fix makes sure that underlaying buffer is locked for the whole
process of compression.

Change-Id: I0ac56821f5d333072271dc2670fa30f1562adfa3
WebView: fix crash when moving cursor

Caused by http://review.cyanogenmod.com/20731 when the cursor is
moved while no text is selected.

Change-Id: I71d49f1a16271dd0b7a0b4930f04d33a64a69b49
am: Don't crash if cacheDir can't be created

 * Due to a bug in the multiuser code, it's possible for us to reach
   here by loading framework-res for a different user in which case the
   cache dir can't be created.
 * Add a null check to avoid the crash and subsequent lockup of AM.

Change-Id: I12f3a207d9fa0111286a67e29652f808ad5d9410
frameworks/base: Increase the buffer size to hold the whole content of the file.

When we have more cpufreq steps and cpufreq's time_in_state stats file
can grow beyond 256.

This buffer size was not enough because the file has more than 300
characters. So it read part of the file and the parsing failed.
This runs from ActivityManager, so when the ActivityManager dies
framework reboots.Increasing the buffer size will help use to get
the whole file into the buffer.

Change-Id: I3f95dc7534fdaf5e139966c0d1be8d79d6413a0f
Fix for updating TCP buffer size when switching network type

When PDP connects in GSM network, the TCP buffer window size is
set to max 8760. If the phone swicthes to UMTS, the TCP buffer
size is not updated to UMTS, i.e. GPRS buffer size is still
used with limited data transfer spead as a result.
This fix makes sure the TCP buffer size is updated when
switching network type.

Based off of (varible name change): https://android-review.googlesource.com/#/c/41612/

Change-Id: Idf19bca0b2eca218899aba68002d652b65070916
KeyguardViewMediator: fix NPE when DEBUG=true

Change-Id: Icc6f708ff11db3f67cbea6ce219d21cabc34cfdc
RIL for Samsung v6 RIL CDMA devices, based on SamsungRIL.

rev 2: Fix whitespace.
rev 3: Fix whitespace.
rev 4: Rename subclass to be more generic.
rev 5: Bring in some RIL state updates from Smdk4210RIL.
rev 6: Override getDataCallState to provide correct dataCall.ifname.
rev 7: Remove unused variables from testing.

Change-Id: Ibe611b59509ceff8edb1c3fc2775e5bbd8916e13
HTCQualcommRIL: Set mUSIM and mSetPreferredNetworkType

This is required to enable "GSM/WCDMA/LTE auto" mode on evita, and to make the device load that setting after reboot.

Change-Id: Iec563669f50724e7726b0c0e23f62910442cac76
RILs: Eliminate repeated overrides of responseOperatorInfos.

- Add mQANElements field, default to 4 in RIL, use in responseOperatorInfos.
  This may be set to 5 in subclassed RIL constructors.

- Remove repeated overrides of responseOperatorInfos by subclassed RILs, as
  there's no logic change, just a disagreement as to whether the
  QUERY_AVAILABLE_NETWORKS response is an array with 4 or 5 per-network
  elements.

- Size OperatorInfo ArrayList appropriately in SemcRIL and SonyQualcommRIL.

Change-Id: I1254a670d8611f76aad13a6f197c67012c7d4c47
hwui: Add option to enable subpixel font positioning

 * Off by default as there is an issue with metrics calculation.

Change-Id: I39c9d74beeac5f28e4014d54e3c658b0f0fed86e
ActivityThread: Avoid creating duplicate handlers and reuse mH

sMainThreadHandler is used for notification of changes in
SharedPreferences and refers to a new instance of Handler instead
of the existing instance, mH, of the ActivityThread. Fix to reuse
existing handlers associated with main looper.

Change-Id: I794a5802a9eacdb188bd0619db5e70e3ae89a07d
VibratorService: Fix to ensure actual delay in a vibrate pattern

delay might timeout early as value of duration isn't updated
correctly in the loop, should the wait be interrupted, to reflect
the elapsed time. Fix is to update duration in the loop.

Change-Id: I525b0e97799b288f46ae3a056cff7dcc69701bb0
Avoid system_server crashing due to mac address is null

It's possible that the mac address is null (getMacAddress() of WifiNative.java).
In this case system_server will crash like:

E AndroidRuntime: *** FATAL EXCEPTION IN SYSTEM PROCESS: WifiWatchdogStateMachine
E AndroidRuntime: java.lang.NullPointerException
E AndroidRuntime:        at android.net.arp.ArpPeer.<init>(ArpPeer.java:57)
E AndroidRuntime:        at android.net.wifi.WifiWatchdogStateMachine.doArpTest(WifiWatchdogStateMachine.java:866)

Check the mac address before parsing to avoid crashing.

Change-Id: I5d4205c04d479a3a2837172c6382816ea4bf74d6
WifiStateMachine: ignore auth-fail event during WPS connection

Disregard auth failure events during WPS connection. The EAP sequence is
retried several times, and there might be failures (especially for wps pin).
We will get a WPS_XXX event at the end of the sequence anyway.

Without this change, the SupplicantStateTracker class will disable
the WPS network we are connecting to after 2 failed authentication events.
Then, even if WPS succeeds, we will never connect to the selected network.

Change-Id: I57c8e508bfd738405b7f2c2c2325df7838e1b4af
Signed-off-by: Arik Nemtsov <arik@wizery.com>
Signed-off-by: Vishal Mahaveer <vishalm@ti.com>
Protecting more views from (bad) MotionEvents

When handling MotionEvents, the method findPointerIndex can return -1
if the current pointer id can't be translated to a pointer index.
Some views are not handling this, which will lead to an out-of-
index crash. In 2585e9b there were checks added, this change adds
some more.

Change-Id: I93ce2420afd83a06b689a1ed35ead7d170cd68f1
Fixes relative time formatting issue for dates in future

All variations of getRelativeTimeSpanString() now properly handle dates
that are in the future. Prior, the version used by
getRelativeDateTimeString() would occasionally show the time instead of
a date when the future date was the same weekday as the current weekday.
This resulted in the time output being duplicated, eg.: "11:23, 11:23"

Change-Id: If20972a6942cce792fa233437f94dedfb71379f3
Signed-off-by: Steve Pomeroy <steve@staticfree.info>
Make setCaptureRate locale safe

Dont use the default String.format in setCaptureRate as it is both
locale unsafe and less efficient than regular string concatenation
in this case.

Change-Id: I29418ec0352ef8c79967592b6eb8ff66cc9c99f0
Make addAddress locale safe

Using regular string concatenation to avoid unexpected
results in some locales.

Change-Id: I47dd5e174c4a2e88dc18e014002820cdbf63fcad