Merge "Disable automotive short notice for WM CTS tests"
diff --git a/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java b/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
index f9bdc22..fa1e4ec 100644
--- a/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
+++ b/hostsidetests/appcompat/compatchanges/src/com/android/cts/appcompat/CompatChangesValidConfigTest.java
@@ -45,19 +45,23 @@
                                                 + "(; name=(?<changeName>[^;]+))?"
                                                 + "(; enableAfterTargetSdk=(?<targetSdk>[0-9]+))?"
                                                 + "(; (?<disabled>disabled))?"
+                                                + "(; (?<loggingOnly>loggingOnly))?"
                                                 + "(; packageOverrides=(?<overrides>[^\\)]+))?"
                                                 + "\\)");
         long changeId;
         String changeName;
         int targetSdk;
         boolean disabled;
+        boolean loggingOnly;
         boolean hasOverrides;
 
-        private Change(long changeId, String changeName, int targetSdk, boolean disabled, boolean hasOverrides) {
+        private Change(long changeId, String changeName, int targetSdk, boolean disabled,
+                boolean loggingOnly, boolean hasOverrides) {
             this.changeId = changeId;
             this.changeName = changeName;
             this.targetSdk = targetSdk;
             this.disabled = disabled;
+            this.loggingOnly = loggingOnly;
             this.hasOverrides = hasOverrides;
         }
 
@@ -66,6 +70,7 @@
             String changeName;
             int targetSdk = 0;
             boolean disabled = false;
+            boolean loggingOnly = false;
             boolean hasOverrides = false;
 
             Matcher matcher = CHANGE_REGEX.matcher(line);
@@ -90,10 +95,13 @@
             if (matcher.group("disabled") != null) {
                 disabled = true;
             }
+            if (matcher.group("loggingOnly") != null) {
+                loggingOnly = true;
+            }
             if (matcher.group("overrides") != null) {
                 hasOverrides = true;
             }
-            return new Change(changeId, changeName, targetSdk, disabled, hasOverrides);
+            return new Change(changeId, changeName, targetSdk, disabled, loggingOnly, hasOverrides);
         }
 
         static Change fromNode(Node node) {
@@ -108,8 +116,12 @@
             if (element.hasAttribute("disabled")) {
                 disabled = true;
             }
+            boolean loggingOnly = false;
+            if (element.hasAttribute("loggingOnly")) {
+                loggingOnly = true;
+            }
             boolean hasOverrides = false;
-            return new Change(changeId, changeName, targetSdk, disabled, hasOverrides);
+            return new Change(changeId, changeName, targetSdk, disabled, loggingOnly, hasOverrides);
         }
         @Override
         public int hashCode() {
@@ -128,6 +140,7 @@
                 && Objects.equals(this.changeName, that.changeName)
                 && this.targetSdk == that.targetSdk
                 && this.disabled == that.disabled
+                && this.loggingOnly == that.loggingOnly
                 && this.hasOverrides == that.hasOverrides;
         }
         @Override
diff --git a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/UserRestrictionsTest.java b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/UserRestrictionsTest.java
index fdf063ea..9c594b43 100644
--- a/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/UserRestrictionsTest.java
+++ b/hostsidetests/devicepolicy/src/com/android/cts/devicepolicy/UserRestrictionsTest.java
@@ -258,7 +258,8 @@
 
     /** Installs admin package and makes it a profile owner for a given user. */
     private void setPoAsUser(int userId) throws Exception {
-        installAppAsUser(DEVICE_ADMIN_APK, userId);
+        installAppAsUser(DEVICE_ADMIN_APK,
+                /* grantPermissions */ true, /* dontKillApp */ true, userId);
         assertTrue("Failed to set profile owner",
                 setProfileOwner(DEVICE_ADMIN_PKG + "/" + ADMIN_RECEIVER_TEST_CLASS,
                         userId, /* expectFailure */ false));
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecClientWrapper.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecClientWrapper.java
index a804f98..6b369a7 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecClientWrapper.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/HdmiCecClientWrapper.java
@@ -16,8 +16,8 @@
 
 package android.hdmicec.cts;
 
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assume.assumeTrue;
+import static com.google.common.truth.Truth.assertThat;
+import static com.google.common.truth.Truth.assertWithMessage;
 
 import com.android.tradefed.device.ITestDevice;
 import com.android.tradefed.log.LogUtil.CLog;
@@ -68,13 +68,13 @@
     protected void before() throws Throwable {
         ITestDevice testDevice;
         testDevice = testObject.getDevice();
-        assertNotNull("Device not set", testDevice);
+        assertWithMessage("Device not set").that(testDevice).isNotNull();
 
-        assumeTrue(isHdmiCecFeatureSupported(testDevice));
+        assertThat(isHdmiCecFeatureSupported(testDevice)).isTrue();
 
         String deviceTypeCsv = testDevice.executeShellCommand("getprop ro.hdmi.device_type").trim();
         List<String> deviceType = Arrays.asList(deviceTypeCsv.replaceAll("\\s+", "").split(","));
-        assumeTrue(deviceType.contains(CecDevice.getDeviceType(targetDevice)));
+        assertThat(deviceType.contains(CecDevice.getDeviceType(targetDevice))).isTrue();
 
         this.init();
     };
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java
index 1305a2b..c81b550 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecLogicalAddressTest.java
@@ -16,8 +16,7 @@
 
 package android.hdmicec.cts.audio;
 
-import static org.junit.Assert.assertThat;
-import static org.hamcrest.CoreMatchers.is;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -51,6 +50,6 @@
         device.executeShellCommand("reboot");
         device.waitForBootComplete(HdmiCecConstants.REBOOT_TIMEOUT);
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.REPORT_PHYSICAL_ADDRESS);
-        assertThat(hdmiCecClient.getSourceFromMessage(message), is(AUDIO_DEVICE));
+        assertThat(hdmiCecClient.getSourceFromMessage(message)).isEqualTo(AUDIO_DEVICE);
     }
 }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java
index 01a023b..f6cea4b 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/audio/HdmiCecSystemAudioModeTest.java
@@ -19,9 +19,6 @@
 import static com.google.common.truth.Truth.assertThat;
 import static com.google.common.truth.Truth.assertWithMessage;
 
-import static org.junit.Assert.assertThat;
-import static org.hamcrest.CoreMatchers.is;
-
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
 import android.hdmicec.cts.HdmiCecClientWrapper;
@@ -64,7 +61,7 @@
     @Rule
     public HdmiCecClientWrapper hdmiCecClient = new HdmiCecClientWrapper(AUDIO_DEVICE, this);
 
-    private void lookForLog(String expectedOut) throws Exception {
+    private void lookForLogFromHdmiCecAudioManager(String expectedOut) throws Exception {
         ITestDevice device = getDevice();
         TimeUnit.SECONDS.sleep(WAIT_TIME);
         String logs = device.executeAdbCommand("logcat", "-v", "brief", "-d", CLASS + ":I", "*:S");
@@ -109,7 +106,7 @@
         // Start the APK and wait for it to complete.
         device.executeShellCommand(START_COMMAND + "android.hdmicec.app.REPORT_VOLUME");
         try {
-            lookForLog("Device muted.");
+            lookForLogFromHdmiCecAudioManager("Device muted.");
             return true;
         } catch(Exception e) {
             return false;
@@ -153,14 +150,14 @@
                 CecMessage.SYSTEM_AUDIO_MODE_REQUEST,
                 hdmiCecClient.formatParams(HdmiCecConstants.TV_PHYSICAL_ADDRESS));
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.SET_SYSTEM_AUDIO_MODE);
-        assertThat(hdmiCecClient.getParamsFromMessage(message), is(ON));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(ON);
 
         /* Repeat test for device 0x3 (TUNER_1) */
         hdmiCecClient.sendCecMessage(CecDevice.TUNER_1, AUDIO_DEVICE,
                 CecMessage.SYSTEM_AUDIO_MODE_REQUEST,
                 hdmiCecClient.formatParams(HdmiCecConstants.TV_PHYSICAL_ADDRESS));
         message = hdmiCecClient.checkExpectedOutput(CecMessage.SET_SYSTEM_AUDIO_MODE);
-        assertThat(hdmiCecClient.getParamsFromMessage(message), is(ON));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(ON);
     }
 
     /**
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java
index cda2951..05b2071 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecDeviceOsdNameTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -55,7 +55,7 @@
         }
         hdmiCecClient.sendCecMessage(CecDevice.TV, CecMessage.GIVE_OSD_NAME);
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.SET_OSD_NAME);
-        assertEquals(deviceName, hdmiCecClient.getAsciiStringFromMessage(message));
+        assertThat(hdmiCecClient.getAsciiStringFromMessage(message)).isEqualTo(deviceName);
     }
 
     /**
@@ -73,7 +73,7 @@
             hdmiCecClient.sendCecMessage(CecDevice.TV, CecMessage.GIVE_OSD_NAME);
             String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV,
                     CecMessage.SET_OSD_NAME);
-            assertEquals(testName, hdmiCecClient.getAsciiStringFromMessage(message));
+            assertThat(hdmiCecClient.getAsciiStringFromMessage(message)).isEqualTo(testName);
         } finally {
             device.executeShellCommand("settings put global device_name '" + originalName + "'");
         }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecLogicalAddressTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecLogicalAddressTest.java
index 83c9120..89d5304 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecLogicalAddressTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecLogicalAddressTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -51,6 +51,6 @@
         device.executeShellCommand("reboot");
         device.waitForBootComplete(HdmiCecConstants.REBOOT_TIMEOUT);
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.REPORT_PHYSICAL_ADDRESS);
-        assertEquals(PLAYBACK_DEVICE, hdmiCecClient.getSourceFromMessage(message));
+        assertThat(hdmiCecClient.getSourceFromMessage(message)).isEqualTo(PLAYBACK_DEVICE);
     }
 }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java
index a4ca3d2..1b86b12 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecOneTouchPlayTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -51,6 +51,6 @@
         device.executeShellCommand("input keyevent KEYCODE_HOME");
         hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.TEXT_VIEW_ON);
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.ACTIVE_SOURCE);
-        assertEquals(PHYSICAL_ADDRESS, hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS);
     }
 }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPhysicalAddressTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPhysicalAddressTest.java
index 91280e7..de28c23 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPhysicalAddressTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPhysicalAddressTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -52,6 +52,6 @@
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.REPORT_PHYSICAL_ADDRESS);
         int physicalAddress = hdmiCecClient.getParamsFromMessage(message,
             HdmiCecConstants.PHYSICAL_ADDRESS_LENGTH);
-        assertEquals(HdmiCecConstants.PHYSICAL_ADDRESS, physicalAddress);
+        assertThat(HdmiCecConstants.PHYSICAL_ADDRESS).isEqualTo(physicalAddress);
     }
 }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java
index 911d233..5e8548f 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecPowerStatusTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -59,7 +59,7 @@
         hdmiCecClient.sendCecMessage(CecDevice.TV, CecMessage.GIVE_POWER_STATUS);
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV,
                                                             CecMessage.REPORT_POWER_STATUS);
-        assertEquals(ON, hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(ON);
     }
 
     /**
@@ -78,7 +78,7 @@
             hdmiCecClient.sendCecMessage(CecDevice.TV, CecMessage.GIVE_POWER_STATUS);
             String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV,
                                                               CecMessage.REPORT_POWER_STATUS);
-            assertEquals(OFF, hdmiCecClient.getParamsFromMessage(message));
+            assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(OFF);
         } finally {
             /* Wake up the device */
             device.executeShellCommand("input keyevent KEYCODE_WAKEUP");
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
index 9ac7eab..1981759 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRemoteControlPassThroughTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.HdmiCecClientWrapper;
@@ -76,7 +76,7 @@
             }
         }
         device.executeAdbCommand("logcat", "-c");
