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 dd5d1621a27d086542211cb80a80b2cdc8431d8f)

Change-Id: I5b87ea15edfdcc0bae0c7f7c1280b4ad780619f4
Camera parameters for 7x30 blobs.

Change-Id: I8ad09bfad0cc372a56a99e3dad0ef5988441d7ea
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
Fix SurfaceView notifies on invalid surfaces.

SurfaceView notifies registered callbacks on invalid
Surfaces.

Change-Id: Iddc9a5cd073fb73a0e7e9b9ca64ff4fac0777ca7
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
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
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
Adds missing Bluetooth as network type.

The network connection type for Bluetooth is added so
that it is possible to use Bluetooth as Hotspot during
download from the Internet.

Change-Id: If8e8a3f69821beef742bc91d7a292a091861b48b

Conflicts:

	core/java/android/app/DownloadManager.java