Merge "Added CloseGuard for BaseObj"
diff --git a/Android.mk b/Android.mk
index af27621..5544f85 100644
--- a/Android.mk
+++ b/Android.mk
@@ -430,7 +430,6 @@
 
 LOCAL_MODULE := framework
 
-LOCAL_DX_FLAGS := --core-library --multi-dex
 LOCAL_JACK_FLAGS := --multi-dex native
 
 LOCAL_RMTYPEDEFS := true
@@ -1101,8 +1100,6 @@
 LOCAL_MODULE_TAGS := optional
 LOCAL_MODULE := ext
 
-LOCAL_DX_FLAGS := --core-library
-
 include $(BUILD_JAVA_LIBRARY)
 
 
diff --git a/api/current.txt b/api/current.txt
index 5e84851..3839c83 100644
--- a/api/current.txt
+++ b/api/current.txt
@@ -46941,9 +46941,7 @@
 
   public final class FilePermission extends java.security.Permission implements java.io.Serializable {
     ctor public FilePermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -50488,9 +50486,7 @@
 
   public final class SocketPermission extends java.security.Permission implements java.io.Serializable {
     ctor public SocketPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -51572,9 +51568,7 @@
   public final class AllPermission extends java.security.Permission {
     ctor public AllPermission();
     ctor public AllPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -51588,9 +51582,7 @@
   public abstract class BasicPermission extends java.security.Permission implements java.io.Serializable {
     ctor public BasicPermission(java.lang.String);
     ctor public BasicPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -51968,10 +51960,8 @@
   public abstract class Permission implements java.security.Guard java.io.Serializable {
     ctor public Permission(java.lang.String);
     method public void checkGuard(java.lang.Object) throws java.lang.SecurityException;
-    method public abstract boolean equals(java.lang.Object);
     method public abstract java.lang.String getActions();
     method public final java.lang.String getName();
-    method public abstract int hashCode();
     method public abstract boolean implies(java.security.Permission);
     method public java.security.PermissionCollection newPermissionCollection();
   }
@@ -52229,13 +52219,11 @@
 
   public final class UnresolvedPermission extends java.security.Permission implements java.io.Serializable {
     ctor public UnresolvedPermission(java.lang.String, java.lang.String, java.lang.String, java.security.cert.Certificate[]);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
     method public java.lang.String getUnresolvedActions();
     method public java.security.cert.Certificate[] getUnresolvedCerts();
     method public java.lang.String getUnresolvedName();
     method public java.lang.String getUnresolvedType();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -52293,8 +52281,6 @@
   }
 
   public abstract interface Permission {
-    method public abstract boolean equals(java.lang.Object);
-    method public abstract java.lang.String toString();
   }
 
 }
@@ -55012,6 +54998,7 @@
     method public void forEach(java.util.function.Consumer<? super E>);
     method public E get(int);
     method public boolean removeIf(java.util.function.Predicate<? super E>);
+    method public void replaceAll(java.util.function.UnaryOperator<E>);
     method public int size();
     method public void sort(java.util.Comparator<? super E>);
     method public java.util.Spliterator<E> spliterator();
@@ -55097,6 +55084,10 @@
     method public static int hashCode(float[]);
     method public static int hashCode(double[]);
     method public static int hashCode(java.lang.Object[]);
+    method public static void parallelSetAll(T[], java.util.function.IntFunction<? extends T>);
+    method public static void parallelSetAll(int[], java.util.function.IntUnaryOperator);
+    method public static void parallelSetAll(long[], java.util.function.IntToLongFunction);
+    method public static void parallelSetAll(double[], java.util.function.IntToDoubleFunction);
     method public static void parallelSort(byte[]);
     method public static void parallelSort(byte[], int, int);
     method public static void parallelSort(char[]);
@@ -55645,6 +55636,7 @@
     method public java.lang.Object clone();
     method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
     method public void forEach(java.util.function.BiConsumer<? super K, ? super V>);
+    method public boolean replace(K, V, V);
   }
 
   public class HashSet extends java.util.AbstractSet implements java.lang.Cloneable java.io.Serializable java.util.Set {
@@ -55665,6 +55657,9 @@
     ctor public Hashtable(java.util.Map<? extends K, ? extends V>);
     method public synchronized void clear();
     method public synchronized java.lang.Object clone();
+    method public synchronized V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
+    method public synchronized V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
+    method public synchronized V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
     method public synchronized boolean contains(java.lang.Object);
     method public synchronized boolean containsKey(java.lang.Object);
     method public boolean containsValue(java.lang.Object);
@@ -55672,13 +55667,19 @@
     method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
     method public synchronized void forEach(java.util.function.BiConsumer<? super K, ? super V>);
     method public synchronized V get(java.lang.Object);
+    method public synchronized V getOrDefault(java.lang.Object, V);
     method public synchronized boolean isEmpty();
     method public java.util.Set<K> keySet();
     method public synchronized java.util.Enumeration<K> keys();
+    method public synchronized V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
     method public synchronized V put(K, V);
     method public synchronized void putAll(java.util.Map<? extends K, ? extends V>);
+    method public synchronized V putIfAbsent(K, V);
     method protected void rehash();
     method public synchronized V remove(java.lang.Object);
+    method public synchronized boolean remove(java.lang.Object, java.lang.Object);
+    method public synchronized boolean replace(K, V, V);
+    method public synchronized V replace(K, V);
     method public synchronized int size();
     method public java.util.Collection<V> values();
   }
@@ -55823,9 +55824,11 @@
     method public abstract boolean remove(java.lang.Object);
     method public abstract E remove(int);
     method public abstract boolean removeAll(java.util.Collection<?>);
+    method public default void replaceAll(java.util.function.UnaryOperator<E>);
     method public abstract boolean retainAll(java.util.Collection<?>);
     method public abstract E set(int, E);
     method public abstract int size();
+    method public default void sort(java.util.Comparator<? super E>);
     method public abstract java.util.List<E> subList(int, int);
     method public abstract java.lang.Object[] toArray();
     method public abstract T[] toArray(T[]);
@@ -56740,9 +56743,11 @@
     method public synchronized boolean removeElement(java.lang.Object);
     method public synchronized void removeElementAt(int);
     method public synchronized boolean removeIf(java.util.function.Predicate<? super E>);
+    method public synchronized void replaceAll(java.util.function.UnaryOperator<E>);
     method public synchronized void setElementAt(E, int);
     method public synchronized void setSize(int);
     method public synchronized int size();
+    method public synchronized void sort(java.util.Comparator<? super E>);
     method public java.util.Spliterator<E> spliterator();
     method public synchronized void trimToSize();
     field protected int capacityIncrement;
@@ -57208,6 +57213,7 @@
     method public java.lang.Object clone();
     method public boolean contains(java.lang.Object);
     method public boolean containsAll(java.util.Collection<?>);
+    method public void forEach(java.util.function.Consumer<? super E>);
     method public E get(int);
     method public int indexOf(E, int);
     method public int indexOf(java.lang.Object);
@@ -61593,11 +61599,9 @@
 
   public final class PrivateCredentialPermission extends java.security.Permission {
     ctor public PrivateCredentialPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
     method public java.lang.String getCredentialClass();
     method public java.lang.String[][] getPrincipals();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
diff --git a/api/system-current.txt b/api/system-current.txt
index 0305c70..9bbcb59 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -49559,9 +49559,7 @@
 
   public final class FilePermission extends java.security.Permission implements java.io.Serializable {
     ctor public FilePermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -53106,9 +53104,7 @@
 
   public final class SocketPermission extends java.security.Permission implements java.io.Serializable {
     ctor public SocketPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -54190,9 +54186,7 @@
   public final class AllPermission extends java.security.Permission {
     ctor public AllPermission();
     ctor public AllPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -54206,9 +54200,7 @@
   public abstract class BasicPermission extends java.security.Permission implements java.io.Serializable {
     ctor public BasicPermission(java.lang.String);
     ctor public BasicPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -54586,10 +54578,8 @@
   public abstract class Permission implements java.security.Guard java.io.Serializable {
     ctor public Permission(java.lang.String);
     method public void checkGuard(java.lang.Object) throws java.lang.SecurityException;
-    method public abstract boolean equals(java.lang.Object);
     method public abstract java.lang.String getActions();
     method public final java.lang.String getName();
-    method public abstract int hashCode();
     method public abstract boolean implies(java.security.Permission);
     method public java.security.PermissionCollection newPermissionCollection();
   }
@@ -54847,13 +54837,11 @@
 
   public final class UnresolvedPermission extends java.security.Permission implements java.io.Serializable {
     ctor public UnresolvedPermission(java.lang.String, java.lang.String, java.lang.String, java.security.cert.Certificate[]);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
     method public java.lang.String getUnresolvedActions();
     method public java.security.cert.Certificate[] getUnresolvedCerts();
     method public java.lang.String getUnresolvedName();
     method public java.lang.String getUnresolvedType();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
@@ -54911,8 +54899,6 @@
   }
 
   public abstract interface Permission {
-    method public abstract boolean equals(java.lang.Object);
-    method public abstract java.lang.String toString();
   }
 
 }
@@ -57630,6 +57616,7 @@
     method public void forEach(java.util.function.Consumer<? super E>);
     method public E get(int);
     method public boolean removeIf(java.util.function.Predicate<? super E>);
+    method public void replaceAll(java.util.function.UnaryOperator<E>);
     method public int size();
     method public void sort(java.util.Comparator<? super E>);
     method public java.util.Spliterator<E> spliterator();
@@ -57715,6 +57702,10 @@
     method public static int hashCode(float[]);
     method public static int hashCode(double[]);
     method public static int hashCode(java.lang.Object[]);
+    method public static void parallelSetAll(T[], java.util.function.IntFunction<? extends T>);
+    method public static void parallelSetAll(int[], java.util.function.IntUnaryOperator);
+    method public static void parallelSetAll(long[], java.util.function.IntToLongFunction);
+    method public static void parallelSetAll(double[], java.util.function.IntToDoubleFunction);
     method public static void parallelSort(byte[]);
     method public static void parallelSort(byte[], int, int);
     method public static void parallelSort(char[]);
@@ -58263,6 +58254,7 @@
     method public java.lang.Object clone();
     method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
     method public void forEach(java.util.function.BiConsumer<? super K, ? super V>);
+    method public boolean replace(K, V, V);
   }
 
   public class HashSet extends java.util.AbstractSet implements java.lang.Cloneable java.io.Serializable java.util.Set {
@@ -58283,6 +58275,9 @@
     ctor public Hashtable(java.util.Map<? extends K, ? extends V>);
     method public synchronized void clear();
     method public synchronized java.lang.Object clone();
+    method public synchronized V compute(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
+    method public synchronized V computeIfAbsent(K, java.util.function.Function<? super K, ? extends V>);
+    method public synchronized V computeIfPresent(K, java.util.function.BiFunction<? super K, ? super V, ? extends V>);
     method public synchronized boolean contains(java.lang.Object);
     method public synchronized boolean containsKey(java.lang.Object);
     method public boolean containsValue(java.lang.Object);
@@ -58290,13 +58285,19 @@
     method public java.util.Set<java.util.Map.Entry<K, V>> entrySet();
     method public synchronized void forEach(java.util.function.BiConsumer<? super K, ? super V>);
     method public synchronized V get(java.lang.Object);
+    method public synchronized V getOrDefault(java.lang.Object, V);
     method public synchronized boolean isEmpty();
     method public java.util.Set<K> keySet();
     method public synchronized java.util.Enumeration<K> keys();
+    method public synchronized V merge(K, V, java.util.function.BiFunction<? super V, ? super V, ? extends V>);
     method public synchronized V put(K, V);
     method public synchronized void putAll(java.util.Map<? extends K, ? extends V>);
+    method public synchronized V putIfAbsent(K, V);
     method protected void rehash();
     method public synchronized V remove(java.lang.Object);
+    method public synchronized boolean remove(java.lang.Object, java.lang.Object);
+    method public synchronized boolean replace(K, V, V);
+    method public synchronized V replace(K, V);
     method public synchronized int size();
     method public java.util.Collection<V> values();
   }
@@ -58441,9 +58442,11 @@
     method public abstract boolean remove(java.lang.Object);
     method public abstract E remove(int);
     method public abstract boolean removeAll(java.util.Collection<?>);
+    method public default void replaceAll(java.util.function.UnaryOperator<E>);
     method public abstract boolean retainAll(java.util.Collection<?>);
     method public abstract E set(int, E);
     method public abstract int size();
+    method public default void sort(java.util.Comparator<? super E>);
     method public abstract java.util.List<E> subList(int, int);
     method public abstract java.lang.Object[] toArray();
     method public abstract T[] toArray(T[]);
@@ -59358,9 +59361,11 @@
     method public synchronized boolean removeElement(java.lang.Object);
     method public synchronized void removeElementAt(int);
     method public synchronized boolean removeIf(java.util.function.Predicate<? super E>);
+    method public synchronized void replaceAll(java.util.function.UnaryOperator<E>);
     method public synchronized void setElementAt(E, int);
     method public synchronized void setSize(int);
     method public synchronized int size();
+    method public synchronized void sort(java.util.Comparator<? super E>);
     method public java.util.Spliterator<E> spliterator();
     method public synchronized void trimToSize();
     field protected int capacityIncrement;
@@ -59826,6 +59831,7 @@
     method public java.lang.Object clone();
     method public boolean contains(java.lang.Object);
     method public boolean containsAll(java.util.Collection<?>);
+    method public void forEach(java.util.function.Consumer<? super E>);
     method public E get(int);
     method public int indexOf(E, int);
     method public int indexOf(java.lang.Object);
@@ -64211,11 +64217,9 @@
 
   public final class PrivateCredentialPermission extends java.security.Permission {
     ctor public PrivateCredentialPermission(java.lang.String, java.lang.String);
-    method public boolean equals(java.lang.Object);
     method public java.lang.String getActions();
     method public java.lang.String getCredentialClass();
     method public java.lang.String[][] getPrincipals();
-    method public int hashCode();
     method public boolean implies(java.security.Permission);
   }
 
diff --git a/core/java/android/view/View.java b/core/java/android/view/View.java
index 68869a5..dad01ba 100644
--- a/core/java/android/view/View.java
+++ b/core/java/android/view/View.java
@@ -10940,7 +10940,7 @@
 
     /**
      * Like {@link #getMeasuredHeightAndState()}, but only returns the
-     * raw width component (that is the result is masked by
+     * raw height component (that is the result is masked by
      * {@link #MEASURED_SIZE_MASK}).
      *
      * @return The raw measured height of this view.
@@ -10956,7 +10956,7 @@
      * This should be used during measurement and layout calculations only. Use
      * {@link #getHeight()} to see how wide a view is after layout.
      *
-     * @return The measured width of this view as a bit mask.
+     * @return The measured height of this view as a bit mask.
      */
     @ViewDebug.ExportedProperty(category = "measurement", flagMapping = {
             @ViewDebug.FlagToString(mask = MEASURED_STATE_MASK, equals = MEASURED_STATE_TOO_SMALL,
diff --git a/core/java/com/android/internal/os/ZygoteInit.java b/core/java/com/android/internal/os/ZygoteInit.java
index 48a79bb..a91ad51 100644
--- a/core/java/com/android/internal/os/ZygoteInit.java
+++ b/core/java/com/android/internal/os/ZygoteInit.java
@@ -484,7 +484,7 @@
         try {
             for (String classPathElement : classPathElements) {
                 final int dexoptNeeded = DexFile.getDexOptNeeded(
-                        classPathElement, instructionSet, DexFile.COMPILATION_TYPE_FULL);
+                        classPathElement, instructionSet, "speed", false /* newProfile */);
                 if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                     installer.dexopt(classPathElement, Process.SYSTEM_UID, instructionSet,
                             dexoptNeeded, 0 /*dexFlags*/);
diff --git a/core/res/res/values/config.xml b/core/res/res/values/config.xml
index 4ca6766..91502e8d 100644
--- a/core/res/res/values/config.xml
+++ b/core/res/res/values/config.xml
@@ -1374,8 +1374,11 @@
          Choices are: OFF, DELETE, TRUNCATE, PERSIST and MEMORY.
          PERSIST may improve performance by reducing how often journal blocks are
          reallocated (compared to truncation) resulting in better data block locality
-         and less churn of the storage media. -->
-    <string name="db_default_journal_mode" translatable="false">PERSIST</string>
+         and less churn of the storage media.
+
+         The PERSIST mode results in data persisting in the journal beyond the life of
+         a transaction, so it interacts poorly with SECURE_DELETE. -->
+    <string name="db_default_journal_mode" translatable="false">TRUNCATE</string>
 
     <!-- Maximum size of the persistent journal file in bytes.
          If the journal file grows to be larger than this amount then SQLite will
diff --git a/core/tests/coretests/Android.mk b/core/tests/coretests/Android.mk
index e47d418..fd3997a 100644
--- a/core/tests/coretests/Android.mk
+++ b/core/tests/coretests/Android.mk
@@ -21,7 +21,6 @@
 	$(call all-java-files-under, DisabledTestApp/src) \
 	$(call all-java-files-under, EnabledTestApp/src)
 
-LOCAL_DX_FLAGS := --core-library
 LOCAL_AAPT_FLAGS = -0 dat -0 gld
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests-support android-common frameworks-core-util-lib mockwebserver guava littlemock mockito-target
 LOCAL_JAVA_LIBRARIES := android.test.runner conscrypt telephony-common org.apache.http.legacy
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyAndException/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyAndException/Android.mk
index 26f768b..9b2b9f1 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyAndException/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyAndException/Android.mk
@@ -31,28 +31,9 @@
 
 LOCAL_JAVACFLAGS := -nowarn
 
-mainDexList:= \
-    $(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/multidexlegacyandexception/Test.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyTestApp/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyTestApp/Android.mk
index 7e4f0a9..874263f 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyTestApp/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyTestApp/Android.mk
@@ -29,32 +29,13 @@
 
 LOCAL_DEX_PREOPT := false
 
-mainDexList:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
 
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/multidexlegacytestapp/Test.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
-
 ## The application with a full main dex
 include $(CLEAR_VARS)
 
@@ -70,28 +51,9 @@
 
 LOCAL_DEX_PREOPT := false
 
-mainDexList2:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList2)
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList2): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/multidexlegacytestapp/Test.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList2)
-endif
\ No newline at end of file
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyTestServices/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyTestServices/Android.mk
index 99bcd6c..2732372 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyTestServices/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyTestServices/Android.mk
@@ -26,20 +26,8 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-multidex
 
-mainDexList:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.dex.output.multidex.legacy=true
 
 LOCAL_DEX_PREOPT := false
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v1/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v1/Android.mk
index 1c7d807..b4a666f 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v1/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v1/Android.mk
@@ -28,28 +28,9 @@
 
 LOCAL_DEX_PREOPT := false
 
-mainDexList:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/framework/multidexlegacyversionedtestapp/MultiDexUpdateTest.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
\ No newline at end of file
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v2/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v2/Android.mk
index b77cf31..f38bd4f 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v2/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v2/Android.mk
@@ -28,28 +28,9 @@
 
 LOCAL_DEX_PREOPT := false
 
-mainDexList:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/framework/multidexlegacyversionedtestapp/MultiDexUpdateTest.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
diff --git a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v3/Android.mk b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v3/Android.mk
index 3631626..5bc2c95 100644
--- a/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v3/Android.mk
+++ b/core/tests/hosttests/test-apps/MultiDexLegacyVersionedTestApp_v3/Android.mk
@@ -26,31 +26,11 @@
 
 LOCAL_STATIC_JAVA_LIBRARIES := android-support-multidex
 
-mainDexList:= \
-	$(call intermediates-dir-for,APPS,$(LOCAL_PACKAGE_NAME),$(LOCAL_IS_HOST_MODULE),common)/maindex.list
-
 LOCAL_DEX_PREOPT := false
 
-LOCAL_DX_FLAGS := --multi-dex --main-dex-list=$(mainDexList) --minimal-main-dex
 LOCAL_JACK_FLAGS := -D jack.dex.output.policy=minimal-multidex -D jack.preprocessor=true\
     -D jack.preprocessor.file=$(LOCAL_PATH)/test.jpp -D jack.dex.output.multidex.legacy=true
 
-#################################
-include $(BUILD_SYSTEM)/configure_local_jack.mk
-#################################
-
-ifdef LOCAL_JACK_ENABLED
 LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/test.jpp
-endif
 
 include $(BUILD_PACKAGE)
-
-ifndef LOCAL_JACK_ENABLED
-$(mainDexList): $(full_classes_proguard_jar) | $(MAINDEXCLASSES)
-	$(hide) mkdir -p $(dir $@)
-	$(MAINDEXCLASSES) $< 1>$@
-	echo "com/android/framework/multidexlegacyversionedtestapp/MultiDexUpdateTest.class" >> $@
-
-$(built_dex_intermediate): $(mainDexList)
-endif
-
diff --git a/core/tests/inputmethodtests/Android.mk b/core/tests/inputmethodtests/Android.mk
index da336af..41ea855 100644
--- a/core/tests/inputmethodtests/Android.mk
+++ b/core/tests/inputmethodtests/Android.mk
@@ -8,7 +8,6 @@
 LOCAL_SRC_FILES := \
 	$(call all-java-files-under, src)
 
-LOCAL_DX_FLAGS := --core-library
 LOCAL_STATIC_JAVA_LIBRARIES := core-tests android-common frameworks-core-util-lib
 LOCAL_JAVA_LANGUAGE_VERSION := 1.8
 LOCAL_JAVA_LIBRARIES := android.test.runner
diff --git a/core/tests/systemproperties/Android.mk b/core/tests/systemproperties/Android.mk
index 0c20876..e5ab2df 100644
--- a/core/tests/systemproperties/Android.mk
+++ b/core/tests/systemproperties/Android.mk
@@ -8,7 +8,6 @@
 LOCAL_SRC_FILES := \
 	$(call all-java-files-under, src)
 
-LOCAL_DX_FLAGS := --core-library
 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/docs/html/guide/topics/renderscript/reference/overview.jd b/docs/html/guide/topics/renderscript/reference/overview.jd
index 5e824ee..017a713 100644
--- a/docs/html/guide/topics/renderscript/reference/overview.jd
+++ b/docs/html/guide/topics/renderscript/reference/overview.jd
@@ -611,7 +611,7 @@
   </tr>
 </tbody></table>
 <h2>Conversion Functions</h2>
-<p> The functions below convert from a numerical vector type to another, of from one color
+<p> The functions below convert from a numerical vector type to another, or from one color
 representation to another.
 </p>
 <table class='jd-sumtable'><tbody>
diff --git a/docs/html/guide/topics/renderscript/reference/rs_convert.jd b/docs/html/guide/topics/renderscript/reference/rs_convert.jd
index d4bf77fa..89fd040 100644
--- a/docs/html/guide/topics/renderscript/reference/rs_convert.jd
+++ b/docs/html/guide/topics/renderscript/reference/rs_convert.jd
@@ -4,7 +4,7 @@
 
 <div class='renderscript'>
 <h2>Overview</h2>
-<p> The functions below convert from a numerical vector type to another, of from one color
+<p> The functions below convert from a numerical vector type to another, or from one color
 representation to another.
 </p>
 <h2>Summary</h2>
diff --git a/libs/hwui/RenderNode.h b/libs/hwui/RenderNode.h
index 025a4a4..c1c394c 100644
--- a/libs/hwui/RenderNode.h
+++ b/libs/hwui/RenderNode.h
@@ -126,7 +126,7 @@
 
     void setName(const char* name) {
         if (name) {
-            char* lastPeriod = strrchr(name, '.');
+            const char* lastPeriod = strrchr(name, '.');
             if (lastPeriod) {
                 mName.setTo(lastPeriod + 1);
             } else {
diff --git a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioTrackTest.java b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioTrackTest.java
index e884aba..eac5c28 100644
--- a/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioTrackTest.java
+++ b/media/tests/MediaFrameworkTest/src/com/android/mediaframeworktest/functional/audio/MediaAudioTrackTest.java
@@ -386,6 +386,7 @@
         final int TEST_FORMAT = AudioFormat.ENCODING_PCM_16BIT;
         final int TEST_MODE = AudioTrack.MODE_STREAM;
         final int TEST_STREAM_TYPE = AudioManager.STREAM_MUSIC;
+        final int TEST_LOOP_CNT = 10;
         
         //-------- initialization --------------
         int minBuffSize = AudioTrack.getMinBufferSize(TEST_SR, TEST_CONF, TEST_FORMAT);
@@ -399,9 +400,14 @@
         track.play();
         Thread.sleep(100);
         track.stop();
-        Thread.sleep(100); // TODO: what is a sensible value?
-        int pos = track.getPlaybackHeadPosition();
-        log(TEST_NAME, "position ="+ pos);
+        int count = 0;
+        int pos;
+        do {
+            Thread.sleep(200);
+            pos = track.getPlaybackHeadPosition();
+            count++;
+        } while((pos != 0) && (count < TEST_LOOP_CNT));
+        log(TEST_NAME, "position =" + pos + ", read count ="+count);
         assertTrue(TEST_NAME, pos == 0);
         //-------- tear down      --------------
         track.release();
diff --git a/rs/java/android/renderscript/Allocation.java b/rs/java/android/renderscript/Allocation.java
index 37c1c7a..b303b48 100644
--- a/rs/java/android/renderscript/Allocation.java
+++ b/rs/java/android/renderscript/Allocation.java
@@ -142,7 +142,10 @@
             }
             return Element.DataType.FLOAT_64;
         }
-        return null;
+
+        throw new RSIllegalArgumentException("Parameter of type " + cmp.getSimpleName() +
+            "[] is not compatible with data type " + mType.mElement.mType.name() +
+            " of allocation");
     }
 
 
@@ -293,8 +296,13 @@
     }
 
     /**
-     * Enable/Disable AutoPadding for Vec3 elements.
-     * By default: Diabled.
+     * Enable/Disable AutoPadding for Vec3 Elements.
+     *
+     * <p> Vec3 Elements, such as {@link Element#U8_3} are treated as Vec4 Elements
+     * with the fourth vector element used as padding. Enabling the AutoPadding feature
+     * will automatically add/remove the padding when you copy to/from an Allocation
+     * with a Vec3 Element.
+     * <p> By default: Disabled.
      *
      * @param useAutoPadding True: enable AutoPadding; False: disable AutoPadding
      *
diff --git a/rs/java/android/renderscript/Script.java b/rs/java/android/renderscript/Script.java
index 5b009a6..04ba864 100644
--- a/rs/java/android/renderscript/Script.java
+++ b/rs/java/android/renderscript/Script.java
@@ -557,21 +557,22 @@
 
     /**
      * Class for specifying the specifics about how a kernel will be
-     * launched
+     * launched.
      *
      * This class can specify a potential range of cells on which to
      * run a kernel.  If no set is called for a dimension then this
      * class will have no impact on that dimension when the kernel
      * is executed.
      *
-     * The forEach launch will operate over the intersection of the
-     * dimensions.
+     * The forEach kernel launch will operate over the intersection of
+     * the dimensions.
      *
      * Example:
      * LaunchOptions with setX(5, 15)
      * Allocation with dimension X=10, Y=10
-     * The resulting forEach run would execute over x = 5 to 10 and
-     * y = 0 to 10.
+     * The resulting forEach run would execute over:
+     * x = 5 to 9 (inclusive) and
+     * y = 0 to 9 (inclusive).
      *
      *
      */
@@ -585,11 +586,11 @@
         private int strategy;
 
         /**
-         * Set the X range.  If the end value is set to 0 the X dimension is not
-         * clipped.
+         * Set the X range. xstartArg is the lowest coordinate of the range,
+         * and xendArg-1 is the highest coordinate of the range.
          *
          * @param xstartArg Must be >= 0
-         * @param xendArg Must be >= xstartArg
+         * @param xendArg Must be > xstartArg
          *
          * @return LaunchOptions
          */
@@ -603,11 +604,11 @@
         }
 
         /**
-         * Set the Y range.  If the end value is set to 0 the Y dimension is not
-         * clipped.
+         * Set the Y range. ystartArg is the lowest coordinate of the range,
+         * and yendArg-1 is the highest coordinate of the range.
          *
          * @param ystartArg Must be >= 0
-         * @param yendArg Must be >= ystartArg
+         * @param yendArg Must be > ystartArg
          *
          * @return LaunchOptions
          */
@@ -621,11 +622,11 @@
         }
 
         /**
-         * Set the Z range.  If the end value is set to 0 the Z dimension is not
-         * clipped.
+         * Set the Z range. zstartArg is the lowest coordinate of the range,
+         * and zendArg-1 is the highest coordinate of the range.
          *
          * @param zstartArg Must be >= 0
-         * @param zendArg Must be >= zstartArg
+         * @param zendArg Must be > zstartArg
          *
          * @return LaunchOptions
          */
diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java
index 76da781..339e0e9 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve3x3.java
@@ -32,10 +32,9 @@
      * Supported elements types are {@link Element#U8}, {@link
      * Element#U8_2}, {@link Element#U8_3}, {@link Element#U8_4},
      * {@link Element#F32}, {@link Element#F32_2}, {@link
-     * Element#F32_3}, and {@link Element#F32_4}
+     * Element#F32_3}, and {@link Element#F32_4}.
      *
-     * The default coefficients are.
-     *
+     * <p> The default coefficients are:
      * <code>
      * <p> [ 0,  0,  0 ]
      * <p> [ 0,  1,  0 ]
@@ -67,7 +66,7 @@
     }
 
     /**
-     * Set the input of the blur.
+     * Set the input of the 3x3 convolve.
      * Must match the element type supplied during create.
      *
      * @param ain The input allocation.
@@ -80,7 +79,7 @@
     /**
      * Set the coefficients for the convolve.
      *
-     * The convolve layout is
+     * <p> The convolve layout is:
      * <code>
      * <p> [ 0,  1,  2 ]
      * <p> [ 3,  4,  5 ]
diff --git a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java
index 2d37600..a288cee 100644
--- a/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java
+++ b/rs/java/android/renderscript/ScriptIntrinsicConvolve5x5.java
@@ -32,9 +32,9 @@
      * Supported elements types are {@link Element#U8}, {@link
      * Element#U8_2}, {@link Element#U8_3}, {@link Element#U8_4},
      * {@link Element#F32}, {@link Element#F32_2}, {@link
-     * Element#F32_3}, and {@link Element#F32_4}
+     * Element#F32_3}, and {@link Element#F32_4}.
      *
-     * The default coefficients are.
+     * <p> The default coefficients are:
      * <code>
      * <p> [ 0,  0,  0,  0,  0  ]
      * <p> [ 0,  0,  0,  0,  0  ]
@@ -66,7 +66,7 @@
     }
 
     /**
-     * Set the input of the blur.
+     * Set the input of the 5x5 convolve.
      * Must match the element type supplied during create.
      *
      * @param ain The input allocation.
@@ -79,7 +79,7 @@
     /**
     * Set the coefficients for the convolve.
     *
-    * The convolve layout is
+    * <p> The convolve layout is:
     * <code>
     * <p> [ 0,  1,  2,  3,  4  ]
     * <p> [ 5,  6,  7,  8,  9  ]
diff --git a/services/core/java/com/android/server/pm/PackageDexOptimizer.java b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
index 1e4d4a3..8fb05a4 100644
--- a/services/core/java/com/android/server/pm/PackageDexOptimizer.java
+++ b/services/core/java/com/android/server/pm/PackageDexOptimizer.java
@@ -146,7 +146,7 @@
                 } else {
                     try {
                         dexoptNeeded = DexFile.getDexOptNeeded(path,
-                                dexCodeInstructionSet, DexFile.COMPILATION_TYPE_FULL);
+                                dexCodeInstructionSet, "speed-profile", useJit);
                     } catch (IOException ioe) {
                         Slog.w(TAG, "IOException reading apk: " + path, ioe);
                         return DEX_OPT_FAILED;
diff --git a/services/core/java/com/android/server/pm/PackageManagerService.java b/services/core/java/com/android/server/pm/PackageManagerService.java
index ef79eb8..7ea9038 100644
--- a/services/core/java/com/android/server/pm/PackageManagerService.java
+++ b/services/core/java/com/android/server/pm/PackageManagerService.java
@@ -1981,7 +1981,7 @@
 
                         try {
                             int dexoptNeeded = DexFile.getDexOptNeeded(lib, dexCodeInstructionSet,
-                                    DexFile.COMPILATION_TYPE_FULL);
+                                    "speed", false);
                             if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                                 alreadyDexOpted.add(lib);
                                 mInstaller.dexopt(lib, Process.SYSTEM_UID, dexCodeInstructionSet,
@@ -2032,7 +2032,7 @@
                         }
                         try {
                             int dexoptNeeded = DexFile.getDexOptNeeded(path, dexCodeInstructionSet,
-                                    DexFile.COMPILATION_TYPE_FULL);
+                                    "speed", false);
                             if (dexoptNeeded != DexFile.NO_DEXOPT_NEEDED) {
                                 mInstaller.dexopt(path, Process.SYSTEM_UID, dexCodeInstructionSet,
                                         dexoptNeeded, DEXOPT_PUBLIC /*dexFlags*/);
diff --git a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
index e9ace29..0e51953 100644
--- a/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
+++ b/services/core/java/com/android/server/statusbar/StatusBarManagerService.java
@@ -249,7 +249,7 @@
      */
     @Override
     public void disable2(int what, IBinder token, String pkg) {
-        disableForUser(what, token, pkg, mCurrentUserId);
+        disable2ForUser(what, token, pkg, mCurrentUserId);
     }
 
     /**
diff --git a/wifi/java/android/net/wifi/WifiInfo.java b/wifi/java/android/net/wifi/WifiInfo.java
index e25b38c..c3fc915 100644
--- a/wifi/java/android/net/wifi/WifiInfo.java
+++ b/wifi/java/android/net/wifi/WifiInfo.java
@@ -320,7 +320,8 @@
             if (!TextUtils.isEmpty(unicode)) {
                 return "\"" + unicode + "\"";
             } else {
-                return mWifiSsid.getHexString();
+                String hex = mWifiSsid.getHexString();
+                return (hex != null) ? hex : WifiSsid.NONE;
             }
         }
         return WifiSsid.NONE;
diff --git a/wifi/java/android/net/wifi/WifiSsid.java b/wifi/java/android/net/wifi/WifiSsid.java
index f8ba95d..c53cd3c 100644
--- a/wifi/java/android/net/wifi/WifiSsid.java
+++ b/wifi/java/android/net/wifi/WifiSsid.java
@@ -205,7 +205,7 @@
         for (int i = 0; i < octets.size(); i++) {
             out += String.format(Locale.US, "%02x", ssidbytes[i]);
         }
-        return out;
+        return (octets.size() > 0) ? out : null;
     }
 
     /** Implement the Parcelable interface {@hide} */