-        assertEquals(expectedOut, testString);
+        assertThat(testString).isEqualTo(expectedOut);
     }
 
     /**
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java
index 4fd2a89..f75925f 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecRoutingControlTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -59,8 +59,7 @@
                 CecMessage.SET_STREAM_PATH,
                 hdmiCecClient.formatParams(HdmiCecConstants.PHYSICAL_ADDRESS));
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.ACTIVE_SOURCE);
-        assertEquals(HdmiCecConstants.PHYSICAL_ADDRESS,
-                hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS);
     }
 
     /**
@@ -75,7 +74,7 @@
         hdmiCecClient.sendCecMessage(CecDevice.TV, CecDevice.BROADCAST,
             CecMessage.REQUEST_ACTIVE_SOURCE);
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.ACTIVE_SOURCE);
-        assertEquals(PHYSICAL_ADDRESS, hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS);
     }
 
     /**
@@ -91,8 +90,7 @@
             device.executeShellCommand("input keyevent KEYCODE_SLEEP");
             String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV,
                     CecMessage.INACTIVE_SOURCE);
-            assertEquals(HdmiCecConstants.PHYSICAL_ADDRESS,
-                    hdmiCecClient.getParamsFromMessage(message));
+            assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(PHYSICAL_ADDRESS);
         } finally {
             /* Wake up the device */
             device.executeShellCommand("input keyevent KEYCODE_WAKEUP");
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
index 3ac2e5f..7df368c 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemAudioControlTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -67,16 +67,16 @@
         device.executeShellCommand("input keyevent KEYCODE_VOLUME_UP");
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM,
                 CecMessage.USER_CONTROL_PRESSED);
-        assertEquals(HdmiCecConstants.CEC_CONTROL_VOLUME_UP,
-                hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message))
+                .isEqualTo(HdmiCecConstants.CEC_CONTROL_VOLUME_UP);
         hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM, CecMessage.USER_CONTROL_RELEASED);
 
 
         device.executeShellCommand("input keyevent KEYCODE_VOLUME_DOWN");
         message = hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM,
                 CecMessage.USER_CONTROL_PRESSED);
-        assertEquals(HdmiCecConstants.CEC_CONTROL_VOLUME_DOWN,
-                hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message))
+                .isEqualTo(HdmiCecConstants.CEC_CONTROL_VOLUME_DOWN);
         hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM, CecMessage.USER_CONTROL_RELEASED);
     }
 
@@ -92,8 +92,8 @@
         device.executeShellCommand("input keyevent KEYCODE_MUTE");
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM,
                 CecMessage.USER_CONTROL_PRESSED);
-        assertEquals(HdmiCecConstants.CEC_CONTROL_MUTE,
-                hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message))
+                .isEqualTo(HdmiCecConstants.CEC_CONTROL_MUTE);
         hdmiCecClient.checkExpectedOutput(CecDevice.AUDIO_SYSTEM, CecMessage.USER_CONTROL_RELEASED);
     }
 }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java
index c6df9f7..d6fb1dc 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemInformationTest.java
@@ -16,7 +16,8 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
+
 import static org.junit.Assume.assumeTrue;
 
 import android.hdmicec.cts.CecClientMessage;
@@ -72,8 +73,8 @@
         /* The checkExpectedOutput has already verified the first 4 nibbles of the message. We
             * have to verify the last 6 nibbles */
         int receivedParams = hdmiCecClient.getParamsFromMessage(message);
-        assertEquals(HdmiCecConstants.PHYSICAL_ADDRESS, receivedParams >> 8);
-        assertEquals(HdmiCecConstants.PLAYBACK_DEVICE_TYPE, receivedParams & 0xFF);
+        assertThat(HdmiCecConstants.PHYSICAL_ADDRESS).isEqualTo(receivedParams >> 8);
+        assertThat(HdmiCecConstants.PLAYBACK_DEVICE_TYPE).isEqualTo(receivedParams & 0xFF);
     }
 
     /**
@@ -85,8 +86,7 @@
         hdmiCecClient.sendCecMessage(CecDevice.TV, CecMessage.GET_CEC_VERSION);
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV,
                                                             CecMessage.CEC_VERSION);
-
-        assertEquals(CEC_VERSION_NUMBER, hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isEqualTo(CEC_VERSION_NUMBER);
     }
 
     /**
@@ -99,7 +99,7 @@
         String message = hdmiCecClient.checkExpectedOutput(CecDevice.TV, CecMessage.FEATURE_ABORT);
         int abortedOpcode = hdmiCecClient.getParamsFromMessage(message,
                 CecMessage.GET_MENU_LANGUAGE.toString().length());
-        assertEquals(CecMessage.getMessage(abortedOpcode), CecMessage.GET_MENU_LANGUAGE);
+        assertThat(CecMessage.getMessage(abortedOpcode)).isEqualTo(CecMessage.GET_MENU_LANGUAGE);
     }
 
     private String getSystemLocale() throws Exception {
@@ -135,7 +135,7 @@
         try {
             hdmiCecClient.sendCecMessage(CecDevice.TV, CecDevice.BROADCAST,
                     CecMessage.SET_MENU_LANGUAGE, hdmiCecClient.convertStringToHexParams(language));
-            assertEquals(newLanguage, extractLanguage(getSystemLocale()));
+            assertThat(extractLanguage(getSystemLocale())).isEqualTo(newLanguage);
         } finally {
             setSystemLocale(locale);
         }
@@ -154,7 +154,7 @@
         try {
             hdmiCecClient.sendCecMessage(CecDevice.TV, CecDevice.BROADCAST,
                     CecMessage.SET_MENU_LANGUAGE, hdmiCecClient.convertStringToHexParams(language));
-            assertEquals(originalLanguage, extractLanguage(getSystemLocale()));
+            assertThat(extractLanguage(getSystemLocale())).isEqualTo(originalLanguage);
         } finally {
             setSystemLocale(locale);
         }
@@ -174,7 +174,7 @@
         try {
             hdmiCecClient.sendCecMessage(CecDevice.RECORDER_1, CecDevice.BROADCAST,
                     CecMessage.SET_MENU_LANGUAGE, hdmiCecClient.convertStringToHexParams(language));
-            assertEquals(originalLanguage, extractLanguage(getSystemLocale()));
+            assertThat(extractLanguage(getSystemLocale())).isEqualTo(originalLanguage);
         } finally {
             setSystemLocale(locale);
         }
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemStandbyTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemStandbyTest.java
index 1aa8fe4..983b501 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemStandbyTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecSystemStandbyTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -67,7 +67,7 @@
             hdmiCecClient.sendCecMessage(source, destination, CecMessage.STANDBY);
             TimeUnit.SECONDS.sleep(5);
             String wakeState = device.executeShellCommand("dumpsys power | grep mWakefulness=");
-            assertEquals("mWakefulness=Asleep", wakeState.trim());
+            assertThat(wakeState.trim()).isEqualTo("mWakefulness=Asleep");
         } finally {
             /* Wake up the device */
             device.executeShellCommand("input keyevent KEYCODE_WAKEUP");
diff --git a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecVendorCommandsTest.java b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecVendorCommandsTest.java
index df9bc5a..3dc1463 100644
--- a/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecVendorCommandsTest.java
+++ b/hostsidetests/hdmicec/src/android/hdmicec/cts/playback/HdmiCecVendorCommandsTest.java
@@ -16,7 +16,7 @@
 
 package android.hdmicec.cts.playback;
 
-import static org.junit.Assert.assertNotEquals;
+import static com.google.common.truth.Truth.assertThat;
 
 import android.hdmicec.cts.CecDevice;
 import android.hdmicec.cts.CecMessage;
@@ -51,7 +51,8 @@
         for (CecDevice cecDevice : CecDevice.values()) {
             hdmiCecClient.sendCecMessage(cecDevice, CecMessage.GIVE_DEVICE_VENDOR_ID);
             String message = hdmiCecClient.checkExpectedOutput(CecMessage.DEVICE_VENDOR_ID);
-            assertNotEquals(INCORRECT_VENDOR_ID, hdmiCecClient.getParamsFromMessage(message));
+            assertThat(hdmiCecClient.getParamsFromMessage(message)).
+                    isNotEqualTo(INCORRECT_VENDOR_ID);
         }
     }
 
@@ -66,6 +67,6 @@
         device.executeShellCommand("reboot");
         device.waitForBootComplete(HdmiCecConstants.REBOOT_TIMEOUT);
         String message = hdmiCecClient.checkExpectedOutput(CecMessage.DEVICE_VENDOR_ID);
-        assertNotEquals(INCORRECT_VENDOR_ID, hdmiCecClient.getParamsFromMessage(message));
+        assertThat(hdmiCecClient.getParamsFromMessage(message)).isNotEqualTo(INCORRECT_VENDOR_ID);
     }
 }
diff --git a/hostsidetests/rollback/Android.bp b/hostsidetests/rollback/Android.bp
index 817a339..99ac931 100644
--- a/hostsidetests/rollback/Android.bp
+++ b/hostsidetests/rollback/Android.bp
@@ -27,6 +27,7 @@
     static_libs: ["androidx.test.rules", "cts-rollback-lib", "cts-install-lib"],
     manifest : "app/AndroidManifest.xml",
     java_resources:  [
+        ":ApexKeyRotationTestV2_SignedBobRot",
         ":StagedInstallTestApexV2",
         ":StagedInstallTestApexV3",
     ],
