From 08065b9f09ead8895d97b2971622af8c179e1768 Mon Sep 17 00:00:00 2001 From: Brian Carlstrom Date: Fri, 1 Apr 2011 15:49:41 -0700 Subject: [PATCH] Tracking merge of dalvik-dev to master git cherry-pick --no-commit a80febd83c8bf0b6717da2a7136179bdc906a5b7 git cherry-pick --no-commit 5e642b41cf44c5da7afdd95ab3d5e2bdbf7b31dd git cherry-pick --no-commit 4886db14c9eee4b6fee69bd54c57c5af04709c4c git cherry-pick --no-commit 560c685e448769904047507b9484ce8111967d7e git cherry-pick --no-commit 63dde7a2fcfa53dc531558635b64cea613d3cdb4 git cherry-pick --no-commit 74e5cb91060a379d98dd3a333b5f231bfb4f502e git cherry-pick --no-commit 1cc8c9708b555e2e338b7798d38887a2fefcfea6 git cherry-pick --no-commit 09625a21f5abe0c0db15757f58585d552d62c3d7 git cherry-pick --no-commit fcb02dfe0f5a2bb7c07e6d6fc69f756a484b5458 git cherry-pick --no-commit a68cb7fa3ab42854768b8145ff85231663770292 git cherry-pick --no-commit 716beb1c131dd2c6b805d4f681debaa20075010c git cherry-pick --no-commit 8c29b1097a7afe3a77e27546a56e396f3620a4ec git cherry-pick --no-commit 9c6a1a55d1c8086c1cc57464eea43725694ff70c git cherry-pick --no-commit b14f5ea5c57acdd009ba5b51f1bbe430f3d353b8 Change-Id: I8cc94175441b009e23549762d6baee1dbace4881 --- Android.mk | 2 + api/12.xml | 44 +-- api/current.xml | 293 +++++++++--------- core/java/android/util/TimeUtils.java | 2 +- core/java/android/util/Xml.java | 42 ++- .../com/android/internal/os/ZygoteInit.java | 16 +- core/jni/AndroidRuntime.cpp | 1 + core/tests/coretests/Android.mk | 2 +- core/tests/systemproperties/Android.mk | 2 +- .../test/ClassPathPackageInfoSource.java | 14 +- 10 files changed, 189 insertions(+), 229 deletions(-) diff --git a/Android.mk b/Android.mk index 3902971f0b5b4..3f52948bbaa8e 100644 --- a/Android.mk +++ b/Android.mk @@ -640,6 +640,8 @@ LOCAL_MODULE := ext LOCAL_NO_EMMA_INSTRUMENT := true LOCAL_NO_EMMA_COMPILE := true +LOCAL_DX_FLAGS := --core-library + include $(BUILD_JAVA_LIBRARY) diff --git a/api/12.xml b/api/12.xml index 26469040103b7..f317dc52cdd95 100644 --- a/api/12.xml +++ b/api/12.xml @@ -270265,7 +270265,7 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/api/current.xml b/api/current.xml index 58aa1fd95376d..740c69730791c 100644 --- a/api/current.xml +++ b/api/current.xml @@ -267728,7 +267728,7 @@ abstract="true" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -267739,7 +267739,7 @@ abstract="true" static="false" final="false" - deprecated="not deprecated" + deprecated="deprecated" visibility="public" > @@ -270824,7 +270824,7 @@ - + + + + + + + + + + + + + + + + - + - + @@ -270969,7 +271007,7 @@ - + @@ -270995,26 +271033,13 @@ deprecated="not deprecated" visibility="public" > - + - + - - - - - - - - - - @@ -275886,7 +275896,7 @@ deprecated="not deprecated" visibility="public" > - + @@ -276422,8 +276432,6 @@ > - - - - - - - - - + - + @@ -279140,7 +279142,7 @@ deprecated="not deprecated" visibility="public" > - + - + @@ -279224,7 +279226,7 @@ deprecated="not deprecated" visibility="public" > - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -280598,9 +280600,9 @@ > - + - + @@ -286057,7 +286059,7 @@ deprecated="not deprecated" visibility="public" > - + - - - - - - - - - - - - - - - - - - - - - - - - - - - + - - - - + + + + + + + + + + + + - + - + @@ -310271,9 +310282,9 @@ deprecated="not deprecated" visibility="protected" > - + - + - + - + - + - + @@ -355502,7 +355513,7 @@ deprecated="not deprecated" visibility="public" > - + + + - - - + + + - - - + - + - + - + - - diff --git a/core/java/android/util/TimeUtils.java b/core/java/android/util/TimeUtils.java index 9042505663572..93299eb8cc66d 100644 --- a/core/java/android/util/TimeUtils.java +++ b/core/java/android/util/TimeUtils.java @@ -19,7 +19,7 @@ package android.util; import android.content.res.Resources; import android.content.res.XmlResourceParser; -import org.apache.harmony.luni.internal.util.ZoneInfoDB; +import libcore.util.ZoneInfoDB; import org.xmlpull.v1.XmlPullParser; import org.xmlpull.v1.XmlPullParserException; diff --git a/core/java/android/util/Xml.java b/core/java/android/util/Xml.java index b0c33e5fca61b..041e8a85aafec 100644 --- a/core/java/android/util/Xml.java +++ b/core/java/android/util/Xml.java @@ -16,23 +16,21 @@ package android.util; -import org.xml.sax.ContentHandler; -import org.xml.sax.InputSource; -import org.xml.sax.SAXException; -import org.xml.sax.XMLReader; -import org.xmlpull.v1.XmlPullParser; -import org.xmlpull.v1.XmlSerializer; -import org.xmlpull.v1.XmlPullParserException; -import org.xmlpull.v1.XmlPullParserFactory; - import java.io.IOException; import java.io.InputStream; import java.io.Reader; import java.io.StringReader; import java.io.UnsupportedEncodingException; - -import org.apache.harmony.xml.ExpatPullParser; import org.apache.harmony.xml.ExpatReader; +import org.kxml2.io.KXmlParser; +import org.xml.sax.ContentHandler; +import org.xml.sax.InputSource; +import org.xml.sax.SAXException; +import org.xml.sax.XMLReader; +import org.xmlpull.v1.XmlPullParser; +import org.xmlpull.v1.XmlPullParserException; +import org.xmlpull.v1.XmlPullParserFactory; +import org.xmlpull.v1.XmlSerializer; /** * XML utility methods. @@ -46,7 +44,7 @@ public class Xml { * @see * specification */ - public static String FEATURE_RELAXED = ExpatPullParser.FEATURE_RELAXED; + public static String FEATURE_RELAXED = "http://xmlpull.org/v1/doc/features.html#relaxed"; /** * Parses the given xml string and fires events on the given SAX handler. @@ -57,8 +55,7 @@ public class Xml { XMLReader reader = new ExpatReader(); reader.setContentHandler(contentHandler); reader.parse(new InputSource(new StringReader(xml))); - } - catch (IOException e) { + } catch (IOException e) { throw new AssertionError(e); } } @@ -88,16 +85,17 @@ public class Xml { } /** - * Creates a new pull parser with namespace support. - * - *

Note: This is actually slower than the SAX parser, and it's not - * fully implemented. If you need a fast, mostly implemented pull parser, - * use this. If you need a complete implementation, use KXML. + * Returns a new pull parser with namespace support. */ public static XmlPullParser newPullParser() { - ExpatPullParser parser = new ExpatPullParser(); - parser.setNamespaceProcessingEnabled(true); - return parser; + try { + KXmlParser parser = new KXmlParser(); + parser.setFeature(XmlPullParser.FEATURE_PROCESS_DOCDECL, true); + parser.setFeature(XmlPullParser.FEATURE_PROCESS_NAMESPACES, true); + return parser; + } catch (XmlPullParserException e) { + throw new AssertionError(); + } } /** diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java index 32ddc2203ea84..9b71a8b8b3547 100644 --- a/core/java/com/android/internal/os/ZygoteInit.java +++ b/core/java/com/android/internal/os/ZygoteInit.java @@ -254,7 +254,7 @@ public class ZygoteInit { runtime.setTargetHeapUtilization(0.8f); // Start with a clean slate. - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); Debug.startAllocCounting(); @@ -281,7 +281,7 @@ public class ZygoteInit { Log.v(TAG, " GC at " + Debug.getGlobalAllocSize()); } - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); Debug.resetGlobalAllocSize(); } @@ -329,7 +329,7 @@ public class ZygoteInit { Debug.startAllocCounting(); try { - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); mResources = Resources.getSystem(); mResources.startPreloading(); @@ -365,7 +365,7 @@ public class ZygoteInit { if (Config.LOGV) { Log.v(TAG, " GC at " + Debug.getGlobalAllocSize()); } - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); Debug.resetGlobalAllocSize(); } @@ -388,7 +388,7 @@ public class ZygoteInit { if (Config.LOGV) { Log.v(TAG, " GC at " + Debug.getGlobalAllocSize()); } - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); Debug.resetGlobalAllocSize(); } @@ -419,11 +419,11 @@ public class ZygoteInit { /* runFinalizationSync() lets finalizers be called in Zygote, * which doesn't have a HeapWorker thread. */ - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); - runtime.gcSoftReferences(); + System.gc(); runtime.runFinalizationSync(); } diff --git a/core/jni/AndroidRuntime.cpp b/core/jni/AndroidRuntime.cpp index e4eb6925a0d87..74155b1ad772a 100644 --- a/core/jni/AndroidRuntime.cpp +++ b/core/jni/AndroidRuntime.cpp @@ -698,6 +698,7 @@ int AndroidRuntime::startVm(JavaVM** pJavaVM, JNIEnv** pEnv) case 'n': val = "-Xdexopt:none"; break; case 'v': val = "-Xdexopt:verified"; break; case 'a': val = "-Xdexopt:all"; break; + case 'f': val = "-Xdexopt:full"; break; default: val = NULL; break; } diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk index b49680506802f..b02d9044bd4da 100644 --- a/core/tests/coretests/Android.mk +++ b/core/tests/coretests/Android.mk @@ -12,7 +12,7 @@ LOCAL_SRC_FILES := \ $(call all-java-files-under, EnabledTestApp/src) LOCAL_DX_FLAGS := --core-library -LOCAL_STATIC_JAVA_LIBRARIES := core-tests-supportlib android-common frameworks-core-util-lib +LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-common frameworks-core-util-lib LOCAL_JAVA_LIBRARIES := android.test.runner LOCAL_PACKAGE_NAME := FrameworksCoreTests diff --git a/core/tests/systemproperties/Android.mk b/core/tests/systemproperties/Android.mk index 05216e0d432e6..9f01a28fd332f 100644 --- a/core/tests/systemproperties/Android.mk +++ b/core/tests/systemproperties/Android.mk @@ -9,7 +9,7 @@ LOCAL_SRC_FILES := \ $(call all-java-files-under, src) LOCAL_DX_FLAGS := --core-library -LOCAL_STATIC_JAVA_LIBRARIES := core-tests-supportlib android-common frameworks-core-util-lib +LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-common frameworks-core-util-lib LOCAL_JAVA_LIBRARIES := android.test.runner LOCAL_PACKAGE_NAME := FrameworksCoreSystemPropertiesTests diff --git a/test-runner/src/android/test/ClassPathPackageInfoSource.java b/test-runner/src/android/test/ClassPathPackageInfoSource.java index 877075f2d2af9..7b4e793ab6399 100644 --- a/test-runner/src/android/test/ClassPathPackageInfoSource.java +++ b/test-runner/src/android/test/ClassPathPackageInfoSource.java @@ -119,22 +119,12 @@ public class ClassPathPackageInfoSource { try { if (entryName.endsWith(".apk")) { findClassesInApk(entryName, packageName, classNames, subpackageNames); - } else if ("true".equals(System.getProperty("android.vm.dexfile", "false"))) { - // If the vm supports dex files then scan the directories that contain - // apk files. + } else { + // scan the directories that contain apk files. for (String apkPath : apkPaths) { File file = new File(apkPath); scanForApkFiles(file, packageName, classNames, subpackageNames); } - } else if (entryName.endsWith(".jar")) { - findClassesInJar(classPathEntry, pathPrefix, - classNames, subpackageNames); - } else if (classPathEntry.isDirectory()) { - findClassesInDirectory(classPathEntry, packagePrefix, pathPrefix, - classNames, subpackageNames); - } else { - throw new AssertionError("Don't understand classpath entry " + - classPathEntry); } } catch (IOException e) { throw new AssertionError("Can't read classpath entry " +