Add support for Caller Name Display

Copied relevant parts from CdmaConnection.java to get the information
as/if presented by network operator (Fido/Rogers in canada provide that
information, and it get displayed if there's no match in phonebook).
Although it works (the nale is displayed when the call is received),
the information is not stored (not kept in the log).

* Patch Set 2 : correct coding style
* Patch Set 3 : promote [get]cnapName, [get]cnapNapePresentation to parent
                class (Connection)
* Patch Set 4 : -remove ref to CDMA in get[CnapName|CnapNamePresentation] headers
                -remove unnecessary self ref-reference
* Patch Set 5 : -add forgoten "protected" modifier to newly promoted class memebers

Change-Id: I2279f75d679d5afa716d9904fc3b3e33c77948c6

Conflicts:

	telephony/java/com/android/internal/telephony/gsm/GsmConnection.java
frameworks/base: Handle Out of Memory Exception when creating video thumbnails.

Adds code to handle an out of memory exception when generating the thumbnail
from a recently recorded video clip.

Change-Id: Ifcbe007272ffef85744fca1414ea5eacccd0154c
CRs-Fixed: 277571
libstagefright: fallback to software encoder for high resolutions

Add error check conditions to fallback to software encoder if
hardware encoder failed in configure codec. Hardware encoder will
fail for resolutions greater than FWVGA for which software encoder
will be used for encoding.

CRs-fixed: 371334
Change-Id: I49ffa9e08ae118f883c857f3de92ecf4f66aac21

Conflicts:
	media/libstagefright/OMXCodec.cpp
Bluetooth: Fix build warnings

Change-Id: Ic82cc86ac4b63b30ab66e1b8c7fd0e998fea590e
Roboto: Fix for Unicode Character U+1EE1

LATIN SMALL LETTER O WITH HORN AND TILDE (U+1EE1) looked like
LATIN SMALL LETTER O WITH TILDE (U+00F5)

Change-Id: I4916514e2dc8dfd665b174023fae26a8a61790e3
 libstagefright: Fix crash when parsing corrupt h.264 clips.

- Fixes an arithmetic overflow when parsing h.264 clips that contain
corrupt NAL lengths.

CRs-fixed: 355571 375153
(cherry picked from commit dd5d162)

Change-Id: I5b87ea15edfdcc0bae0c7f7c1280b4ad780619f4
libstagefright: Fix for native crash in Awesomeplayer

- While playing an audio-video clip, audio player
  start fails which leads to crash in OMXCodec destructor
- Before start of AudioPlayer, AUDIOPLAYER_STARTED flag
  is set to true. But if start fails, this flag is
  not reset back. Due to this in Awesomeplayer reset,
  it directly calls the destructor without calling
  OMXCodec stop after checking this flag.
- Add change to set the AUDIOPLAYER_STARTED flag
  only if audio player start happens successfully

CRs-Fixed: 365727
(cherry picked from commit 6c5758dc0afd05eac7cce9058255192ff9c62da4)

Change-Id: Iea3364c9468ad4ff80d05a1ee6c9a0c9b4ab58f6
libStagefright:: Provide interface to query current offset position

- Currently the streamport is querying same getSize for get current
  offset. Since this info is needed by parser to decide if sufficient
  data is there before requesting for the same. But in case of data
  length and size coming zero the same is passed to the parser which
  assumes that there is no data with the data source and it errors out.
- To resolve this issue new interface is created to pass the current
  offset length which indicated how much data is read till now.

CRs-fixed: 374040
(cherry picked from commit b63c05684432f3bcc62c6cb002634bd55919936e)

Change-Id: I1d2289cc6bbe1ded89751e77d21a3bdd3f57f0b9
Return early when checking divider before child zero.

Previously the `getChildAt` method would be called with an index of -1 which
would lead to an exception being thrown and caught. This is unnecessary since
we know there will never be a divider before the first child. It also avoids
additional object creation since this method can be invoked quite frequently.

Change-Id: Iab44520d5d52f96a829a009cdd1201696edbf9a4
libeffects: Fix header path for webrtc update

Change-Id: I8a427d293c0f17290a7cee0e38c11db2a458c128
ProcessStats: Fix another crasher

Prevent occurences of:

java.util.NoSuchElementException
	at java.util.StringTokenizer.nextToken(StringTokenizer.java:208)
	at com.android.internal.os.ProcessStats.getCpuSpeedTimes(ProcessStats.java:574)
	at com.android.internal.os.ProcessStats.getLastCpuSpeedTimes(ProcessStats.java:546)
	at com.android.server.am.ActivityManagerService.updateCpuStatsNow(ActivityManagerService.java:1676)
	at com.android.server.am.ActivityManagerService.batteryNeedsCpuUpdate(ActivityManagerService.java:1728)
	at com.android.internal.os.BatteryStatsImpl$MyHandler.handleMessage(BatteryStatsImpl.java:129)
	at android.os.Handler.dispatchMessage(Handler.java:99)
	at android.os.Looper.loop(Looper.java:137)
	at com.android.server.am.ActivityManagerService$AThread.run(ActivityManagerService.java:1431)

Change-Id: I66f30739455dd726b708467f814f53c445f327b2
Fix error trap in SurfaceTexture Client

There was an issue in Surface::lock where failure to lock a surface
resulted in two bad things happening:
- success was returned to the caller (it was apparently locked).
- an uninitialised pointer was returned as the buffer.

Change-Id: I8b0df81400e0fa0542a8bb993d76923ac96b686e
Corrected typo when checking InputStream methods

Corrected a small typo where Java InputStream methods are
incorrectly checked when creating a JNI InputStream adaptor.

Change-Id: I5f14897e0d5ddceb4b2af6be46769713f0487624
Add shortcut to avoid potential divide by zero in some case

Change-Id: If4b34c95402daf8ebcc28736edfb2012553aa57c
Fix wrong count return for getPhoneSignalStrengthCount

Test report for the time spent in each signal strength bin, along
with the number of times that bin was entered showed the result
as Bin=3 Time=3211926000 Count=0. With a non-zero Time, the Count
value 0 was wrong.

The cause of the problem was that getPhoneSignalStrengthCount() used
mPhoneDataConnectionsTimer, instead of mPhoneSignalStrengthsTimer,
to get the count.

Change-Id: I55ac1125abfcfdc105605d76d1c706ac315b90cc
libstagefright: Use LOG_BASIC when use chromium http stack

When using chromium http stack, the LogLevel is LOG_ALL, and
in chromium_net, LOG_ALL will HexEncode all received data. thus
playing a 10Mbps 1080P video stream  will generate 20Mbps Hex Buffer
for event logging. This is a heavy operation for logging.

Change-Id: I28e8173e1aa806dd23014378d530d30187360060
Author: Xuefeng Deng <xuefeng.deng@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 35737
Minimize the amount of data uploaded to draw text

Change-Id: I6313ac039291c9cd93aadafe3566ad9d60cab42d
framework: fix bug for uninitialized variable

Some application display error due to uninitialized varibale.
This patch fix the bug

Change-Id: I660169e325ffae60d95c7774aaaeaebf693adf3d
Author: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chang Zhou <chang.zhou@intel.com>
Signed-off-by: Chong Xing <chong.xing@intel.com>
Signed-off-by: Hongyu Zhang <hongyu.zhang@intel.com>
Singed-off-by: Shuo Gao <shuo.gao@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Author-tracking-BZ: 45356
REVERT: libeffects: Fix header path for webrtc update
hwui: Reinitialize invalid glyphs if cache is full.

The glyphs become invalid if font cache becomes full. So we need to
reinitialize the invalid glyphs before passing to graphics for drawing.

Change-Id: Ic702fea3d95dcd27510cf604b419fb10cb73dbeb
CRs-fixed: 349176, 360465