diff --git a/hostsidetests/rollback/app/src/com/android/cts/rollback/host/app/HostTestHelper.java b/hostsidetests/rollback/app/src/com/android/cts/rollback/host/app/HostTestHelper.java
index 4faa965..0b4c644 100644
--- a/hostsidetests/rollback/app/src/com/android/cts/rollback/host/app/HostTestHelper.java
+++ b/hostsidetests/rollback/app/src/com/android/cts/rollback/host/app/HostTestHelper.java
@@ -47,6 +47,9 @@
 public class HostTestHelper {
     private static final String TAG = "RollbackTest";
 
+    private static final TestApp Apex2SignedBobRot = new TestApp(
+            "Apex2SignedBobRot", TestApp.Apex, 2, /*isApex*/true,
+            "com.android.apex.cts.shim.v2_signed_bob_rot.apex");
 
     /**
      * Adopts common permissions needed to test rollbacks.
@@ -158,8 +161,7 @@
      * Test rollbacks of staged installs involving only apex.
      * Install first version phase.
      *
-     * <p> We can't rollback to version 1, which is already installed, so we start by installing
-     * version 2. The test ultimately rolls back from 3 to 2.
+     * <p> We start by installing version 2. The test ultimately rolls back from 3 to 2.
      */
     @Test
     public void testApexOnlyInstallFirstVersion() throws Exception {
@@ -229,6 +231,42 @@
         // At this point, the host test driver will reboot the device to complete the uninstall.
     }
 
+    /**
+     * Test rollback to system version involving apex only
+     */
+    @Test
+    public void testApexOnlySystemVersion_EnableRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(1);
+        Install.single(TestApp.Apex2).setStaged().setEnableRollback().commit();
+    }
+
+    @Test
+    public void testApexOnlySystemVersion_CommitRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+        RollbackInfo available = RollbackUtils.getAvailableRollback(TestApp.Apex);
+        assertThat(available).isStaged();
+        assertThat(available).packagesContainsExactly(
+                Rollback.from(TestApp.Apex2).to(TestApp.Apex1));
+
+        RollbackUtils.rollback(available.getRollbackId(), TestApp.Apex2);
+        RollbackInfo committed = RollbackUtils.getCommittedRollbackById(available.getRollbackId());
+        assertThat(committed).isNotNull();
+        assertThat(committed).isStaged();
+        assertThat(committed).packagesContainsExactly(
+                Rollback.from(TestApp.Apex2).to(TestApp.Apex1));
+        assertThat(committed).causePackagesContainsExactly(TestApp.Apex2);
+        assertThat(committed.getCommittedSessionId()).isNotEqualTo(-1);
+
+        // Note: The app is not rolled back until after the rollback is staged
+        // and the device has been rebooted.
+        InstallUtils.waitForSessionReady(committed.getCommittedSessionId());
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+    }
+
+    @Test
+    public void testApexOnlySystemVersion_ConfirmRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(1);
+    }
 
     /**
      * Test rollbacks of staged installs involving apex and apk.
@@ -355,4 +393,41 @@
         assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(3);
         assertThat(RollbackUtils.getAvailableRollback(TestApp.Apex)).isNull();
     }
+
+    /**
+     * Test rollback with key downgrade for apex only
+     */
+    @Test
+    public void testApexKeyRotation_EnableRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(1);
+        Install.single(Apex2SignedBobRot).setStaged().setEnableRollback().commit();
+    }
+
+    @Test
+    public void testApexKeyRotation_CommitRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+        RollbackInfo available = RollbackUtils.getAvailableRollback(TestApp.Apex);
+        assertThat(available).isStaged();
+        assertThat(available).packagesContainsExactly(
+                Rollback.from(Apex2SignedBobRot).to(TestApp.Apex1));
+
+        RollbackUtils.rollback(available.getRollbackId(), Apex2SignedBobRot);
+        RollbackInfo committed = RollbackUtils.getCommittedRollbackById(available.getRollbackId());
+        assertThat(committed).isNotNull();
+        assertThat(committed).isStaged();
+        assertThat(committed).packagesContainsExactly(
+                Rollback.from(Apex2SignedBobRot).to(TestApp.Apex1));
+        assertThat(committed).causePackagesContainsExactly(Apex2SignedBobRot);
+        assertThat(committed.getCommittedSessionId()).isNotEqualTo(-1);
+
+        // Note: The app is not rolled back until after the rollback is staged
+        // and the device has been rebooted.
+        InstallUtils.waitForSessionReady(committed.getCommittedSessionId());
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+    }
+
+    @Test
+    public void testApexKeyRotation_CofirmRollback() throws Exception {
+        assertThat(InstallUtils.getInstalledVersion(TestApp.Apex)).isEqualTo(1);
+    }
 }
diff --git a/hostsidetests/rollback/src/com/android/cts/rollback/host/RollbackManagerHostTest.java b/hostsidetests/rollback/src/com/android/cts/rollback/host/RollbackManagerHostTest.java
index 942ee22..d453546 100644
--- a/hostsidetests/rollback/src/com/android/cts/rollback/host/RollbackManagerHostTest.java
+++ b/hostsidetests/rollback/src/com/android/cts/rollback/host/RollbackManagerHostTest.java
@@ -135,6 +135,20 @@
     }
 
     /**
+     * Tests staged rollbacks to system version involving only apex.
+     */
+    @Test
+    public void testApexOnlySystemVersionStagedRollback() throws Exception {
+        assumeTrue("Device does not support updating APEX", isApexUpdateSupported());
+
+        run("testApexOnlySystemVersion_EnableRollback");
+        getDevice().reboot();
+        run("testApexOnlySystemVersion_CommitRollback");
+        getDevice().reboot();
+        run("testApexOnlySystemVersion_ConfirmRollback");
+    }
+
+    /**
      * Tests staged rollbacks involving only apex.
      */
     @Test
@@ -165,4 +179,18 @@
         run("testApexRollbackExpirationConfirmExpiration");
     }
 
+    /**
+     * Tests staged rollbacks involving apex with rotated keys.
+     */
+    @Test
+    public void testApexKeyRotationStagedRollback() throws Exception {
+        assumeTrue("Device does not support updating APEX", isApexUpdateSupported());
+
+        run("testApexKeyRotation_EnableRollback");
+        getDevice().reboot();
+        run("testApexKeyRotation_CommitRollback");
+        getDevice().reboot();
+        run("testApexKeyRotation_CofirmRollback");
+    }
+
 }
diff --git a/hostsidetests/security/src/android/security/cts/KernelConfigTest.java b/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
index 719a90e..6829345 100644
--- a/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
+++ b/hostsidetests/security/src/android/security/cts/KernelConfigTest.java
@@ -226,6 +226,7 @@
         put("SDM429", null);
         put("SDM439", null);
         put("QM215", null);
+        put("BENGAL", new String[]{"CONFIG_HARDEN_BRANCH_PREDICTOR=y"});
         put("DEFAULT", new String[]{"CONFIG_HARDEN_BRANCH_PREDICTOR=y",
             "CONFIG_UNMAP_KERNEL_AT_EL0=y"});
     }};
diff --git a/hostsidetests/stagedinstall/Android.bp b/hostsidetests/stagedinstall/Android.bp
index 71be421..3d0d98a 100644
--- a/hostsidetests/stagedinstall/Android.bp
+++ b/hostsidetests/stagedinstall/Android.bp
@@ -50,6 +50,7 @@
         ":ApexKeyRotationTestV3_SignedBob",
         ":ApexKeyRotationTestV3_SignedBobRot",
         ":StagedInstallTestApexV1_NotPreInstalled",
+        ":StagedInstallTestApexV1",
         ":StagedInstallTestApexV2",
         ":StagedInstallTestApexV2_AdditionalFile",
         ":StagedInstallTestApexV2_AdditionalFolder",
@@ -109,6 +110,13 @@
 }
 
 prebuilt_apex {
+    name: "StagedInstallTestApexV1",
+    src: "testdata/apex/com.android.apex.cts.shim.v1.apex",
+    filename: "com.android.apex.cts.shim.v1.apex",
+    installable: false,
+}
+
+prebuilt_apex {
     name: "StagedInstallTestApexV2",
     src: "testdata/apex/com.android.apex.cts.shim.v2.apex",
     filename: "com.android.apex.cts.shim.v2.apex",
diff --git a/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/StagedInstallTest.java b/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/StagedInstallTest.java
index fa254b6..7e398ed 100644
--- a/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/StagedInstallTest.java
+++ b/hostsidetests/stagedinstall/app/src/com/android/tests/stagedinstall/StagedInstallTest.java
@@ -487,6 +487,21 @@
     }
 
     @Test
+    public void testInstallV2Apex_Commit() throws Exception {
+        int sessionId = stageSingleApk(TestApp.Apex2).assertSuccessful().getSessionId();
+        waitForIsReadyBroadcast(sessionId);
+        assertSessionReady(sessionId);
+        storeSessionId(sessionId);
+    }
+
+    @Test
+    public void testInstallV2Apex_VerifyPostReboot() throws Exception {
+        int sessionId = retrieveLastSessionId();
+        assertSessionApplied(sessionId);
+        assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+    }
+
+    @Test
     public void testInstallV2SignedBobApex_Commit() throws Exception {
         int sessionId = stageSingleApk(Apex2SignedBobRot).assertSuccessful().getSessionId();
         waitForIsReadyBroadcast(sessionId);
@@ -517,6 +532,21 @@
     }
 
     @Test
+    public void testInstallV3SignedBobApex_Commit() throws Exception {
+        int sessionId = stageSingleApk(Apex2SignedBobRot).assertSuccessful().getSessionId();
+        waitForIsReadyBroadcast(sessionId);
+        assertSessionReady(sessionId);
+        storeSessionId(sessionId);
+    }
+
+    @Test
+    public void testInstallV3SignedBobApex_VerifyPostReboot() throws Exception {
+        int sessionId = retrieveLastSessionId();
+        assertSessionApplied(sessionId);
+        assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+    }
+
+    @Test
     public void testStagedInstallDowngradeApex_DowngradeNotRequested_Fails_Commit()
             throws Exception {
         assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(3);
@@ -578,6 +608,25 @@
     }
 
     @Test
