From 3c7c351a6217ac48b741740167c201a679a0ca65 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Wed, 4 Aug 2010 15:44:39 -0700 Subject: [PATCH] Tracking merge of dalvik-dev to gingerbread git cherry-pick --no-commit f77cf7f0 git cherry-pick --no-commit c8f503b5285e30c1a881d0ba860ba9021f57d113 git cherry-pick --no-commit 570bb561 git cherry-pick --no-commit e2417541 git cherry-pick --no-commit e4d81f25bd4dc1a5c909b56ab56a56406290da30 git cherry-pick --no-commit 5e8a587d Change-Id: I101a385d43f3e0f4ce5352217f92ef67a3908c88 --- Android.mk | 29 +- api/9.xml | 1276 +- api/current.xml | 15012 ++++++++++++++-- .../net/SSLCertificateSocketFactory.java | 4 +- .../android/net/http/HttpsConnection.java | 4 +- .../com/android/internal/os/ZygoteInit.java | 19 +- core/jni/AndroidRuntime.cpp | 41 +- core/tests/coretests/Android.mk | 4 +- .../net/http/HttpsThroughHttpProxyTest.java | 142 + include/android_runtime/AndroidRuntime.h | 1 + preloaded-classes | 12 +- test-runner/Android.mk | 2 +- tests/CoreTests/android/Android.mk | 2 +- tests/CoreTests/android/core/CryptoTest.java | 126 - .../android/core/SSLPerformanceTest.java | 12 +- .../CoreTests/android/core/SSLSocketTest.java | 8 +- 16 files changed, 13903 insertions(+), 2791 deletions(-) create mode 100644 core/tests/coretests/src/android/net/http/HttpsThroughHttpProxyTest.java delete mode 100644 tests/CoreTests/android/core/CryptoTest.java diff --git a/Android.mk b/Android.mk index 5db66108f2361..af50134dfdca2 100644 --- a/Android.mk +++ b/Android.mk @@ -193,7 +193,7 @@ LOCAL_INTERMEDIATE_SOURCES := \ $(framework_res_source_path)/com/android/internal/R.java LOCAL_NO_STANDARD_LIBRARIES := true -LOCAL_JAVA_LIBRARIES := core ext +LOCAL_JAVA_LIBRARIES := bouncycastle core core-junit ext LOCAL_MODULE := framework LOCAL_MODULE_CLASS := JAVA_LIBRARIES @@ -301,34 +301,14 @@ fwbase_dirs_to_document += core/config/sdk # Intentionally not included from libcore: # icu openssl suncompat support libcore_to_document := \ - annotation/src/main/java/java \ - archive/src/main/java/java \ - auth/src/main/java/javax \ - awt-kernel/src/main/java/java \ - concurrent/src/main/java \ - crypto/src/main/java/javax \ dalvik/src/main/java/dalvik \ json/src/main/java \ junit/src/main/java \ - logging/src/main/java/java \ luni/src/main/java/java \ - luni-kernel/src/main/java/java \ - math/src/main/java/java \ - nio/src/main/java/java \ - nio_char/src/main/java/java \ - prefs/src/main/java/java \ - regex/src/main/java/java \ - security/src/main/java/java \ - security/src/main/java/javax \ - security-kernel/src/main/java/java \ - sql/src/main/java/java \ - sql/src/main/java/javax \ - text/src/main/java/java \ - x-net/src/main/java/javax \ - xml/src/main/java/javax \ - xml/src/main/java/org/xml/sax \ + luni/src/main/java/javax \ + luni/src/main/java/org/xml/sax \ + luni/src/main/java/org/w3c \ xml/src/main/java/org/xmlpull/v1 \ - xml/src/main/java/org/w3c non_base_dirs := \ ../../external/apache-http/src/org/apache/http @@ -361,6 +341,7 @@ framework_docs_LOCAL_INTERMEDIATE_SOURCES := \ $(framework_res_source_path)/com/android/internal/R.java framework_docs_LOCAL_JAVA_LIBRARIES := \ + bouncycastle \ core \ ext \ framework \ diff --git a/api/9.xml b/api/9.xml index 076bed76f6704..f18623ff1e490 100644 --- a/api/9.xml +++ b/api/9.xml @@ -216582,33 +216582,6 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -232422,7 +231391,7 @@ > - + @@ -232461,7 +231430,7 @@ - + @@ -232515,7 +231484,7 @@ - + @@ -232697,7 +231666,7 @@ > - + @@ -244441,7 +243410,7 @@ > - + @@ -245399,7 +244368,7 @@ visibility="public" > - - - - - - - - - - - - - - - - - - @@ -289275,7 +288199,7 @@ @@ -291525,7 +290449,7 @@ static="false" final="false" deprecated="not deprecated" - visibility="public" + visibility="protected" > - - - + @@ -305654,7 +304576,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -305673,7 +304595,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -305690,7 +304612,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -307703,7 +306625,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -307718,7 +306640,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -307737,7 +306659,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -307754,7 +306676,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -307899,7 +306821,7 @@ deprecated="not deprecated" visibility="public" > - + - + - - - - @@ -337423,11 +336341,11 @@ deprecated="not deprecated" visibility="public" > - + - + - + - + - + @@ -341179,32 +340097,6 @@ deprecated="not deprecated" visibility="public" > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -228809,6 +227822,46 @@ visibility="public" > + + + + + + + + + + + + + + - + @@ -230459,6 +229542,132 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -232735,6 +232072,25 @@ + + + + + + + + + + + + + + + + - + @@ -234835,6 +234213,19 @@ + + + + - + @@ -235607,6 +234998,30 @@ + + + + + + + + + + + + - + @@ -235780,6 +235195,30 @@ + + + + + + + + + + + + - + @@ -236077,6 +235516,17 @@ visibility="public" > + + + + - + @@ -238439,7 +237900,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -238882,9 +238343,9 @@ - + - + - + @@ -243017,7 +242478,7 @@ - + @@ -243071,7 +242532,7 @@ - + @@ -243253,7 +242714,7 @@ > - + @@ -243309,7 +242770,7 @@ + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -250350,7 +250172,7 @@ > - + @@ -250362,6 +250184,34 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + + + + + + + @@ -250386,7 +250236,7 @@ deprecated="not deprecated" visibility="public" > - + - + - - - + + + + + + + + + - + - + - + - + - + - + - + - + - + - + @@ -252334,6 +252208,17 @@ + + - + - + @@ -255955,7 +255840,7 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -261441,6 +261964,48 @@ > + + + + + + + + - + @@ -261943,6 +262508,19 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -262884,7 +263571,7 @@ deprecated="not deprecated" visibility="protected" > - + @@ -263249,7 +263936,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -264210,7 +264897,7 @@ > - + @@ -265890,7 +266577,7 @@ > - + @@ -266236,6 +266923,28 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + - + - + @@ -267327,7 +268058,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -267719,7 +268450,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -268010,7 +268741,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -268301,7 +269032,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -268609,7 +269340,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -268959,7 +269690,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -272148,7 +272879,7 @@ return="boolean" abstract="false" native="false" - synchronized="true" + synchronized="false" static="true" final="false" deprecated="not deprecated" @@ -272716,7 +273447,7 @@ deprecated="not deprecated" visibility="public" > - + - + - + - + @@ -273369,6 +274100,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -287080,6 +287922,19 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -299111,21 +304163,6 @@ - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + - + @@ -301579,7 +306631,7 @@ extends="java.lang.Object" abstract="false" static="false" - final="true" + final="false" deprecated="not deprecated" visibility="public" > @@ -301616,6 +306668,17 @@ visibility="public" > + + + + + + + + + + + + + + - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -304409,6 +310109,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304424,6 +310143,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304439,6 +310177,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304454,6 +310211,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304469,6 +310245,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304484,6 +310279,25 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + @@ -304501,11 +310315,375 @@ deprecated="not deprecated" visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -305782,9 +311960,9 @@ deprecated="not deprecated" visibility="public" > - + - + - + - + @@ -306035,6 +312213,40 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + + @@ -310603,6 +317087,17 @@ visibility="public" > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + - + - + - + - + - + + + @@ -315270,6 +322806,16 @@ deprecated="not deprecated" visibility="public" > + + + + @@ -315280,19 +322826,35 @@ deprecated="not deprecated" visibility="public" > - + - - + - + + + + + + + + + + + + + + + + + + + + + + + + + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + - + + + + + + + - + @@ -315400,9 +323166,9 @@ > - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -316210,7 +324121,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -316229,7 +324140,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -316246,7 +324157,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -316259,6 +324170,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + @@ -318274,7 +327530,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -318293,7 +327549,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -318310,7 +327566,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -318455,7 +327711,7 @@ deprecated="not deprecated" visibility="public" > - + - + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -322830,6 +332895,532 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -329756,8 +340447,6 @@ deprecated="not deprecated" visibility="public" > - - + + - + @@ -329921,7 +340612,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -329947,7 +340638,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -330798,6 +341489,72 @@ > + + + + + + + + + + + + + + + + + + + + + + + + - + - + @@ -331332,6 +342089,85 @@ > + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + - + - + - + - + @@ -351160,6 +362264,18 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - - - - - - - + + - - - - - - - - - - - - + + + + - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -354213,6 +366426,23 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "; @@ -287,7 +283,6 @@ public class ZygoteInit { int count = 0; String line; - String missingClasses = null; while ((line = br.readLine()) != null) { // Skip comments and blank lines. line = line.trim(); @@ -311,12 +306,7 @@ public class ZygoteInit { } count++; } catch (ClassNotFoundException e) { - Log.e(TAG, "Class not found for preloading: " + line); - if (missingClasses == null) { - missingClasses = line; - } else { - missingClasses += " " + line; - } + Log.w(TAG, "Class not found for preloading: " + line); } catch (Throwable t) { Log.e(TAG, "Error preloading " + line + ".", t); if (t instanceof Error) { @@ -329,13 +319,6 @@ public class ZygoteInit { } } - if (THROW_ON_MISSING_PRELOAD && - missingClasses != null) { - throw new IllegalStateException( - "Missing class(es) for preloading, update preloaded-classes [" - + missingClasses + "]"); - } - Log.i(TAG, "...preloaded " + count + " classes in " + (SystemClock.uptimeMillis()-startTime) + "ms."); } catch (IOException e) { diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index fc1f4884bca61..7fe56a765e0ac 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -517,6 +517,40 @@ static void readLocale(char* language, char* region) //LOGD("language=%s region=%s\n", language, region); } +/* + * Parse a property containing space-separated options that should be + * passed directly to the VM, e.g. "-Xmx32m -verbose:gc -Xregenmap". + * + * This will cut up "extraOptsBuf" as we chop it into individual options. + * + * Adds the strings, if any, to mOptions. + */ +void AndroidRuntime::parseExtraOpts(char* extraOptsBuf) +{ + JavaVMOption opt; + char* start; + char* end; + + memset(&opt, 0, sizeof(opt)); + start = extraOptsBuf; + while (*start != '\0') { + while (*start == ' ') /* skip leading whitespace */ + start++; + if (*start == '\0') /* was trailing ws, bail */ + break; + + end = start+1; + while (*end != ' ' && *end != '\0') /* find end of token */ + end++; + if (*end == ' ') + *end++ = '\0'; /* mark end, advance to indicate more */ + + opt.optionString = start; + mOptions.add(opt); + start = end; + } +} + /* * Start the Dalvik Virtual Machine. * @@ -536,6 +570,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) char enableAssertBuf[sizeof("-ea:")-1 + PROPERTY_VALUE_MAX]; char jniOptsBuf[sizeof("-Xjniopts:")-1 + PROPERTY_VALUE_MAX]; char heapsizeOptsBuf[sizeof("-Xmx")-1 + PROPERTY_VALUE_MAX]; + char extraOptsBuf[PROPERTY_VALUE_MAX]; char* stackTraceFile = NULL; bool checkJni = false; bool checkDexSum = false; @@ -844,7 +879,11 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) opt.optionString = stackTraceFile; mOptions.add(opt); } - + + /* extra options; parse this late so it overrides others */ + property_get("dalvik.vm.extra-opts", extraOptsBuf, ""); + parseExtraOpts(extraOptsBuf); + /* Set the properties for locale */ { char langOption[sizeof("-Duser.language=") + 3]; diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk index 245c67cf40021..01faaadf0f860 100644 --- a/core/tests/coretests/Android.mk +++ b/core/tests/coretests/Android.mk @@ -13,7 +13,9 @@ LOCAL_SRC_FILES := \ LOCAL_STATIC_JAVA_LIBRARIES += android-common -LOCAL_JAVA_LIBRARIES := android.test.runner +LOCAL_DX_FLAGS := --core-library +LOCAL_STATIC_JAVA_LIBRARIES := core-tests-supportlib +LOCAL_JAVA_LIBRARIES := android.test.runner android-common LOCAL_PACKAGE_NAME := FrameworksCoreTests LOCAL_CERTIFICATE := platform diff --git a/core/tests/coretests/src/android/net/http/HttpsThroughHttpProxyTest.java b/core/tests/coretests/src/android/net/http/HttpsThroughHttpProxyTest.java new file mode 100644 index 0000000000000..f3b7c06a853b0 --- /dev/null +++ b/core/tests/coretests/src/android/net/http/HttpsThroughHttpProxyTest.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2010 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package android.net.http; + +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.io.StringWriter; +import java.util.Arrays; +import java.util.List; +import javax.net.ssl.TestSSLContext; +import junit.framework.TestCase; +import org.apache.http.HttpHost; +import org.apache.http.HttpResponse; +import org.apache.http.client.HttpClient; +import org.apache.http.client.methods.HttpGet; +import org.apache.http.conn.params.ConnRoutePNames; +import org.apache.http.conn.scheme.Scheme; +import org.apache.http.conn.ssl.AllowAllHostnameVerifier; +import org.apache.http.conn.ssl.SSLSocketFactory; +import org.apache.http.impl.client.DefaultHttpClient; +import tests.http.MockResponse; +import tests.http.MockWebServer; +import tests.http.RecordedRequest; + +public class HttpsThroughHttpProxyTest extends TestCase { + + public void testConnectViaHttps() throws IOException, InterruptedException { + TestSSLContext testSSLContext = TestSSLContext.create(); + + MockWebServer server = new MockWebServer(); + server.useHttps(testSSLContext.serverContext.getSocketFactory(), false); + server.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("this response comes via HTTPS")); + server.play(); + + HttpClient httpClient = new DefaultHttpClient(); + SSLSocketFactory sslSocketFactory = new SSLSocketFactory( + testSSLContext.clientContext.getSocketFactory()); + sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier()); + httpClient.getConnectionManager().getSchemeRegistry() + .register(new Scheme("https", sslSocketFactory, server.getPort())); + + HttpResponse response = httpClient.execute( + new HttpGet("https://localhost:" + server.getPort() + "/foo")); + assertEquals("this response comes via HTTPS", contentToString(response)); + + RecordedRequest request = server.takeRequest(); + assertEquals("GET /foo HTTP/1.1", request.getRequestLine()); + } + + /** + * http://code.google.com/p/android/issues/detail?id=2690 + */ + public void testConnectViaProxy() throws IOException, InterruptedException { + MockWebServer proxy = new MockWebServer(); + MockResponse mockResponse = new MockResponse() + .setResponseCode(200) + .setBody("this response comes via a proxy"); + proxy.enqueue(mockResponse); + proxy.play(); + + HttpClient httpProxyClient = new DefaultHttpClient(); + httpProxyClient.getParams().setParameter( + ConnRoutePNames.DEFAULT_PROXY, new HttpHost("localhost", proxy.getPort())); + + HttpResponse response = httpProxyClient.execute(new HttpGet("http://android.com/foo")); + assertEquals("this response comes via a proxy", contentToString(response)); + + RecordedRequest request = proxy.takeRequest(); + assertEquals("GET http://android.com/foo HTTP/1.1", request.getRequestLine()); + assertContains(request.getHeaders(), "Host: android.com"); + } + + public void testConnectViaHttpProxyToHttps() throws IOException, InterruptedException { + TestSSLContext testSSLContext = TestSSLContext.create(); + + MockWebServer proxy = new MockWebServer(); + proxy.useHttps(testSSLContext.serverContext.getSocketFactory(), true); + MockResponse connectResponse = new MockResponse() + .setResponseCode(200); + connectResponse.getHeaders().clear(); + proxy.enqueue(connectResponse); + proxy.enqueue(new MockResponse() + .setResponseCode(200) + .setBody("this response comes via a secure proxy")); + proxy.play(); + + HttpClient httpProxyClient = new DefaultHttpClient(); + HttpHost proxyHost = new HttpHost("localhost", proxy.getPort()); + httpProxyClient.getParams().setParameter( + ConnRoutePNames.DEFAULT_PROXY, proxyHost); + SSLSocketFactory sslSocketFactory = new SSLSocketFactory( + testSSLContext.clientContext.getSocketFactory()); + sslSocketFactory.setHostnameVerifier(new AllowAllHostnameVerifier()); + httpProxyClient.getConnectionManager().getSchemeRegistry() + .register(new Scheme("https", sslSocketFactory, 443)); + + HttpResponse response = httpProxyClient.execute(new HttpGet("https://android.com/foo")); + assertEquals("this response comes via a secure proxy", contentToString(response)); + + RecordedRequest connect = proxy.takeRequest(); + assertEquals("Connect line failure on proxy " + proxyHost.toHostString(), + "CONNECT android.com:443 HTTP/1.1", connect.getRequestLine()); + assertContains(connect.getHeaders(), "Host: android.com"); + + RecordedRequest get = proxy.takeRequest(); + assertEquals("GET /foo HTTP/1.1", get.getRequestLine()); + assertContains(get.getHeaders(), "Host: android.com"); + } + + private void assertContains(List headers, String header) { + assertTrue(headers.toString(), headers.contains(header)); + } + + private String contentToString(HttpResponse response) throws IOException { + StringWriter writer = new StringWriter(); + char[] buffer = new char[1024]; + Reader reader = new InputStreamReader(response.getEntity().getContent()); + int length; + while ((length = reader.read(buffer)) != -1) { + writer.write(buffer, 0, length); + } + reader.close(); + return writer.toString(); + } +} diff --git a/include/android_runtime/AndroidRuntime.h b/include/android_runtime/AndroidRuntime.h index 97a96b25ddf96..09f0de1e64d33 100644 --- a/include/android_runtime/AndroidRuntime.h +++ b/include/android_runtime/AndroidRuntime.h @@ -98,6 +98,7 @@ public: private: static int startReg(JNIEnv* env); + void parseExtraOpts(char* extraOptsBuf); int startVm(JavaVM** pJavaVM, JNIEnv** pEnv); Vector mOptions; diff --git a/preloaded-classes b/preloaded-classes index b60203911324a..1d5fbc0843dc3 100644 --- a/preloaded-classes +++ b/preloaded-classes @@ -697,19 +697,13 @@ com.google.android.gles_jni.GLImpl com.ibm.icu4jni.charset.CharsetDecoderICU com.ibm.icu4jni.charset.CharsetEncoderICU com.ibm.icu4jni.charset.CharsetICU -com.ibm.icu4jni.charset.CharsetProviderICU com.ibm.icu4jni.charset.NativeConverter com.ibm.icu4jni.common.ErrorCode -com.ibm.icu4jni.lang.UCharacter -com.ibm.icu4jni.regex.NativeRegEx com.ibm.icu4jni.text.Collator com.ibm.icu4jni.text.NativeBreakIterator com.ibm.icu4jni.text.NativeCollation com.ibm.icu4jni.text.NativeDecimalFormat com.ibm.icu4jni.text.RuleBasedCollator -com.ibm.icu4jni.text.RuleBasedNumberFormat -com.ibm.icu4jni.util.Resources -com.ibm.icu4jni.util.Resources$DefaultTimeZones dalvik.system.DalvikLogHandler dalvik.system.DalvikLogging dalvik.system.NativeStart @@ -758,7 +752,6 @@ java.io.PrintStream java.io.PrintWriter java.io.PushbackReader java.io.RandomAccessFile -java.io.RandomAccessFile$RepositionLock java.io.Reader java.io.Serializable java.io.StreamCorruptedException @@ -853,6 +846,7 @@ java.math.BigDecimal java.math.BigInt java.math.BigInteger java.math.Multiplication +java.math.NativeBN java.net.AddressCache java.net.AddressCache$1 java.net.ConnectException @@ -930,7 +924,6 @@ java.security.Security java.security.cert.X509Certificate java.text.AttributedCharacterIterator$Attribute java.text.Collator -java.text.Collator$1 java.text.DateFormat java.text.DateFormat$Field java.text.DecimalFormat @@ -1126,7 +1119,6 @@ org.apache.harmony.luni.util.InputStreamHelper org.apache.harmony.luni.util.InputStreamHelper$1 org.apache.harmony.luni.util.InputStreamHelper$ExposedByteArrayInputStream org.apache.harmony.luni.util.LocaleCache -org.apache.harmony.luni.util.Msg org.apache.harmony.luni.util.NumberConverter org.apache.harmony.luni.util.PriviAction org.apache.harmony.luni.util.ThreadLocalCache @@ -1178,7 +1170,6 @@ org.apache.harmony.security.x509.SubjectPublicKeyInfo org.apache.harmony.security.x509.TBSCertificate org.apache.harmony.security.x509.Time org.apache.harmony.security.x509.Validity -org.apache.harmony.text.BidiWrapper org.apache.harmony.xml.ExpatAttributes org.apache.harmony.xml.ExpatParser org.apache.harmony.xml.ExpatPullParser @@ -1260,7 +1251,6 @@ org.ccil.cowan.tagsoup.Parser org.json.JSONObject org.kxml2.io.KXmlParser org.kxml2.io.KXmlSerializer -org.openssl.NativeBN org.xml.sax.Attributes org.xml.sax.InputSource org.xml.sax.helpers.AttributesImpl diff --git a/test-runner/Android.mk b/test-runner/Android.mk index 962e96c43bfba..6d81b71c03e85 100644 --- a/test-runner/Android.mk +++ b/test-runner/Android.mk @@ -20,7 +20,7 @@ include $(CLEAR_VARS) LOCAL_SRC_FILES := $(call all-java-files-under, src) -LOCAL_JAVA_LIBRARIES := core framework +LOCAL_JAVA_LIBRARIES := core core-junit framework LOCAL_MODULE:= android.test.runner diff --git a/tests/CoreTests/android/Android.mk b/tests/CoreTests/android/Android.mk index 012e5eb661f94..5abfc8821a6ab 100644 --- a/tests/CoreTests/android/Android.mk +++ b/tests/CoreTests/android/Android.mk @@ -6,7 +6,7 @@ LOCAL_MODULE_TAGS := tests LOCAL_SRC_FILES := \ $(call all-subdir-java-files) -LOCAL_JAVA_LIBRARIES := android.test.runner +LOCAL_JAVA_LIBRARIES := android.test.runner bouncycastle LOCAL_PACKAGE_NAME := CoreTests diff --git a/tests/CoreTests/android/core/CryptoTest.java b/tests/CoreTests/android/core/CryptoTest.java deleted file mode 100644 index e6e50ecc4ab63..0000000000000 --- a/tests/CoreTests/android/core/CryptoTest.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (C) 2008 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package android.core; - -import junit.framework.Assert; -import junit.framework.TestCase; - -import org.apache.harmony.xnet.provider.jsse.OpenSSLMessageDigest; -import org.bouncycastle.crypto.Digest; -import org.bouncycastle.crypto.ExtendedDigest; -import org.bouncycastle.crypto.digests.MD4Digest; -import org.bouncycastle.crypto.digests.MD5Digest; -import org.bouncycastle.crypto.digests.SHA1Digest; -import android.test.suitebuilder.annotation.LargeTest; -import android.test.suitebuilder.annotation.MediumTest; - -/** - * Implements unit tests for our JNI wrapper around OpenSSL. We use the - * existing Bouncy Castle implementation as our test oracle. - */ -public class CryptoTest extends TestCase { - - /** - * Processes the two given message digests for the same data and checks - * the results. Requirement is that the results must be equal, the digest - * implementations must have the same properties, and the new implementation - * must be faster than the old one. - * - * @param oldDigest The old digest implementation, provided by Bouncy Castle - * @param newDigest The new digest implementation, provided by OpenSSL - */ - public void doTestMessageDigest(Digest oldDigest, Digest newDigest) { - final int ITERATIONS = 10; - - byte[] data = new byte[1024]; - - byte[] oldHash = new byte[oldDigest.getDigestSize()]; - byte[] newHash = new byte[newDigest.getDigestSize()]; - - Assert.assertEquals("Hash names must be equal", oldDigest.getAlgorithmName(), newDigest.getAlgorithmName()); - Assert.assertEquals("Hash sizes must be equal", oldHash.length, newHash.length); - Assert.assertEquals("Hash block sizes must be equal", ((ExtendedDigest)oldDigest).getByteLength(), ((ExtendedDigest)newDigest).getByteLength()); - for (int i = 0; i < data.length; i++) { - data[i] = (byte)i; - } - - long oldTime = 0; - long newTime = 0; - - for (int j = 0; j < ITERATIONS; j++) { - long t0 = System.currentTimeMillis(); - for (int i = 0; i < 4; i++) { - oldDigest.update(data, 0, data.length); - } - int oldLength = oldDigest.doFinal(oldHash, 0); - long t1 = System.currentTimeMillis(); - - oldTime = oldTime + (t1 - t0); - - long t2 = System.currentTimeMillis(); - for (int i = 0; i < 4; i++) { - newDigest.update(data, 0, data.length); - } - int newLength = newDigest.doFinal(newHash, 0); - long t3 = System.currentTimeMillis(); - - newTime = newTime + (t3 - t2); - - Assert.assertEquals("Hash sizes must be equal", oldLength, newLength); - - for (int i = 0; i < oldLength; i++) { - Assert.assertEquals("Hashes[" + i + "] must be equal", oldHash[i], newHash[i]); - } - } - - android.util.Log.d("CryptoTest", "Time for " + ITERATIONS + " x old hash processing: " + oldTime + " ms"); - android.util.Log.d("CryptoTest", "Time for " + ITERATIONS + " x new hash processing: " + newTime + " ms"); - - // Assert.assertTrue("New hash should be faster", newTime < oldTime); - } - - /** - * Tests the MD4 implementation. - */ - @MediumTest - public void testMD4() { - Digest oldDigest = new MD4Digest(); - Digest newDigest = OpenSSLMessageDigest.getInstance("MD4"); - doTestMessageDigest(oldDigest, newDigest); - } - - /** - * Tests the MD5 implementation. - */ - @MediumTest - public void testMD5() { - Digest oldDigest = new MD5Digest(); - Digest newDigest = OpenSSLMessageDigest.getInstance("MD5"); - doTestMessageDigest(oldDigest, newDigest); - } - - /** - * Tests the SHA-1 implementation. - */ - @MediumTest - public void testSHA1() { - Digest oldDigest = new SHA1Digest(); - Digest newDigest = OpenSSLMessageDigest.getInstance("SHA-1"); - doTestMessageDigest(oldDigest, newDigest); - } - -} diff --git a/tests/CoreTests/android/core/SSLPerformanceTest.java b/tests/CoreTests/android/core/SSLPerformanceTest.java index e2bd9c566668d..fd87e89fcbe9a 100644 --- a/tests/CoreTests/android/core/SSLPerformanceTest.java +++ b/tests/CoreTests/android/core/SSLPerformanceTest.java @@ -19,8 +19,8 @@ package android.core; import android.test.AndroidTestCase; import android.os.Debug; import org.apache.harmony.xnet.provider.jsse.FileClientSessionCache; +import org.apache.harmony.xnet.provider.jsse.OpenSSLContextImpl; import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache; -import org.apache.harmony.xnet.provider.jsse.SSLContextImpl; import org.apache.http.conn.scheme.SchemeRegistry; import org.apache.http.conn.scheme.Scheme; import org.apache.http.conn.ClientConnectionManager; @@ -189,14 +189,14 @@ public class SSLPerformanceTest extends AndroidTestCase { public void testEngineInit() throws IOException, KeyManagementException { Stopwatch stopwatch = new Stopwatch(); - new SSLContextImpl().engineInit(null, null, null); + new OpenSSLContextImpl().engineInit(null, null, null); stopwatch.stop(); } public void testWebRequestWithoutCache() throws IOException, KeyManagementException { - SSLContextImpl sslContext = new SSLContextImpl(); + OpenSSLContextImpl sslContext = new OpenSSLContextImpl(); sslContext.engineInit(null, null, null); Stopwatch stopwatch = new Stopwatch(); @@ -210,7 +210,7 @@ public class SSLPerformanceTest extends AndroidTestCase { KeyManagementException { deleteDirectory(); - SSLContextImpl sslContext = new SSLContextImpl(); + OpenSSLContextImpl sslContext = new OpenSSLContextImpl(); sslContext.engineInit(null, null, null, FileClientSessionCache.usingDirectory(getCacheDirectory()), null); @@ -234,7 +234,7 @@ public class SSLPerformanceTest extends AndroidTestCase { KeyManagementException { deleteDirectory(); - SSLContextImpl sslContext = new SSLContextImpl(); + OpenSSLContextImpl sslContext = new OpenSSLContextImpl(); sslContext.engineInit(null, null, null); // Make sure www.google.com is in the cache. @@ -247,7 +247,7 @@ public class SSLPerformanceTest extends AndroidTestCase { stopwatch.stop(); } - private void getVerisignDotCom(SSLContextImpl sslContext) + private void getVerisignDotCom(OpenSSLContextImpl sslContext) throws IOException { SchemeRegistry schemeRegistry = new SchemeRegistry(); schemeRegistry.register(new Scheme("https", diff --git a/tests/CoreTests/android/core/SSLSocketTest.java b/tests/CoreTests/android/core/SSLSocketTest.java index 088fa8c7a9a1a..021df80d20603 100644 --- a/tests/CoreTests/android/core/SSLSocketTest.java +++ b/tests/CoreTests/android/core/SSLSocketTest.java @@ -19,9 +19,9 @@ package android.core; import junit.framework.TestCase; import org.apache.commons.codec.binary.Base64; -import org.apache.harmony.xnet.provider.jsse.SSLContextImpl; -import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache; import org.apache.harmony.xnet.provider.jsse.FileClientSessionCache; +import org.apache.harmony.xnet.provider.jsse.OpenSSLContextImpl; +import org.apache.harmony.xnet.provider.jsse.SSLClientSessionCache; import java.io.ByteArrayInputStream; import java.io.DataInputStream; @@ -907,7 +907,7 @@ public class SSLSocketTest extends TestCase { */ public void testClientSessionCaching() throws IOException, KeyManagementException { - SSLContextImpl context = new SSLContextImpl(); + OpenSSLContextImpl context = new OpenSSLContextImpl(); // Cache size = 2. FakeClientSessionCache fakeCache = new FakeClientSessionCache(); @@ -997,7 +997,7 @@ public class SSLSocketTest extends TestCase { public void testFileBasedClientSessionCache() throws IOException, KeyManagementException { - SSLContextImpl context = new SSLContextImpl(); + OpenSSLContextImpl context = new OpenSSLContextImpl(); String tmpDir = System.getProperty("java.io.tmpdir"); if (tmpDir == null) { fail("Please set 'java.io.tmpdir' system property.");