Make sure seed values use full range

(cherry picked from commit 004435719afbe62d7ce6b39d69181b5dd801d598)

Bug: 6642616
Change-Id: I773dd31d92207151df05122920170851fa021fd5
CA certificate update

Added CAs in cacerts directory with summary below.

Added    Subject   : C=GR, O=Hellenic Academic and Research Institutions Cert. Authority, CN=Hellenic Academic and Research Institutions RootCA 2011
         SHA1      : FE:45:65:9B:79:03:5B:98:A1:61:B5:51:2E:AC:DA:58:09:48:22:4D

Added    Subject   : C=IL, O=StartCom Ltd., CN=StartCom Certification Authority G2
         SHA1      : 31:F1:FD:68:22:63:20:EE:C6:3B:3F:9D:EA:4A:3E:53:7C:7C:39:17

Added    Subject   : CN=ACCVRAIZ1, OU=PKIACCV, O=ACCV, C=ES
         SHA1      : 93:05:7A:88:15:C6:4F:CE:88:2F:FA:91:16:52:28:78:BC:53:64:17

Added    Subject   : C=US, O=Entrust, Inc., OU=See www.entrust.net/legal-terms, OU=(c) 2012 Entrust, Inc. - for authorized use only, CN=Entrust Root Certification Authority - EC1
         SHA1      : 20:D8:06:40:DF:9B:25:F5:12:25:3A:11:EA:F7:59:8A:EB:14:B5:47

Bug: https://code.google.com/p/android/issues/detail?id=36290
Bug: 9050922

Bug: https://code.google.com/p/android/issues/detail?id=55661
Bug: 9304475

Change-Id: I76a2398772c7c68f2284741f4bcfaf97d8789662
Don't force x86 devices to run an insanely long test.

This takes 3 minutes on a z620, so it's borderline unacceptable even on a fast
desktop!

(cherry picked from commit 0b4086561c6b38089416212612f17c2d458f503d)

Change-Id: I0404cb6ba597aa377a9725d35b3fe2b9e7eff919
Implement JSONObject.wrap, and use it.

Bug: https://code.google.com/p/android/issues/detail?id=55114
Change-Id: Ic2e010ac616f24dda7b8abced7eb2fc84dc7d50e
Implement JSONArray.remove.

Bug: https://code.google.com/p/android/issues/detail?id=53461
Change-Id: I2b920fa8d63bcc8f1260669d72e33833bbd81ced
Fix unexpected EOF handling by KXmlParser.

Avoid read position slipping beyond limit on EOF, causing an
ArrayIndexOutOfBoundsException.

Also fix two incorrect checks whether to read more data.

Bug: 9012715
Change-Id: I40f60becd97eb4d9f33842bea2c19e9dc531d3b7
Fix memory leaks in org_apache_harmony_xml_ExpatParser

The method expandInternedStringBucket(...) creates a new bucket
but the old bucket is never freed, even though the function doc
claims that it does. To solve this problem the old bucket is
freed when the new one has been created successfully.

Also this commit fixes two possible memory leaks when a
jniThrowOutOfMemoryError is thrown, where the internedString
also needs to be freed.

Change-Id: Ic80a35a2b4ec8f93ddc006aca5609a5ffe74d659
NativeCrypto: free error state on client_cb

On a call to SSL_get_certificate() there appears to be one path that
will set an error code (SSL_aANON) and returns NULL. This client_cb
wasn't expecting NULL to be an error.

To avoid the error from lingering and showing up in later tests, clear
it so the later tests have more accurate errors.

Bug: 9198763
Change-Id: I229c06fce042436a8545812c1d48c1210408d57e
NativeCrypto: check that npnProtocols != NULL

There appears to be a path where an application can not specify which
NPN protocols it supports but can request that it is negotiated. Match
the advertise method by checking that we have NPN methods set before
using them in a call back to OpenSSL.

(cherry picked from commit 83c16bcb5eb3e6c0ad18a620912ecdf3a401e6a3)

Bug: 9186885
Change-Id: I1f35d45709f264d6e2f0c7fef316cb6d93db4ed1
NativeCrypto: change debug format string to "%.*s"

This ensures the string stops at the right place instead of running off
the end of the buffer. This still doesn't help much for binary data.

Change-Id: Ia56b07a586d8f55ebb0d4237f6d598b307f065fe
Simplify defaulting for system properties, and trust the environment less.

The originally-reported bug (https://android-review.googlesource.com/58258)
was that dalvik would fail to start if LD_LIBRARY_PATH was unset.

This changes things so we no longer have multiple default values for
java.library.path, cope better with that not being set, and don't set
it if LD_LIBRARY_PATH isn't set.

Change-Id: I55d48a35b1b42df872e6dcd0a38fc7bc4b8cad5a