+    public void testStagedInstallDowngradeApexToSystemVersion_DebugBuild_Commit()
+            throws Exception {
+        assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
+        int sessionId = stageDowngradeSingleApk(TestApp.Apex1).assertSuccessful().getSessionId();
+        waitForIsReadyBroadcast(sessionId);
+        assertSessionReady(sessionId);
+        storeSessionId(sessionId);
+    }
+
+    @Test
+    public void testStagedInstallDowngradeApexToSystemVersion_DebugBuild_VerifyPostReboot()
+            throws Exception {
+        int sessionId = retrieveLastSessionId();
+        assertSessionApplied(sessionId);
+        // Apex should be downgraded.
+        assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(1);
+    }
+
+    @Test
     public void testInstallApex_DeviceDoesNotSupportApex_Fails() throws Exception {
         InstallUtils.commitExpectingFailure(IllegalArgumentException.class,
                 "This device doesn't support the installation of APEX files",
@@ -767,7 +816,6 @@
     // Once updated with a new rotated key (bob), further updates with old key (alice) should fail
     @Test
     public void testAfterRotationOldKeyIsRejected() throws Exception {
-        // Assume updateWithDifferentKey_Commit has been run already
         assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
         int sessionId = stageSingleApk(TestApp.Apex3).assertSuccessful().getSessionId();
         PackageInstaller.SessionInfo info =
@@ -779,7 +827,6 @@
     // Once updated with a new rotated key (bob), further updates with new key (bob) should pass
     @Test
     public void testAfterRotationNewKeyCanUpdateFurther_CommitPostReboot() throws Exception {
-        // Assume updateWithDifferentKey_Commit has been run already
         assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
         int sessionId = stageSingleApk(Apex3SignedBobRot).assertSuccessful().getSessionId();
         PackageInstaller.SessionInfo info =
@@ -797,7 +844,6 @@
     @Test
     public void testAfterRotationNewKeyCanUpdateFurtherWithoutLineage()
             throws Exception {
-        // Assume updateWithDifferentKey_Commit has been run already
         assertThat(getInstalledVersion(TestApp.Apex)).isEqualTo(2);
         int sessionId = stageSingleApk(Apex3SignedBob).assertSuccessful().getSessionId();
         PackageInstaller.SessionInfo info =
diff --git a/hostsidetests/stagedinstall/src/com/android/tests/stagedinstall/host/StagedInstallTest.java b/hostsidetests/stagedinstall/src/com/android/tests/stagedinstall/host/StagedInstallTest.java
index 0b63c51..398caea 100644
--- a/hostsidetests/stagedinstall/src/com/android/tests/stagedinstall/host/StagedInstallTest.java
+++ b/hostsidetests/stagedinstall/src/com/android/tests/stagedinstall/host/StagedInstallTest.java
@@ -268,6 +268,18 @@
 
     @Test
     @LargeTest
+    public void testStagedInstallDowngradeApexToSystemVersion_DebugBuild() throws Exception {
+        assumeThat(getDevice().getBuildFlavor(), not(endsWith("-user")));
+        assumeTrue("Device does not support updating APEX", isUpdatingApexSupported());
+
+        installV2Apex();
+        runPhase("testStagedInstallDowngradeApexToSystemVersion_DebugBuild_Commit");
+        getDevice().reboot();
+        runPhase("testStagedInstallDowngradeApexToSystemVersion_DebugBuild_VerifyPostReboot");
+    }
+
+    @Test
+    @LargeTest
     public void testInstallStagedApex_SameGrade() throws Exception {
         assumeTrue("Device does not support updating APEX", isUpdatingApexSupported());
 
@@ -282,6 +294,12 @@
         runPhase("testInstallApex_DeviceDoesNotSupportApex_Fails");
     }
 
+    private void installV2Apex()throws Exception {
+        runPhase("testInstallV2Apex_Commit");
+        getDevice().reboot();
+        runPhase("testInstallV2Apex_VerifyPostReboot");
+    }
+
     private void installV2SignedBobApex() throws Exception {
         runPhase("testInstallV2SignedBobApex_Commit");
         getDevice().reboot();
@@ -294,6 +312,12 @@
         runPhase("testInstallV3Apex_VerifyPostReboot");
     }
 
+    private void installV3SignedBobApex() throws Exception {
+        runPhase("testInstallV3SignedBobApex_Commit");
+        getDevice().reboot();
+        runPhase("testInstallV3SignedBobApex_VerifyPostReboot");
+    }
+
     @Test
     public void testFailsInvalidApexInstall() throws Exception {
         assumeTrue("Device does not support updating APEX", isUpdatingApexSupported());
@@ -301,7 +325,6 @@
         runPhase("testFailsInvalidApexInstall_AbandonSessionIsNoop");
     }
 
-
     @Test
     public void testStagedApkSessionCallbacks() throws Exception {
         runPhase("testStagedApkSessionCallbacks");
diff --git a/libs/install/src/com/android/cts/install/lib/TestApp.java b/libs/install/src/com/android/cts/install/lib/TestApp.java
index 1361ff2..fff8d9b 100644
--- a/libs/install/src/com/android/cts/install/lib/TestApp.java
+++ b/libs/install/src/com/android/cts/install/lib/TestApp.java
@@ -47,6 +47,9 @@
             "TestAppBv2.apk");
 
     // Apex collection
+    public static final TestApp Apex1 =
+            new TestApp("Apex1", Apex, 1, /*isApex*/true,
+                    "com.android.apex.cts.shim.v1.apex");
     public static final TestApp Apex2 =
             new TestApp("Apex2", Apex, 2, /*isApex*/true,
             "com.android.apex.cts.shim.v2.apex");
diff --git a/tests/app/src/android/app/cts/ActivityManagerTest.java b/tests/app/src/android/app/cts/ActivityManagerTest.java
index 8ac3a66..a9c99c7 100644
--- a/tests/app/src/android/app/cts/ActivityManagerTest.java
+++ b/tests/app/src/android/app/cts/ActivityManagerTest.java
@@ -42,11 +42,15 @@
 import android.test.InstrumentationTestCase;
 import android.util.Log;
 
+import com.android.compatibility.common.util.ShellIdentityUtils;
 import com.android.compatibility.common.util.SystemUtil;
 
 import java.io.IOException;
 import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashSet;
 import java.util.List;
+import java.util.Set;
 import java.util.function.Predicate;
 
 public class ActivityManagerTest extends InstrumentationTestCase {
@@ -73,6 +77,13 @@
             "com.android.cts.launchertests.LauncherAppsTests.CHAIN_EXIT_ACTION";
     // The action sent to identify the time track info.
     private static final String ACTIVITY_TIME_TRACK_INFO = "com.android.cts.TIME_TRACK_INFO";
+
+    private static final String MCC_TO_UPDATE = "987";
+    private static final String MNC_TO_UPDATE = "654";
+    private static final String SHELL_COMMAND_GET_CONFIG = "am get-config";
+    private static final String SHELL_COMMAND_RESULT_CONFIG_NAME_MCC = "mcc";
+    private static final String SHELL_COMMAND_RESULT_CONFIG_NAME_MNC = "mnc";
+
     // Return states of the ActivityReceiverFilter.
     public static final int RESULT_PASS = 1;
     public static final int RESULT_FAIL = 2;
@@ -417,6 +428,49 @@
         assertNotNull(conInf);
     }
 
+    public void testUpdateMccMncConfiguration() throws Exception {
+        // Store the original mcc mnc to set back
+        String[] mccMncConfigOriginal = new String[2];
+        // Store other configs to check they won't be affected
+        Set<String> otherConfigsOriginal = new HashSet<String>();
+        getMccMncConfigsAndOthers(mccMncConfigOriginal, otherConfigsOriginal);
+
+        String[] mccMncConfigToUpdate = new String[] {MCC_TO_UPDATE, MNC_TO_UPDATE};
+        boolean success = ShellIdentityUtils.invokeMethodWithShellPermissions(mActivityManager,
+                (am) -> am.updateMccMncConfiguration(mccMncConfigToUpdate[0],
+                        mccMncConfigToUpdate[1]));
+
+        if (success) {
+            String[] mccMncConfigUpdated = new String[2];
+            Set<String> otherConfigsUpdated = new HashSet<String>();
+            getMccMncConfigsAndOthers(mccMncConfigUpdated, otherConfigsUpdated);
+            // Check the mcc mnc are updated as expected
+            assertTrue(Arrays.equals(mccMncConfigToUpdate, mccMncConfigUpdated));
+            // Check other configs are not changed
+            assertTrue(otherConfigsOriginal.equals(otherConfigsUpdated));
+        }
+
+        // Set mcc mnc configs back in the end of the test
+        ShellIdentityUtils.invokeMethodWithShellPermissions(mActivityManager,
+                (am) -> am.updateMccMncConfiguration(mccMncConfigOriginal[0],
+                        mccMncConfigOriginal[1]));
+    }
+
+    private void getMccMncConfigsAndOthers(String[] mccMncConfigs, Set<String> otherConfigs)
+            throws Exception {
+        String[] configs = SystemUtil.runShellCommand(
+                mInstrumentation, SHELL_COMMAND_GET_CONFIG).split(" |\\-");
+        for (String config : configs) {
+            if (config.startsWith(SHELL_COMMAND_RESULT_CONFIG_NAME_MCC)) {
+                mccMncConfigs[0] = config.substring(SHELL_COMMAND_RESULT_CONFIG_NAME_MCC.length());
+            } else if (config.startsWith(SHELL_COMMAND_RESULT_CONFIG_NAME_MNC)) {
+                mccMncConfigs[1] = config.substring(SHELL_COMMAND_RESULT_CONFIG_NAME_MNC.length());
+            } else {
+                otherConfigs.add(config);
+            }
+        }
+    }
+
     /**
      * Simple test for {@link ActivityManager#isUserAMonkey()} - verifies its false.
      *
diff --git a/tests/framework/base/windowmanager/util/src/android/server/wm/ActivityManagerTestBase.java b/tests/framework/base/windowmanager/util/src/android/server/wm/ActivityManagerTestBase.java
index c99764e..ecce974 100644
--- a/tests/framework/base/windowmanager/util/src/android/server/wm/ActivityManagerTestBase.java
+++ b/tests/framework/base/windowmanager/util/src/android/server/wm/ActivityManagerTestBase.java
@@ -138,6 +138,7 @@
 import android.view.Display;
 import android.view.InputDevice;
 import android.view.MotionEvent;
+import android.view.ViewConfiguration;
 
 import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
@@ -492,6 +493,29 @@
         return ComponentName.unflattenFromString(mContext.getResources().getString(resId));
     }
 
+    /**
+     * Insert an input event (ACTION_DOWN -> ACTION_CANCEL) to ensures the display to be focused
+     * without triggering potential clicked to impact the test environment.
+     * (e.g: Keyguard credential activated unexpectedly.)
+     *
+     * @param displayId the display ID to gain focused by inject swipe action
+     */
+    protected void touchAndCancelOnDisplayCenter(int displayId) {
+        final DisplayManager dm = mContext.getSystemService(DisplayManager.class);
+        final Rect bounds = new Rect();
+        dm.getDisplay(displayId).getRectSize(bounds);
+        final int x = bounds.left + bounds.width() / 2;
+        final int y = bounds.top + bounds.height() / 2;
+        final long downTime = SystemClock.uptimeMillis();
+        injectMotion(downTime, downTime, MotionEvent.ACTION_DOWN, x, y, displayId);
+
+        final long eventTime = SystemClock.uptimeMillis();
+        final int touchSlop = ViewConfiguration.get(mContext).getScaledTouchSlop();
+        final int tapX = x + Math.round(touchSlop / 2.0f);
+        final int tapY = y + Math.round(touchSlop / 2.0f);
+        injectMotion(downTime, eventTime, MotionEvent.ACTION_CANCEL, tapX, tapY, displayId);
+    }
+
     protected void tapOnDisplay(int x, int y, int displayId) {
         final long downTime = SystemClock.uptimeMillis();
         injectMotion(downTime, downTime, MotionEvent.ACTION_DOWN, x, y, displayId);
@@ -1065,7 +1089,7 @@
         public LockScreenSession enterAndConfirmLockCredential() {
             // Ensure focus will switch to default display. Meanwhile we cannot tap on center area,
             // which may tap on input credential area.
-            tapOnDisplay(10, 10, DEFAULT_DISPLAY);
+            touchAndCancelOnDisplayCenter(DEFAULT_DISPLAY);
 
             waitForDeviceIdle(3000);
             SystemUtil.runWithShellPermissionIdentity(() ->
@@ -1110,7 +1134,7 @@
 
         LockScreenSession unlockDevice() {
             // Make sure the unlock button event is send to the default display.
-            tapOnDisplay(10, 10, DEFAULT_DISPLAY);
+            touchAndCancelOnDisplayCenter(DEFAULT_DISPLAY);
 
             pressUnlockButton();
             return this;
diff --git a/tests/signature/intent-check/DynamicConfig.xml b/tests/signature/intent-check/DynamicConfig.xml
index 6c7aace..71d846e 100644
--- a/tests/signature/intent-check/DynamicConfig.xml
+++ b/tests/signature/intent-check/DynamicConfig.xml
@@ -23,6 +23,7 @@
     Bug: 78574873 android.intent.action.INSTALL_EPHEMERAL_PACKAGE
     Bug: 78574873 android.intent.action.RESOLVE_EPHEMERAL_PACKAGE
     Bug: 78574873 android.intent.action.EPHEMERAL_RESOLVER_SETTINGS
+    Bug: 150153196 android.intent.action.LOAD_DATA // for Google Play
 -->
 <dynamicConfig>
     <entry key ="intent_whitelist">
@@ -34,5 +35,6 @@
       <value>android.intent.action.INSTALL_EPHEMERAL_PACKAGE</value>
       <value>android.intent.action.RESOLVE_EPHEMERAL_PACKAGE</value>
       <value>android.intent.action.EPHEMERAL_RESOLVER_SETTINGS</value>
+      <value>android.intent.action.LOAD_DATA</value>
     </entry>
 </dynamicConfig>
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/1/.hash b/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/1/.hash
index 9c76fef..425104b 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/1/.hash
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/1/.hash
@@ -1 +1 @@
-8d903ce236a40b41624907c4d1d7a651eca9f763  -
+d755ae773aaabd1c48d22b823e29501ee387aff1
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/2/.hash b/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/2/.hash
index ad2b69c3..fce7d03 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/2/.hash
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/aidl_api/libbinder_ndk_test_interface/2/.hash
@@ -1 +1 @@
-8359746d4317c0ef0f014821d362c4cfe96e2166  -
+3589e207cd708912b7551fb40b7fb263ef3e81b4
diff --git a/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp b/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
index cee0944..f4aa698 100644
--- a/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
+++ b/tests/tests/binder_ndk/libbinder_ndk_test/test_native_aidl_client.cpp
@@ -808,7 +808,7 @@
   EXPECT_OK(iface->getInterfaceHash(&res));
   if (GetParam().shouldBeOld) {
     // aidl_api/libbinder_ndk_test_interface/1/.hash
-    EXPECT_EQ("8d903ce236a40b41624907c4d1d7a651eca9f763", res);
+    EXPECT_EQ("d755ae773aaabd1c48d22b823e29501ee387aff1", res);
   } else {
     EXPECT_EQ("notfrozen", res);
   }
diff --git a/tests/tests/carrierapi/OWNERS b/tests/tests/carrierapi/OWNERS
index 619d676..cb54e00 100644
--- a/tests/tests/carrierapi/OWNERS
+++ b/tests/tests/carrierapi/OWNERS
@@ -1,5 +1,3 @@
 # Bug component: 20868
+include ../telephony/OWNERS
 yinxu@google.com
-hallliu@google.com
-mpq@google.com
-refuhoo@google.com
diff --git a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
index 13c6165..9b07ae9 100644
--- a/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
+++ b/tests/tests/jni/libjnitest/android_jni_cts_LinkerNamespacesTest.cpp
@@ -405,8 +405,6 @@
   // Check the runtime libraries.
   if (!check_path(env, clazz, kArtApexLibraryPath, {kArtApexLibraryPath},
                   runtime_public_libraries,
-                  // System.loadLibrary("icuuc") would fail since a copy exists in /system.
-                  // TODO(b/124218500): Change to true when the bug is resolved.
                   /*test_system_load_library=*/true,
                   check_absence, &errors)) {
     success = false;
diff --git a/tests/tests/net/ipsec/OWNERS b/tests/tests/net/ipsec/OWNERS
new file mode 100644
index 0000000..26407ff
--- /dev/null
+++ b/tests/tests/net/ipsec/OWNERS
@@ -0,0 +1,3 @@
+lorenzo@google.com
+nharold@google.com
+satk@google.com
diff --git a/tests/tests/net/src/android/net/cts/IpConfigurationTest.java b/tests/tests/net/src/android/net/cts/IpConfigurationTest.java
new file mode 100644
index 0000000..21be351
--- /dev/null
+++ b/tests/tests/net/src/android/net/cts/IpConfigurationTest.java
@@ -0,0 +1,151 @@
+/*
+ * Copyright (C) 2019 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.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+
+import android.net.IpConfiguration;
+import android.net.LinkAddress;
+import android.net.ProxyInfo;
+import android.net.StaticIpConfiguration;
+
+import androidx.test.runner.AndroidJUnit4;
+
+import libcore.net.InetAddressUtils;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import java.net.InetAddress;
+import java.util.ArrayList;
+
+@RunWith(AndroidJUnit4.class)
+public final class IpConfigurationTest {
+    private static final int TYPE_IPASSIGNMENT_STATIC = 0;
+    private static final int TYPE_IPASSIGNMENT_DHCP   = 1;
+
+    private static final int TYPE_PROXY_SETTINGS_NONE   = 0;
+    private static final int TYPE_PROXY_SETTINGS_STATIC = 1;
+    private static final int TYPE_PROXY_SETTINGS_PAC    = 2;
+
+    private static final LinkAddress LINKADDR = new LinkAddress("192.0.2.2/25");
+    private static final InetAddress GATEWAY = InetAddressUtils.parseNumericAddress("192.0.2.1");
+    private static final InetAddress DNS1 = InetAddressUtils.parseNumericAddress("8.8.8.8");
+    private static final InetAddress DNS2 = InetAddressUtils.parseNumericAddress("8.8.4.4");
+    private static final String DOMAINS = "example.com";
+
+    private static final ArrayList<InetAddress> dnsServers = new ArrayList<>();
+
+    private StaticIpConfiguration mStaticIpConfig;
+    private ProxyInfo mProxy;
+
+    @Before
+    public void setUp() {
+        dnsServers.add(DNS1);
+        dnsServers.add(DNS2);
+        mStaticIpConfig = new StaticIpConfiguration.Builder()
+                .setIpAddress(LINKADDR)
+                .setGateway(GATEWAY)
+                .setDnsServers(dnsServers)
+                .setDomains(DOMAINS)
+                .build();
+
+        mProxy = ProxyInfo.buildDirectProxy("test", 8888);
+    }
+
+    @Test
+    public void testConstructor() {
+        IpConfiguration ipConfig = new IpConfiguration();
+        checkEmpty(ipConfig);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration());
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_STATIC,
+                TYPE_PROXY_SETTINGS_PAC);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_STATIC,
+                TYPE_PROXY_SETTINGS_STATIC);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
+                TYPE_PROXY_SETTINGS_PAC);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
+                TYPE_PROXY_SETTINGS_STATIC);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+
+        ipConfig = createIpConfiguration(TYPE_IPASSIGNMENT_DHCP,
+                TYPE_PROXY_SETTINGS_NONE);
+        assertIpConfigurationEqual(ipConfig, new IpConfiguration(ipConfig));
+    }
+
+    private void checkEmpty(IpConfiguration config) {
+        assertEquals(IpConfiguration.IpAssignment.UNASSIGNED,
+                config.getIpAssignment().UNASSIGNED);
+        assertEquals(IpConfiguration.ProxySettings.UNASSIGNED,
+                config.getProxySettings().UNASSIGNED);
+        assertNull(config.getStaticIpConfiguration());
+        assertNull(config.getHttpProxy());
+    }
+
+    private IpConfiguration createIpConfiguration(int ipAssignmentType,
+            int proxySettingType) {
+
+        final IpConfiguration ipConfig = new IpConfiguration();
+
+        switch (ipAssignmentType) {
+            case TYPE_IPASSIGNMENT_STATIC:
+                ipConfig.setIpAssignment(IpConfiguration.IpAssignment.STATIC);
+                break;
+            case TYPE_IPASSIGNMENT_DHCP:
+                ipConfig.setIpAssignment(IpConfiguration.IpAssignment.DHCP);
+                break;
+            default:
+                throw new IllegalArgumentException("Unknown ip assignment type.");
+        }
+
+        switch (proxySettingType) {
+            case TYPE_PROXY_SETTINGS_NONE:
+                ipConfig.setProxySettings(IpConfiguration.ProxySettings.NONE);
+                break;
+            case TYPE_PROXY_SETTINGS_STATIC:
+                ipConfig.setProxySettings(IpConfiguration.ProxySettings.STATIC);
+                break;
+            case TYPE_PROXY_SETTINGS_PAC:
+                ipConfig.setProxySettings(IpConfiguration.ProxySettings.PAC);
+                break;
+            default:
+                throw new IllegalArgumentException("Unknown proxy setting type.");
+        }
+
+        ipConfig.setStaticIpConfiguration(mStaticIpConfig);
+        ipConfig.setHttpProxy(mProxy);
+
+        return ipConfig;
+    }
+
+    private void assertIpConfigurationEqual(IpConfiguration source, IpConfiguration target) {
+        assertEquals(source.getIpAssignment(), target.getIpAssignment());
+        assertEquals(source.getProxySettings(), target.getProxySettings());
+        assertEquals(source.getHttpProxy(), target.getHttpProxy());
+        assertEquals(source.getStaticIpConfiguration(), target.getStaticIpConfiguration());
+    }
+}
diff --git a/tests/tests/permission/src/android/permission/cts/SecureElementPermissionTest.java b/tests/tests/permission/src/android/permission/cts/SecureElementPermissionTest.java
index 5821582..1f49ac2 100644
--- a/tests/tests/permission/src/android/permission/cts/SecureElementPermissionTest.java
+++ b/tests/tests/permission/src/android/permission/cts/SecureElementPermissionTest.java
@@ -39,7 +39,7 @@
 public final class SecureElementPermissionTest {
     // Needed because SECURE_ELEMENT_PRIVILEGED_PERMISSION is a systemapi
     public static final String SECURE_ELEMENT_PRIVILEGED_PERMISSION =
-            "android.permission.SECURE_ELEMENT_PRIVILEGED";
+            "android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION";
 
     @Test
     public void testSecureElementPrivilegedPermission() {
@@ -63,8 +63,8 @@
                 .collect(Collectors.toList());
 
         if (nonSpecialPackages.size() > 1) {
-            fail("Only one app on the device is allowed to hold the SECURE_ELEMENT_PRIVILEGED " +
-                 "permission.");
+            fail("Only one app on the device is allowed to hold the " +
+                 "SECURE_ELEMENT_PRIVILEGED_OPERATION permission.");
         }
     }
 }
diff --git a/tests/tests/permission2/res/raw/android_manifest.xml b/tests/tests/permission2/res/raw/android_manifest.xml
index 613b3df..7135482 100644
--- a/tests/tests/permission2/res/raw/android_manifest.xml
+++ b/tests/tests/permission2/res/raw/android_manifest.xml
@@ -1568,6 +1568,10 @@
     <permission android:name="android.permission.NETWORK_FACTORY"
                 android:protectionLevel="signature" />
 
+    <!-- @SystemApi @hide Allows applications to access network stats provider -->
+    <permission android:name="android.permission.NETWORK_STATS_PROVIDER"
+                android:protectionLevel="signature" />
+
     <!-- Allows Settings and SystemUI to call methods in Networking services
          <p>Not for use by third-party or privileged applications.
          @hide This should only be used by Settings and SystemUI.
@@ -1713,7 +1717,7 @@
 
     <!-- @SystemApi Allows an internal user to use privileged SecureElement APIs.
          @hide -->
-    <permission android:name="android.permission.SECURE_ELEMENT_PRIVILEGED"
+    <permission android:name="android.permission.SECURE_ELEMENT_PRIVILEGED_OPERATION"
         android:protectionLevel="signature|privileged" />
 
     <!-- @SystemApi Allows an internal user to use privileged ConnectivityManager APIs.
diff --git a/tests/tests/telecom/src/android/telecom/cts/OutgoingCallTest.java b/tests/tests/telecom/src/android/telecom/cts/OutgoingCallTest.java
index 90a2e1b..8b2ff44 100644
--- a/tests/tests/telecom/src/android/telecom/cts/OutgoingCallTest.java
+++ b/tests/tests/telecom/src/android/telecom/cts/OutgoingCallTest.java
@@ -16,16 +16,21 @@
 
 package android.telecom.cts;
 
+import static android.telecom.Call.STATE_SELECT_PHONE_ACCOUNT;
+
 import android.content.Context;
 import android.media.AudioManager;
 import android.net.Uri;
 import android.os.Bundle;
+import android.telecom.Call;
 import android.telecom.CallAudioState;
 import android.telecom.Connection;
 import android.telecom.TelecomManager;
 import android.telephony.PhoneStateListener;
 import android.telephony.TelephonyManager;
 
+import com.android.compatibility.common.util.SystemUtil;
+
 import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.Executor;
 import java.util.concurrent.TimeUnit;
@@ -195,4 +200,34 @@
         assertEquals(TestUtils.TEST_PHONE_ACCOUNT_HANDLE_2, conn.getPhoneAccountHandle());
         conn.onDisconnect();
     }
+
+    public void testAccountSelectionAvailable() throws Exception {
+        if (!mShouldTestTelecom) {
+            return;
+        }
+
+        CountDownLatch latch = new CountDownLatch(1);
+        mInCallCallbacks = new MockInCallService.InCallServiceCallbacks() {
+            @Override
+            public void onCallAdded(Call call, int numCalls) {
+                if (call.getState() == STATE_SELECT_PHONE_ACCOUNT) {
+                    latch.countDown();
+                }
+            }
+        };
+        MockInCallService.setCallbacks(mInCallCallbacks);
+
+        mTelecomManager.registerPhoneAccount(TestUtils.TEST_PHONE_ACCOUNT);
+        TestUtils.enablePhoneAccount(getInstrumentation(), TestUtils.TEST_PHONE_ACCOUNT_HANDLE);
+        mTelecomManager.registerPhoneAccount(TestUtils.TEST_PHONE_ACCOUNT_2);
+        TestUtils.enablePhoneAccount(getInstrumentation(), TestUtils.TEST_PHONE_ACCOUNT_HANDLE_2);
+        SystemUtil.runWithShellPermissionIdentity(() -> {
+            mTelecomManager.setUserSelectedOutgoingPhoneAccount(null);
+        });
+
+        Uri testNumber = createTestNumber();
+        mTelecomManager.placeCall(testNumber, null);
+
+        assertTrue(latch.await(TestUtils.WAIT_FOR_CALL_ADDED_TIMEOUT_S, TimeUnit.SECONDS));
+    }
 }
diff --git a/tests/tests/telephony/OWNERS b/tests/tests/telephony/OWNERS
index d4ae5d0..c28e193 100644
--- a/tests/tests/telephony/OWNERS
+++ b/tests/tests/telephony/OWNERS
@@ -1,13 +1,16 @@
 # Bug component: 20868
 amitmahajan@google.com
+breadley@google.com
 fionaxu@google.com
 jackyu@google.com
+hallliu@google.com
 rgreenwalt@google.com
-refuhoo@google.com
+tgunn@google.com
 jminjie@google.com
 shuoq@google.com
-hallliu@google.com
-tgunn@google.com
-breadley@google.com
+refuhoo@google.com
 nazaninb@google.com
 sarahchin@google.com
+dbright@google.com
+xiaotonj@google.com
+
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/CbGeoUtilsTest.java b/tests/tests/telephony/current/src/android/telephony/cts/CbGeoUtilsTest.java
new file mode 100644
index 0000000..cf935f9
--- /dev/null
+++ b/tests/tests/telephony/current/src/android/telephony/cts/CbGeoUtilsTest.java
@@ -0,0 +1,89 @@
+/*
+ * Copyright (C) 2020 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.telephony.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import android.telephony.CbGeoUtils;
+
+import org.junit.Test;
+
+import java.util.ArrayList;
+
+public class CbGeoUtilsTest {
+
+    // latitude is in range -90, 90
+    private static final double LAT1 = 30;
+    // longitude is in range -180, 180
+    private static final double LNG1 = 100;
+
+    private static final double LAT2 = 10;
+    private static final double LNG2 = 120;
+
+    private static final double LAT3 = -10;
+    private static final double LNG3 = -90;
+
+    // distance in meters between (LAT1, LNG1) and (LAT2, LNG2)
+    private static final double DIST = 3040602;
+
+    // max allowed error in calculations
+    private static final double DELTA = 1;
+
+    @Test
+    public void testLatLong() {
+        CbGeoUtils.LatLng p1 = new CbGeoUtils.LatLng(LAT1, LNG1);
+        CbGeoUtils.LatLng p2 = new CbGeoUtils.LatLng(LAT2, LNG2);
+
+        CbGeoUtils.LatLng difference = new CbGeoUtils.LatLng(LAT1 - LAT2, LNG1 - LNG2);
+        assertEquals(difference.lat, p1.subtract(p2).lat, DELTA);
+        assertEquals(difference.lng, p1.subtract(p2).lng, DELTA);
+
+        assertEquals(DIST, p1.distance(p2), DELTA);
+    }
+
+    @Test
+    public void testPolygon() {
+        CbGeoUtils.LatLng p1 = new CbGeoUtils.LatLng(LAT1, LNG1);
+        CbGeoUtils.LatLng p2 = new CbGeoUtils.LatLng(LAT2, LNG2);
+        CbGeoUtils.LatLng p3 = new CbGeoUtils.LatLng(LAT3, LNG3);
+
+        ArrayList<CbGeoUtils.LatLng> vertices = new ArrayList<>();
+        vertices.add(p1);
+        vertices.add(p2);
+        vertices.add(p3);
+
+        CbGeoUtils.Polygon polygon = new CbGeoUtils.Polygon((vertices));
+        assertEquals(vertices, polygon.getVertices());
+
+        assertTrue(polygon.contains(p1));
+        assertTrue(polygon.contains(p2));
+        assertTrue(polygon.contains(p3));
+    }
+
+    @Test
+    public void testCircle() {
+        CbGeoUtils.LatLng p1 = new CbGeoUtils.LatLng(LAT1, LNG1);
+        double radius = 1000;
+        CbGeoUtils.Circle circle = new CbGeoUtils.Circle(p1, radius);
+
+        assertEquals(radius, circle.getRadius(), DELTA);
+        assertEquals(p1, circle.getCenter());
+        // circle should always contain its center
+        assertTrue(circle.contains(p1));
+    }
+}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsCbEtwsInfoTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbEtwsInfoTest.java
new file mode 100644
index 0000000..05cffda
--- /dev/null
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbEtwsInfoTest.java
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2009 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.telephony.cts;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.telephony.SmsCbEtwsInfo;
+
+import com.android.internal.telephony.gsm.SmsCbConstants;
+
+import org.junit.Test;
+
+public class SmsCbEtwsInfoTest {
+
+    private static final int TEST_ETWS_WARNING_TYPE =
+            SmsCbConstants.MESSAGE_ID_ETWS_OTHER_EMERGENCY_TYPE;
+
+    @Test
+    public void testIsPrimary() {
+        SmsCbEtwsInfo info = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, false, false, null);
+        assertFalse(info.isPrimary());
+
+        SmsCbEtwsInfo info2 = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, false, true, null);
+        assertTrue(info2.isPrimary());
+    }
+
+    @Test
+    public void testIsPopupAlert() {
+        SmsCbEtwsInfo info = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, false, false, null);
+        assertFalse(info.isPopupAlert());
+
+        SmsCbEtwsInfo info2 = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, true, false, null);
+        assertTrue(info2.isPopupAlert());
+    }
+
+    @Test
+    public void testIsEmergencyUserAlert() {
+        SmsCbEtwsInfo info = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, false, false, null);
+        assertFalse(info.isEmergencyUserAlert());
+
+        SmsCbEtwsInfo info2 = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                true, false, false, null);
+        assertTrue(info2.isEmergencyUserAlert());
+    }
+
+    @Test
+    public void testGetWarningType() {
+        SmsCbEtwsInfo info = new SmsCbEtwsInfo(TEST_ETWS_WARNING_TYPE,
+                false, false, false, null);
+        assertEquals(TEST_ETWS_WARNING_TYPE, info.getWarningType());
+    }
+}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsCbLocationTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbLocationTest.java
new file mode 100644
index 0000000..e4b219e
--- /dev/null
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbLocationTest.java
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2020 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.telephony.cts;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import android.telephony.SmsCbLocation;
+
+import org.junit.Test;
+
+public class SmsCbLocationTest {
+    private static final String PLMN = "TEST_PLMN";
+    private static final String PLMN2 = "TEST_PLMN 2";
+    private static final int LAC = -1;
+    private static final int CID = -1;
+
+    @Test
+    public void testIsInLocationArea() {
+        SmsCbLocation cbLocation = new SmsCbLocation(PLMN, LAC, CID);
+
+        SmsCbLocation area = new SmsCbLocation(PLMN, LAC, CID);
+        assertTrue(cbLocation.isInLocationArea(area));
+
+        SmsCbLocation area2 = new SmsCbLocation(PLMN2, LAC, CID);
+        assertFalse(cbLocation.isInLocationArea(area2));
+    }
+}
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SmsCbMessageTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbMessageTest.java
index c74332c..6b2ddbb 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SmsCbMessageTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SmsCbMessageTest.java
@@ -18,8 +18,13 @@
 package android.telephony.cts;
 
 import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
+import static org.mockito.ArgumentMatchers.eq;
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.mock;
 
 import android.content.ContentValues;
+import android.database.Cursor;
 import android.provider.Telephony;
 import android.telephony.CbGeoUtils;
 import android.telephony.SmsCbCmasInfo;
@@ -61,7 +66,7 @@
 
     private static final int TEST_MAX_WAIT_TIME = 0;
     private static final List<CbGeoUtils.Geometry> TEST_GEOS = new ArrayList<>();
-    private static final int TEST_RECEIVED_TIME = 11000;
+    private static final long TEST_RECEIVED_TIME = 11000;
     private static final int TEST_SLOT = 0;
     private static final int TEST_SUB_ID = 1;
 
@@ -229,4 +234,78 @@
         int serial = cv.getAsInteger(Telephony.CellBroadcasts.SERIAL_NUMBER);
         assertEquals(TEST_SERIAL, serial);
     }
+
+    @Test
+    public void testCreateFromCursor() {
+        Cursor cursor = mock(Cursor.class);
+        doReturn(0).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.GEOGRAPHICAL_SCOPE));
+        doReturn(TEST_GEO_SCOPE).when(cursor).getInt(0);
+
+        doReturn(1).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.SERIAL_NUMBER));
+        doReturn(TEST_SERIAL).when(cursor).getInt(1);
+
+        doReturn(2).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.SERVICE_CATEGORY));
+        doReturn(TEST_SERVICE_CATEGORY).when(cursor).getInt(2);
+
+        doReturn(3).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.LANGUAGE_CODE));
+        doReturn(TEST_LANGUAGE).when(cursor).getString(3);
+
+        doReturn(4).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.MESSAGE_BODY));
+        doReturn(TEST_BODY).when(cursor).getString(4);
+
+        doReturn(5).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.MESSAGE_FORMAT));
+        doReturn(TEST_MESSAGE_FORMAT).when(cursor).getInt(5);
+
+        doReturn(6).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.MESSAGE_PRIORITY));
+        doReturn(TEST_PRIORITY).when(cursor).getInt(6);
+
+        doReturn(7).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.SLOT_INDEX));
+        doReturn(TEST_SLOT).when(cursor).getInt(7);
+
+        doReturn(8).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.SUBSCRIPTION_ID));
+        doReturn(TEST_SUB_ID).when(cursor).getInt(8);
+
+        doReturn(-1).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.PLMN));
+
+        doReturn(-1).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.LAC));
+
+        doReturn(-1).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.CID));
+
+        doReturn(-1).when(cursor).getColumnIndex(eq(
+                Telephony.CellBroadcasts.ETWS_WARNING_TYPE));
+
+        doReturn(-1).when(cursor).getColumnIndex(eq(
+                Telephony.CellBroadcasts.CMAS_MESSAGE_CLASS));
+
+        doReturn(9).when(cursor).getColumnIndex(eq(
+                Telephony.CellBroadcasts.GEOMETRIES));
+        // return empty string here to be parsed into empty array list
+        doReturn("").when(cursor).getString(9);
+
+        doReturn(10).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.RECEIVED_TIME));
+        doReturn(TEST_RECEIVED_TIME).when(cursor).getLong(10);
+
+        doReturn(11).when(cursor).getColumnIndexOrThrow(eq(
+                Telephony.CellBroadcasts.MAXIMUM_WAIT_TIME));
+        doReturn(TEST_MAX_WAIT_TIME).when(cursor).getInt(11);
+
+        SmsCbMessage cbMessage = SmsCbMessage.createFromCursor(cursor);
+        assertEquals(TEST_SERIAL, cbMessage.getSerialNumber());
+        assertEquals(TEST_BODY, cbMessage.getMessageBody());
+        assertNull(cbMessage.getEtwsWarningInfo());
+        assertNull(cbMessage.getCmasWarningInfo());
+    }
 }
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
index 718f261..72ac137 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
@@ -32,6 +32,7 @@
 
 import android.annotation.Nullable;
 import android.content.pm.PackageManager;
+import android.content.res.Resources;
 import android.net.ConnectivityManager;
 import android.net.ConnectivityManager.NetworkCallback;
 import android.net.Network;
@@ -184,6 +185,17 @@
     }
 
     @Test
+    public void testGetResourcesForSubId() {
+        if (!isSupported()) return;
+        Resources r = ShellIdentityUtils.invokeMethodWithShellPermissions(mSm,
+                (sm) -> sm.getResourcesForSubId(InstrumentationRegistry.getContext(), mSubId));
+        // this is an old method which returns mcc/mnc as ints, so use the old SM.getMcc/Mnc methods
+        // because they also use ints
+        assertEquals(mSm.getActiveSubscriptionInfo(mSubId).getMcc(), r.getConfiguration().mcc);
+        assertEquals(mSm.getActiveSubscriptionInfo(mSubId).getMnc(), r.getConfiguration().mnc);
+    }
+
+    @Test
     public void testIsUsableSubscriptionId() throws Exception {
         if (!isSupported()) return;
         assertTrue(SubscriptionManager.isUsableSubscriptionId(mSubId));
@@ -664,73 +676,48 @@
         if (!isSupported()) return;
         int preferredSubId = executeWithShellPermissionAndDefault(-1, mSm,
                 (sm) -> sm.getPreferredDataSubscriptionId());
+        if (preferredSubId != SubscriptionManager.DEFAULT_SUBSCRIPTION_ID) {
+            // Make sure to switch back to primary/default data sub first.
+            setPreferredDataSubId(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID);
+        }
 
-        final LinkedBlockingQueue<Integer> resultQueue = new LinkedBlockingQueue<>(1);
-        Executor executor = new Executor() {
-            @Override
-            public void execute(Runnable command) {
-                command.run();
-            }
-        };
-
-        Consumer<Integer> consumer = new Consumer<Integer>() {
-            @Override
-            public void accept(Integer res) {
-                if (res == null) {
-                    resultQueue.offer(-1);
-                } else {
-                    resultQueue.offer(res);
-                }
-            }
-        };
-
-        List<SubscriptionInfo> subscriptionInfos = mSm.getActiveSubscriptionInfoList();
-        boolean changes = false;
+        List<SubscriptionInfo> subscriptionInfos = mSm.getActiveAndHiddenSubscriptionInfoList();
 
         for (SubscriptionInfo subInfo : subscriptionInfos) {
-            int subId = subInfo.getSubscriptionId();
-            if (subId != preferredSubId) {
-                int newPreferredSubId = subId;
-                // Change to a new value.
-                ShellIdentityUtils.invokeMethodWithShellPermissionsNoReturn(mSm,
-                        (sm) -> sm.setPreferredDataSubscriptionId(newPreferredSubId, false,
-                                executor, consumer));
-                int res = -1;
-                try {
-                    res = resultQueue.poll(2, TimeUnit.SECONDS);
-                } catch (InterruptedException e) {
-                    fail("Cannot get the modem result in time");
-                }
-                assertEquals(SET_OPPORTUNISTIC_SUB_SUCCESS, res);
-                int newGetValue = executeWithShellPermissionAndDefault(-1, mSm,
-                        (sm) -> sm.getPreferredDataSubscriptionId());
-                assertEquals(newPreferredSubId, newGetValue);
-                changes = true;
-                break;
-            }
+            // Only test on opportunistic subscriptions.
+            if (!subInfo.isOpportunistic()) continue;
+            setPreferredDataSubId(subInfo.getSubscriptionId());
         }
 
-        // Reset back, or set the duplicate.
-        if (SubscriptionManager.isValidSubscriptionId(preferredSubId)) {
-            ShellIdentityUtils.invokeMethodWithShellPermissionsNoReturn(mSm,
-                    (sm) -> sm.setPreferredDataSubscriptionId(preferredSubId, false,
-                            executor, consumer));
-            int res = -1;
-            try {
-                res = resultQueue.poll(2, TimeUnit.SECONDS);
-            } catch (InterruptedException e) {
-                fail("Cannot get the modem result in time");
-            }
-            // Duplicate setting ends up with nothing.
-            if (!changes) {
-                assertEquals(-1, res);
+        // Switch data back to previous preferredSubId.
+        setPreferredDataSubId(preferredSubId);
+    }
+
+    private void setPreferredDataSubId(int subId) {
+        final LinkedBlockingQueue<Integer> resultQueue = new LinkedBlockingQueue<>(1);
+        Executor executor = (command)-> command.run();
+        Consumer<Integer> consumer = (res)-> {
+            if (res == null) {
+                resultQueue.offer(-1);
             } else {
-                assertEquals(SET_OPPORTUNISTIC_SUB_SUCCESS, res);
-                int resetGetValue = executeWithShellPermissionAndDefault(-1, mSm,
-                        (sm) -> sm.getPreferredDataSubscriptionId());
-                assertEquals(resetGetValue, preferredSubId);
+                resultQueue.offer(res);
             }
+        };
+
+        ShellIdentityUtils.invokeMethodWithShellPermissionsNoReturn(mSm,
+                (sm) -> sm.setPreferredDataSubscriptionId(subId, false,
+                        executor, consumer));
+        int res = -1;
+        try {
+            res = resultQueue.poll(2, TimeUnit.SECONDS);
+        } catch (InterruptedException e) {
+            fail("Cannot get the modem result in time");
         }
+
+        assertEquals(SET_OPPORTUNISTIC_SUB_SUCCESS, res);
+        int getValue = executeWithShellPermissionAndDefault(-1, mSm,
+                (sm) -> sm.getPreferredDataSubscriptionId());
+        assertEquals(subId, getValue);
     }
 
     private <T, U> T executeWithShellPermissionAndDefault(T defaultValue, U targetObject,
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
index 2eaa060..64df0ce 100644
--- a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyManagerTest.java
@@ -45,6 +45,7 @@
 import android.os.IBinder;
 import android.os.Looper;
 import android.os.PersistableBundle;
+import android.os.Process;
 import android.os.RemoteException;
 import android.telecom.PhoneAccount;
 import android.telecom.PhoneAccountHandle;
@@ -517,12 +518,24 @@
         mTelephonyManager.getSubscriptionId(defaultAccount);
         mTelephonyManager.getCarrierConfig();
         ShellIdentityUtils.invokeMethodWithShellPermissions(mTelephonyManager,
-                (tm) -> tm.isDataConnectionEnabled());
+                (tm) -> tm.isDataConnectionAllowed());
         ShellIdentityUtils.invokeMethodWithShellPermissions(mTelephonyManager,
                 (tm) -> tm.isAnyRadioPoweredOn());
         ShellIdentityUtils.invokeMethodWithShellPermissionsNoReturn(mTelephonyManager,
                 (tm) -> tm.resetIms(tm.getSlotIndex()));
 
+        // Verify TelephonyManager.getCarrierPrivilegeStatus
+        List<Integer> validCarrierPrivilegeStatus = new ArrayList<>();
+        validCarrierPrivilegeStatus.add(TelephonyManager.CARRIER_PRIVILEGE_STATUS_HAS_ACCESS);
+        validCarrierPrivilegeStatus.add(TelephonyManager.CARRIER_PRIVILEGE_STATUS_NO_ACCESS);
+        validCarrierPrivilegeStatus.add(
+                TelephonyManager.CARRIER_PRIVILEGE_STATUS_RULES_NOT_LOADED);
+        validCarrierPrivilegeStatus.add(
+                TelephonyManager.CARRIER_PRIVILEGE_STATUS_ERROR_LOADING_RULES);
+        int carrierPrivilegeStatusResult = ShellIdentityUtils.invokeMethodWithShellPermissions(
+                mTelephonyManager, (tm) -> tm.getCarrierPrivilegeStatus(Process.myUid()));
+        assertTrue(validCarrierPrivilegeStatus.contains(carrierPrivilegeStatusResult));
+
         // Verify TelephonyManager.getCarrierPrivilegedPackagesForAllActiveSubscriptions
         List<String> resultForGetCarrierPrivilegedApis =
                 ShellIdentityUtils.invokeMethodWithShellPermissions(mTelephonyManager,
@@ -2323,6 +2336,16 @@
     }
 
     @Test
+    public void testIsDataCapableExists() {
+        if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
+            return;
+        }
+
+        //Simple test to make sure that isDataCapable exists and does not crash.
+        mTelephonyManager.isDataCapable();
+    }
+
+    @Test
     public void testDisAllowedNetworkTypes() {
         if (!mPackageManager.hasSystemFeature(PackageManager.FEATURE_TELEPHONY)) {
             return;
@@ -2576,3 +2599,4 @@
     }
 }
 
+
diff --git a/tests/tests/telephony/current/src/android/telephony/cts/TelephonyProtectedBroadcastsTest.java b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyProtectedBroadcastsTest.java
new file mode 100644
index 0000000..fedd639
--- /dev/null
+++ b/tests/tests/telephony/current/src/android/telephony/cts/TelephonyProtectedBroadcastsTest.java
@@ -0,0 +1,80 @@
+/*
+ * Copyright (C) 2020 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.telephony.cts;
+
+import static org.junit.Assert.fail;
+
+import android.content.Context;
+import android.content.Intent;
+
+import androidx.test.InstrumentationRegistry;
+
+import org.junit.Test;
+
+
+public class TelephonyProtectedBroadcastsTest {
+    private static final String[] BACKGROUND_BROADCASTS = new String[] {
+            "android.intent.action.ACTION_DEFAULT_DATA_SUBSCRIPTION_CHANGED",
+            "android.intent.action.ACTION_DEFAULT_VOICE_SUBSCRIPTION_CHANGED",
+            "android.intent.action.DATA_SMS_RECEIVED",
+            "android.provider.Telephony.SECRET_CODE",
+            "android.provider.Telephony.SMS_CB_RECEIVED",
+            "android.provider.Telephony.SMS_DELIVER",
+            "android.provider.Telephony.SMS_RECEIVED",
+            "android.provider.Telephony.SMS_REJECTED",
+            "android.provider.Telephony.WAP_PUSH_DELIVER",
+            "android.provider.Telephony.WAP_PUSH_RECEIVED",
+            "android.telephony.action.CARRIER_CONFIG_CHANGED",
+            "android.telephony.action.DEFAULT_SMS_SUBSCRIPTION_CHANGED",
+            "android.telephony.action.DEFAULT_SUBSCRIPTION_CHANGED",
+            "android.telephony.action.SECRET_CODE",
+            "android.telephony.action.SIM_APPLICATION_STATE_CHANGED",
+            "android.telephony.action.SIM_CARD_STATE_CHANGED",
+            "android.telephony.action.SIM_SLOT_STATUS_CHANGED",
+    };
+
+    @Test
+    public void testBroadcasts() {
+        StringBuilder errorMessage = new StringBuilder(); //Fail on all missing broadcasts
+        for (String action : BACKGROUND_BROADCASTS) {
+            try {
+                Intent intent = new Intent(action);
+                getContext().sendBroadcast(intent);
+
+                //Add error message because no security exception was thrown.
+                if (errorMessage.length() == 0) {
+                    errorMessage.append("--- Expected security exceptions when broadcasting on the "
+                            + "following actions:");
+                    errorMessage.append(System.lineSeparator());
+                }
+                errorMessage.append(action);
+                errorMessage.append(System.lineSeparator());
+
+            } catch (SecurityException expected) {
+            }
+        }
+
+        if (errorMessage.length() > 0) {
+            errorMessage.append("------------------------------------------------------------");
+            errorMessage.append(System.lineSeparator());
+            fail(errorMessage.toString());
+        }
+    }
+
+    private static Context getContext() {
+        return InstrumentationRegistry.getContext();
+    }
+}
diff --git a/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccManagerTest.java b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccManagerTest.java
index 59bb882..feda07b 100644
--- a/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccManagerTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccManagerTest.java
@@ -239,6 +239,44 @@
                 mCallbackReceiver.getResultCode());
     }
 
+    @Test
+    public void testOperationCode() {
+        // Ensure if platform source code is updated, these constants stays the same.
+        assertEquals(EuiccManager.OPERATION_SYSTEM, 1);
+        assertEquals(EuiccManager.OPERATION_SIM_SLOT, 2);
+        assertEquals(EuiccManager.OPERATION_EUICC_CARD, 3);
+        assertEquals(EuiccManager.OPERATION_SWITCH, 4);
+        assertEquals(EuiccManager.OPERATION_DOWNLOAD, 5);
+        assertEquals(EuiccManager.OPERATION_METADATA, 6);
+        assertEquals(EuiccManager.OPERATION_EUICC_GSMA, 7);
+        assertEquals(EuiccManager.OPERATION_APDU, 8);
+        assertEquals(EuiccManager.OPERATION_SMDX, 9);
+        assertEquals(EuiccManager.OPERATION_SMDX_SUBJECT_REASON_CODE, 10);
+        assertEquals(EuiccManager.OPERATION_HTTP, 11);
+    }
+
+    @Test
+    public void testErrorCode() {
+        // Ensure if platform source code is updated, these constants stays the same.
+        assertEquals(EuiccManager.ERROR_CARRIER_LOCKED, 10000);
+        assertEquals(EuiccManager.ERROR_INVALID_ACTIVATION_CODE, 10001);
+        assertEquals(EuiccManager.ERROR_INVALID_CONFIRMATION_CODE, 10002);
+        assertEquals(EuiccManager.ERROR_INCOMPATIBLE_CARRIER, 10003);
+        assertEquals(EuiccManager.ERROR_EUICC_INSUFFICIENT_MEMORY, 10004);
+        assertEquals(EuiccManager.ERROR_TIME_OUT, 10005);
+        assertEquals(EuiccManager.ERROR_EUICC_MISSING, 10006);
+        assertEquals(EuiccManager.ERROR_UNSUPPORTED_VERSION, 10007);
+        assertEquals(EuiccManager.ERROR_SIM_MISSING, 10008);
+        assertEquals(EuiccManager.ERROR_INSTALL_PROFILE, 10009);
+        assertEquals(EuiccManager.ERROR_DISALLOWED_BY_PPR, 10010);
+        assertEquals(EuiccManager.ERROR_ADDRESS_MISSING, 10011);
+        assertEquals(EuiccManager.ERROR_CERTIFICATE_ERROR, 10012);
+        assertEquals(EuiccManager.ERROR_NO_PROFILES_AVAILABLE, 10013);
+        assertEquals(EuiccManager.ERROR_CONNECTION_ERROR, 10014);
+        assertEquals(EuiccManager.ERROR_INVALID_RESPONSE, 10015);
+        assertEquals(EuiccManager.ERROR_OPERATION_BUSY, 10016);
+    }
+
     private Context getContext() {
         return InstrumentationRegistry.getContext();
     }
diff --git a/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccServiceTest.java b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccServiceTest.java
index aa60c8e..c506e8e6 100644
--- a/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccServiceTest.java
+++ b/tests/tests/telephony/current/src/android/telephony/euicc/cts/EuiccServiceTest.java
@@ -74,16 +74,84 @@
 
     private IEuiccService mEuiccServiceBinder;
     private IMockEuiccServiceCallback mCallback;
+    private TestEuiccService mEuiccService;
 
     private CountDownLatch mCountDownLatch;
 
     @Rule public ServiceTestRule mServiceTestRule = new ServiceTestRule();
 
+    private static class TestEuiccService extends EuiccService {
+        @Override
+        public String onGetEid(int slotId) {
+            return null;
+        }
+
+        @Override
+        public int onGetOtaStatus(int slotId) {
+            return 0;
+        }
+
+        @Override
+        public void onStartOtaIfNecessary(int slotId,
+                OtaStatusChangedCallback statusChangedCallback) {
+        }
+
+        @Override
+        public GetDownloadableSubscriptionMetadataResult onGetDownloadableSubscriptionMetadata(
+                int slotId, DownloadableSubscription subscription, boolean forceDeactivateSim) {
+            return null;
+        }
+
+        @Override
+        public GetDefaultDownloadableSubscriptionListResult
+                onGetDefaultDownloadableSubscriptionList(
+                int slotId, boolean forceDeactivateSim) {
+            return null;
+        }
+
+        @Override
+        public GetEuiccProfileInfoListResult onGetEuiccProfileInfoList(int slotId) {
+            return null;
+        }
+
+        @Override
+        public EuiccInfo onGetEuiccInfo(int slotId) {
+            return null;
+        }
+
+        @Override
+        public int onDeleteSubscription(int slotId, String iccid) {
+            return 0;
+        }
+
+        @Override
+        public int onSwitchToSubscription(int slotId, String iccid, boolean forceDeactivateSim) {
+            return 0;
+        }
+
+        @Override
+        public int onUpdateSubscriptionNickname(int slotId, String iccid, String nickname) {
+            return 0;
+        }
+
+        @Override
+        public int onEraseSubscriptions(int slotId) {
+            return 0;
+        }
+
+        @Override
+        public int onRetainSubscriptionsForFactoryReset(int slotId) {
+            return 0;
+        }
+    }
+
     @Before
     public void setUp() throws Exception {
         mCallback = new MockEuiccServiceCallback();
         MockEuiccService.setCallback(mCallback);
 
+        mEuiccService = new TestEuiccService();
+
         Intent mockServiceIntent = new Intent(getContext(), MockEuiccService.class);
         IBinder binder = mServiceTestRule.bindService(mockServiceIntent);
         mEuiccServiceBinder = IEuiccService.Stub.asInterface(binder);
@@ -454,4 +522,12 @@
 
         assertTrue(mCallback.isMethodCalled());
     }
+
+    @Test
+    public void testEncodeSmdxSubjectAndReasonCode() {
+        assertEquals(mEuiccService.encodeSmdxSubjectAndReasonCode("8.11.1", "5.1.1"), 0xA8B1511);
+        assertEquals(mEuiccService.encodeSmdxSubjectAndReasonCode("1", "1"), 0xA001001);
+        assertEquals(mEuiccService.encodeSmdxSubjectAndReasonCode("3.0.1", "5.1"), 0xA301051);
+        assertEquals(mEuiccService.encodeSmdxSubjectAndReasonCode("8.1", "5"), 0xA081005);
+    }
 }
diff --git a/tests/tests/telephonyprovider/OWNERS b/tests/tests/telephonyprovider/OWNERS
index 7f7694d..31dc9e1 100644
--- a/tests/tests/telephonyprovider/OWNERS
+++ b/tests/tests/telephonyprovider/OWNERS
@@ -1,3 +1,2 @@
 # Bug component: 450841
 include ../telephony/OWNERS
-lelandmiller@google.com