Merge cherrypicks of [3287457, 3287458, 3286978, 3286979, 3287477, 3287478, 3287479, 3287480, 3287517, 3287518, 3287537, 3287538, 3287539, 3287540, 3287481, 3287482, 3287483, 3287484, 3287485, 3287486, 3287487, 3287488, 3287359, 3287459, 3287360, 3287361, 3287362, 3287363, 3287364, 3287365, 3287366, 3287367, 3287489, 3287490, 3287491, 3287557, 3287577, 3287558, 3287492, 3287493, 3287597, 3287617, 3286980, 3287460, 3287494] into oc-m3-release

Change-Id: Ie92d5e77d48e388b9fb5bf9d3a13253e66f20134
diff --git a/tests/tests/net/src/android/net/cts/UriTest.java b/tests/tests/net/src/android/net/cts/UriTest.java
index ab337d0..05e826a 100644
--- a/tests/tests/net/src/android/net/cts/UriTest.java
+++ b/tests/tests/net/src/android/net/cts/UriTest.java
@@ -109,6 +109,11 @@
         uri = Uri.parse("http://localhost");
         assertEquals("localhost", uri.getHost());
         assertEquals(-1, uri.getPort());
+
+        uri = Uri.parse("http://a:a@example.com:a@example2.com/path");
+        assertEquals("a:a@example.com:a@example2.com", uri.getAuthority());
+        assertEquals("example2.com", uri.getHost());
+        assertEquals(-1, uri.getPort());
     }
 
     public void testCompareTo() {
diff --git a/tests/tests/security/res/raw/bug_67737022.mp4 b/tests/tests/security/res/raw/bug_67737022.mp4
new file mode 100644
index 0000000..c2136e5
--- /dev/null
+++ b/tests/tests/security/res/raw/bug_67737022.mp4
Binary files differ
diff --git a/tests/tests/security/src/android/security/cts/BitmapTest.java b/tests/tests/security/src/android/security/cts/BitmapTest.java
new file mode 100644
index 0000000..6253f0a
--- /dev/null
+++ b/tests/tests/security/src/android/security/cts/BitmapTest.java
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2017 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.security.cts;
+
+import org.junit.runner.RunWith;
+import org.junit.Test;
+
+import android.graphics.Bitmap;
+import android.platform.test.annotations.SecurityTest;
+import android.support.test.runner.AndroidJUnit4;
+
+@SecurityTest
+@RunWith(AndroidJUnit4.class)
+public class BitmapTest {
+    /**
+     * Test Bitmap.createBitmap properly throws OOME on large inputs.
+     *
+     * A prior change in behavior resulted in throwing an NPE instead.
+     * OOME is more appropriate.
+     */
+    @Test(expected=OutOfMemoryError.class)
+    public void test_33846679() {
+        // This size is based on the max size possible in a GIF file,
+        // which might be passed to createBitmap from a Java decoder.
+        Bitmap.createBitmap(65535, 65535, Bitmap.Config.ARGB_8888);
+    }
+}
diff --git a/tests/tests/security/src/android/security/cts/EffectBundleTest.java b/tests/tests/security/src/android/security/cts/EffectBundleTest.java
index fb02333..ae55494 100644
--- a/tests/tests/security/src/android/security/cts/EffectBundleTest.java
+++ b/tests/tests/security/src/android/security/cts/EffectBundleTest.java
@@ -19,6 +19,7 @@
 import android.media.audiofx.AudioEffect;
 import android.media.audiofx.EnvironmentalReverb;
 import android.media.audiofx.Equalizer;
+import android.media.audiofx.PresetReverb;
 import android.media.MediaPlayer;
 import android.platform.test.annotations.SecurityTest;
 import android.test.InstrumentationTestCase;
@@ -247,6 +248,16 @@
         );
     }
 
+    //Testing security bug: 67647856
+    @SecurityTest
+    public void testPresetReverb_setParameter() throws Exception {
+        verifyZeroPVSizeRejectedForSetParameter(
+                AudioEffect.EFFECT_TYPE_PRESET_REVERB, new int[] {
+                  PresetReverb.PARAM_PRESET
+                }
+        );
+    }
+
     private boolean eqSetParamProperties(int media) {
         MediaPlayer mp = null;
         Equalizer eq = null;
diff --git a/tests/tests/security/src/android/security/cts/StagefrightTest.java b/tests/tests/security/src/android/security/cts/StagefrightTest.java
index 4e48304..ee36ca8 100644
--- a/tests/tests/security/src/android/security/cts/StagefrightTest.java
+++ b/tests/tests/security/src/android/security/cts/StagefrightTest.java
@@ -416,6 +416,17 @@
         doStagefrightTest(R.raw.bug_35467107);
     }
 
+    /***********************************************************
+     to prevent merge conflicts, add O tests below this comment,
+     before any existing test methods
+     ***********************************************************/
+
+    @SecurityTest
+    public void testBug_67737022() throws Exception {
+        doStagefrightTest(R.raw.bug_67737022);
+    }
+
+
     private void doStagefrightTest(final int rid) throws Exception {
         doStagefrightTestMediaPlayer(rid);
         doStagefrightTestMediaCodec(rid);