Merge "Add strings for the install app banner in cross profile settings" into rvc-dev
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 8c837cb..656bf55 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3812,6 +3812,12 @@
     <!-- Bluetooth Tethering settings.  Message for untethering from a bluetooth device [CHAR LIMIT=50]-->
     <string name="bluetooth_untether_blank"><xliff:g id="device_name">%1$s</xliff:g> will be untethered.</string>
 
+    <!-- Ethernet Tethering settings-->
+    <!-- Label for ethernet tether checkbox [CHAR LIMIT=25]-->
+    <string name="ethernet_tether_checkbox_text">Ethernet tethering</string>
+    <!-- Ethernet Tethering subtext [CHAR LIMIT=70]-->
+    <string name="ethernet_tethering_subtext" product="default">Share phone\u2019s internet connection via USB Ethernet</string>
+
     <!-- Tethering footer info [CHAR LIMIT=NONE]-->
     <string name="tethering_footer_info">Use hotspot and tethering to provide internet to other devices through your mobile data connection. Apps can also create a hotspot to share content with nearby devices.</string>
     <!-- Tethering footer info for the device which supports Wi-Fi and Wi-Fi tethering enabled at the same time [CHAR LIMIT=NONE]-->
@@ -7005,7 +7011,7 @@
     <string name="apps_with_restrictions_settings_button">Expand settings for application</string>
 
     <!-- NFC payment settings --><skip/>
-    <string name="nfc_payment_settings_title">Tap &amp; pay</string>
+    <string name="nfc_payment_settings_title">Contactless payments</string>
     <!-- Caption for button linking to a page explaining how Tap and Pay works-->
     <string name="nfc_payment_how_it_works">How it works</string>
     <!-- String shown when there are no NFC payment applications installed -->
@@ -8181,6 +8187,24 @@
     <!-- Button to cancel out of the dialog shown when the user has disabled bubbles at the feature level but tries to enable it for an app. [CHAR LIMIT=60] -->
     <string name="bubbles_feature_disabled_button_cancel">Cancel</string>
 
+    <!-- Bubble feature settings: Description for toggle when bubbles are turned on in notification settings [CHAR LIMIT=100] -->
+    <string name="notifications_bubble_setting_on_summary">On / Conversations can appear as floating icons</string>
+    <!-- Bubble feature settings: Title of the toggle to turn bubbles on and off [CHAR LIMIT=100] -->
+    <string name="notifications_bubble_setting_title">Allow apps to show bubbles</string>
+    <!-- Bubble feature settings: Description shown with the toggle to turn bubbles on and off [CHAR LIMIT=NONE]-->
+    <string name="notifications_bubble_setting_description">Some conversations will appear as floating icons on top of other apps</string>
+
+    <!-- Bubble app settings: option allowing all conversations from an app to bubble if the app sends bubbles [CHAR LIMIT=60]-->
+    <string name="bubble_app_setting_all">All conversations can bubble</string>
+    <!-- Bubble app settings: option allowing only user selected conversations from an app to bubble if the app sends bubbles [CHAR LIMIT=60] -->
+    <string name="bubble_app_setting_selected">Selected conversations can bubble</string>
+    <!-- Bubble app settings: option allowing no bubbles from the app [CHAR LIMIT=60] -->
+    <string name="bubble_app_setting_none">Nothing can bubble</string>
+    <!-- Bubble app settings: Title above a list of conversations that have been selected to bubble [CHAR LIMIT=60]-->
+    <string name="bubble_app_setting_selected_conversation_title">Conversations</string>
+    <!-- Bubble app settings: Title above a list of conversations that have been excluded from bubbling [CHAR LIMIT=60] -->
+    <string name="bubble_app_setting_excluded_conversation_title">Excluded</string>
+
     <!-- Configure notifications: title for swipe direction [CHAR LIMIT=60] -->
     <string name="swipe_direction_title">Swipe actions</string>
 
@@ -9796,7 +9820,7 @@
     <!-- Label for setting which controls whether app can display over other apps [CHAR LIMIT=45] -->
     <string name="permit_draw_overlay">Allow display over other apps</string>
     <!-- Description of allowing overlay setting [CHAR LIMIT=NONE] -->
-    <string name="allow_overlay_description">Allow this app to display on top of other apps you\u2019re using. It may interfere with your use of those apps or change the way they seem to appear or behave.</string>
+    <string name="allow_overlay_description">Allow this app to display on top of other apps you\u2019re using. This app will be able to see where you tap or change what\u2019s displayed on the screen.</string>
 
     <!-- Manager External Storage settings title [CHAR LIMIT=40] -->
     <string name="manage_external_storage_title">All files access</string>
@@ -10525,6 +10549,11 @@
     <!-- [CHAR LIMIT=60] Name of dev option to enable extra quick settings tiles -->
     <string name="quick_settings_developer_tiles">Quick settings developer tiles</string>
 
+    <!-- [CHAR LIMIT=50] Setting title to disable the adb authorization timeout feature. -->
+    <string name="adb_authorization_timeout_title">Disable adb authorization timeout</string>
+    <!-- [CHAR LIMIT=NONE] Setting summary explaining the disablement of the automatic adb authorization timeout. -->
+    <string name="adb_authorization_timeout_summary">Disable automatic revocation of adb authorizations for systems that have not reconnected within the default (7 days) or user-configured (minimum 1 day) amount of time.</string>
+
     <!-- [CHAR LIMIT=25] Title of developer tile to toggle winscope trace -->
     <string name="winscope_trace_quick_settings_title">Winscope Trace</string>
 
@@ -11846,4 +11875,9 @@
 
     <!-- Button label to stop casting on media device. [CHAR LIMIT=40 -->
     <string name="media_output_panel_stop_casting_button">Stop casting</string>
+
+    <!-- Title for the 5G limited VoLTE dialog. [CHAR LIMIT=50] -->
+    <string name="volte_5G_limited_title">Turn off VoLTE?</string>
+    <!-- Content description for the 5G limited VoLTE dialog. [CHAR LIMIT=NONE] -->
+    <string name="volte_5G_limited_text">This also turns off your 5G connection.\nDuring a voice call, you can\u2019t use the internet and some apps may not work.</string>
 </resources>
diff --git a/res/xml/development_settings.xml b/res/xml/development_settings.xml
index b4d0bba..48a0850 100644
--- a/res/xml/development_settings.xml
+++ b/res/xml/development_settings.xml
@@ -149,6 +149,11 @@
             settings:keywords="@string/keywords_adb_wireless" />
 
         <SwitchPreference
+            android:key="adb_authorization_timeout"
+            android:title="@string/adb_authorization_timeout_title"
+            android:summary="@string/adb_authorization_timeout_summary" />
+
+        <SwitchPreference
             android:key="enable_terminal"
             android:title="@string/enable_terminal_title"
             android:summary="@string/enable_terminal_summary" />
diff --git a/res/xml/tether_prefs.xml b/res/xml/tether_prefs.xml
index abc49cc..9367a9b 100644
--- a/res/xml/tether_prefs.xml
+++ b/res/xml/tether_prefs.xml
@@ -38,6 +38,12 @@
         android:summary="@string/bluetooth_tethering_subtext"
         settings:keywords="@string/keywords_hotspot_tethering" />
 
+    <SwitchPreference
+        android:key="enable_ethernet_tethering"
+        android:title="@string/ethernet_tether_checkbox_text"
+        android:summary="@string/ethernet_tethering_subtext"
+        settings:keywords="@string/keywords_hotspot_tethering" />
+
     <Preference
         android:key="disabled_on_data_saver"
         android:summary="@string/tether_settings_disabled_on_data_saver"
diff --git a/src/com/android/settings/TetherSettings.java b/src/com/android/settings/TetherSettings.java
index cce2010..c61e573 100644
--- a/src/com/android/settings/TetherSettings.java
+++ b/src/com/android/settings/TetherSettings.java
@@ -18,6 +18,7 @@
 
 import static android.net.ConnectivityManager.TETHERING_BLUETOOTH;
 import static android.net.ConnectivityManager.TETHERING_USB;
+import static android.net.TetheringManager.TETHERING_ETHERNET;
 
 import android.app.Activity;
 import android.app.settings.SettingsEnums;
@@ -31,12 +32,16 @@
 import android.content.pm.PackageManager;
 import android.hardware.usb.UsbManager;
 import android.net.ConnectivityManager;
+import android.net.EthernetManager;
+import android.net.TetheringManager;
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.os.Environment;
 import android.os.Handler;
+import android.os.HandlerExecutor;
 import android.os.UserManager;
 import android.provider.SearchIndexableResource;
+import android.text.TextUtils;
 import android.util.FeatureFlagUtils;
 
 import androidx.annotation.VisibleForTesting;
@@ -71,6 +76,7 @@
     static final String KEY_USB_TETHER_SETTINGS = "usb_tether_settings";
     @VisibleForTesting
     static final String KEY_ENABLE_BLUETOOTH_TETHERING = "enable_bluetooth_tethering";
+    private static final String KEY_ENABLE_ETHERNET_TETHERING = "enable_ethernet_tethering";
     private static final String KEY_DATA_SAVER_FOOTER = "disabled_on_data_saver";
     @VisibleForTesting
     static final String KEY_TETHER_PREFS_FOOTER = "tether_prefs_footer";
@@ -81,15 +87,22 @@
 
     private SwitchPreference mBluetoothTether;
 
+    private SwitchPreference mEthernetTether;
+
     private BroadcastReceiver mTetherChangeReceiver;
 
     private String[] mUsbRegexs;
     private String[] mBluetoothRegexs;
+    private String mEthernetRegex;
     private AtomicReference<BluetoothPan> mBluetoothPan = new AtomicReference<>();
 
     private Handler mHandler = new Handler();
     private OnStartTetheringCallback mStartTetheringCallback;
     private ConnectivityManager mCm;
+    private EthernetManager mEm;
+    private TetheringManager mTm;
+    private TetheringEventCallback mTetheringEventCallback;
+    private EthernetListener mEthernetListener;
 
     private WifiTetherPreferenceController mWifiTetherPreferenceController;
 
@@ -144,17 +157,23 @@
 
         mUsbTether = (SwitchPreference) findPreference(KEY_USB_TETHER_SETTINGS);
         mBluetoothTether = (SwitchPreference) findPreference(KEY_ENABLE_BLUETOOTH_TETHERING);
+        mEthernetTether = (SwitchPreference) findPreference(KEY_ENABLE_ETHERNET_TETHERING);
         setFooterPreferenceTitle();
 
         mDataSaverBackend.addListener(this);
 
         mCm = (ConnectivityManager) getSystemService(Context.CONNECTIVITY_SERVICE);
+        mEm = (EthernetManager) getSystemService(Context.ETHERNET_SERVICE);
+        mTm = (TetheringManager) getSystemService(Context.TETHERING_SERVICE);
 
         mUsbRegexs = mCm.getTetherableUsbRegexs();
         mBluetoothRegexs = mCm.getTetherableBluetoothRegexs();
+        mEthernetRegex = getContext().getResources().getString(
+                com.android.internal.R.string.config_ethernet_iface_regex);
 
         final boolean usbAvailable = mUsbRegexs.length != 0;
         final boolean bluetoothAvailable = mBluetoothRegexs.length != 0;
+        final boolean ethernetAvailable = !TextUtils.isEmpty(mEthernetRegex);
 
         if (!usbAvailable || Utils.isMonkeyRunning()) {
             getPreferenceScreen().removePreference(mUsbTether);
@@ -172,6 +191,7 @@
                 mBluetoothTether.setChecked(false);
             }
         }
+        if (!ethernetAvailable) getPreferenceScreen().removePreference(mEthernetTether);
         // Set initial state based on Data Saver mode.
         onDataSaverChanged(mDataSaverBackend.isDataSaverEnabled());
     }
@@ -194,6 +214,7 @@
         mDataSaverEnabled = isDataSaving;
         mUsbTether.setEnabled(!mDataSaverEnabled);
         mBluetoothTether.setEnabled(!mDataSaverEnabled);
+        mEthernetTether.setEnabled(!mDataSaverEnabled);
         mDataSaverFooter.setVisible(mDataSaverEnabled);
     }
 
@@ -221,6 +242,7 @@
         @Override
         public void onReceive(Context content, Intent intent) {
             String action = intent.getAction();
+            // TODO: stop using ACTION_TETHER_STATE_CHANGED and use mTetheringEventCallback instead.
             if (action.equals(ConnectivityManager.ACTION_TETHER_STATE_CHANGED)) {
                 // TODO - this should understand the interface types
                 ArrayList<String> available = intent.getStringArrayListExtra(
@@ -279,6 +301,8 @@
         final Activity activity = getActivity();
 
         mStartTetheringCallback = new OnStartTetheringCallback(this);
+        mTetheringEventCallback = new TetheringEventCallback();
+        mTm.registerTetheringEventCallback(new HandlerExecutor(mHandler), mTetheringEventCallback);
 
         mMassStorageActive = Environment.MEDIA_SHARED.equals(Environment.getExternalStorageState());
         mTetherChangeReceiver = new TetherChangeReceiver();
@@ -301,6 +325,9 @@
 
         if (intent != null) mTetherChangeReceiver.onReceive(activity, intent);
 
+        mEthernetListener = new EthernetListener();
+        mEm.addListener(mEthernetListener);
+
         updateState();
     }
 
@@ -312,8 +339,12 @@
             return;
         }
         getActivity().unregisterReceiver(mTetherChangeReceiver);
+        mTm.unregisterTetheringEventCallback(mTetheringEventCallback);
+        mEm.removeListener(mEthernetListener);
         mTetherChangeReceiver = null;
         mStartTetheringCallback = null;
+        mTetheringEventCallback = null;
+        mEthernetListener = null;
     }
 
     private void updateState() {
@@ -327,6 +358,7 @@
             String[] errored) {
         updateUsbState(available, tethered, errored);
         updateBluetoothState();
+        updateEthernetState(available, tethered);
     }
 
     private void updateUsbState(String[] available, String[] tethered,
@@ -390,6 +422,31 @@
         }
     }
 
+    private void updateEthernetState(String[] available, String[] tethered) {
+
+        boolean isAvailable = false;
+        boolean isTethered = false;
+
+        for (String s : available) {
+            if (s.matches(mEthernetRegex)) isAvailable = true;
+        }
+
+        for (String s : tethered) {
+            if (s.matches(mEthernetRegex)) isTethered = true;
+        }
+
+        if (isTethered) {
+            mEthernetTether.setEnabled(!mDataSaverEnabled);
+            mEthernetTether.setChecked(true);
+        } else if (isAvailable || mEm.isAvailable()) {
+            mEthernetTether.setEnabled(!mDataSaverEnabled);
+            mEthernetTether.setChecked(false);
+        } else {
+            mEthernetTether.setEnabled(false);
+            mEthernetTether.setChecked(false);
+        }
+    }
+
     public static boolean isProvisioningNeededButUnavailable(Context context) {
         return (TetherUtil.isProvisioningNeeded(context)
                 && !isIntentAvailable(context));
@@ -438,6 +495,12 @@
             } else {
                 mCm.stopTethering(TETHERING_BLUETOOTH);
             }
+        } else if (preference == mEthernetTether) {
+            if (mEthernetTether.isChecked()) {
+                startTethering(TETHERING_ETHERNET);
+            } else {
+                mCm.stopTethering(TETHERING_ETHERNET);
+            }
         }
 
         return super.onPreferenceTreeClick(preference);
@@ -495,6 +558,13 @@
                     if (!bluetoothAvailable) {
                         keys.add(KEY_ENABLE_BLUETOOTH_TETHERING);
                     }
+
+                    final boolean ethernetAvailable = !TextUtils.isEmpty(
+                            context.getResources().getString(
+                                    com.android.internal.R.string.config_ethernet_iface_regex));
+                    if (!ethernetAvailable) {
+                        keys.add(KEY_ENABLE_ETHERNET_TETHERING);
+                    }
                     return keys;
                 }
     };
@@ -524,4 +594,17 @@
             }
         }
     }
+
+    private final class TetheringEventCallback implements TetheringManager.TetheringEventCallback {
+        @Override
+        public void onTetheredInterfacesChanged(List<String> interfaces) {
+            updateState();
+        }
+    }
+
+    private final class EthernetListener implements EthernetManager.Listener {
+        public void onAvailabilityChanged(String iface, boolean isAvailable) {
+            mHandler.post(TetherSettings.this::updateState);
+        }
+    }
 }
diff --git a/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceController.java b/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceController.java
new file mode 100644
index 0000000..79aa8e6
--- /dev/null
+++ b/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceController.java
@@ -0,0 +1,79 @@
+/*
+ * 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 com.android.settings.development;
+
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.Preference;
+import androidx.preference.SwitchPreference;
+
+import com.android.settingslib.development.DeveloperOptionsPreferenceController;
+
+/**
+ * Preference controller for the developer option to disable the automatic revocation of adb
+ * authorizations.
+ */
+public class AdbAuthorizationTimeoutPreferenceController extends
+        DeveloperOptionsPreferenceController implements Preference.OnPreferenceChangeListener {
+    private static final String ADB_AUTHORIZATION_TIMEOUT_KEY = "adb_authorization_timeout";
+
+    private final Context mContext;
+
+    public AdbAuthorizationTimeoutPreferenceController(Context context) {
+        super(context);
+        mContext = context;
+    }
+
+    @Override
+    public String getPreferenceKey() {
+        return ADB_AUTHORIZATION_TIMEOUT_KEY;
+    }
+
+    @Override
+    public void updateState(Preference preference) {
+        final long authTimeout = Settings.Global.getLong(mContext.getContentResolver(),
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME,
+                Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME);
+        // An authTimeout of 0 indicates this preference is enabled and adb authorizations will not
+        // be automatically revoked.
+        ((SwitchPreference) mPreference).setChecked(authTimeout == 0);
+    }
+
+    @Override
+    public boolean onPreferenceChange(Preference preference, Object newValue) {
+        writeSetting((boolean) newValue);
+        return true;
+    }
+
+    @Override
+    public void onDeveloperOptionsSwitchDisabled() {
+        super.onDeveloperOptionsSwitchDisabled();
+        writeSetting(false);
+        ((SwitchPreference) mPreference).setChecked(false);
+    }
+
+    private void writeSetting(boolean isEnabled) {
+        long authTimeout = 0;
+        if (!isEnabled) {
+            authTimeout = Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME;
+        }
+        Settings.Global.putLong(mContext.getContentResolver(),
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME,
+                authTimeout);
+    }
+}
diff --git a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
index 8c79f2a..c349de9 100644
--- a/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
+++ b/src/com/android/settings/development/DevelopmentSettingsDashboardFragment.java
@@ -444,6 +444,7 @@
         controllers.add(new AdbPreferenceController(context, fragment));
         controllers.add(new ClearAdbKeysPreferenceController(context, fragment));
         controllers.add(new WirelessDebuggingPreferenceController(context, lifecycle));
+        controllers.add(new AdbAuthorizationTimeoutPreferenceController(context));
         controllers.add(new LocalTerminalPreferenceController(context));
         controllers.add(new BugReportInPowerPreferenceController(context));
         controllers.add(new AutomaticSystemServerHeapDumpPreferenceController(context));
diff --git a/src/com/android/settings/development/EnhancedConnectivityPreferenceController.java b/src/com/android/settings/development/EnhancedConnectivityPreferenceController.java
index 2dbd7d1..dc65973 100644
--- a/src/com/android/settings/development/EnhancedConnectivityPreferenceController.java
+++ b/src/com/android/settings/development/EnhancedConnectivityPreferenceController.java
@@ -37,7 +37,7 @@
 
     @VisibleForTesting
     static final int ENHANCED_CONNECTIVITY_ON = 1;
-    // default is enhanced connectivity disabled.
+    // default is enhanced connectivity enabled.
     @VisibleForTesting
     static final int ENHANCED_CONNECTIVITY_OFF = 0;
 
@@ -65,7 +65,7 @@
     public void updateState(Preference preference) {
         final int enhancedConnectivityEnabled = Settings.Global.getInt(
                 mContext.getContentResolver(), Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
-                ENHANCED_CONNECTIVITY_OFF);
+                ENHANCED_CONNECTIVITY_ON);
         ((SwitchPreference) mPreference).setChecked(
                 enhancedConnectivityEnabled == ENHANCED_CONNECTIVITY_ON);
     }
@@ -75,7 +75,7 @@
         super.onDeveloperOptionsSwitchDisabled();
         Settings.Global.putInt(mContext.getContentResolver(),
                 Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
-                ENHANCED_CONNECTIVITY_OFF);
-        ((SwitchPreference) mPreference).setChecked(false);
+                ENHANCED_CONNECTIVITY_ON);
+        ((SwitchPreference) mPreference).setChecked(true);
     }
 }
diff --git a/src/com/android/settings/development/compat/PlatformCompatDashboard.java b/src/com/android/settings/development/compat/PlatformCompatDashboard.java
index 7b79da7..2f2c750 100644
--- a/src/com/android/settings/development/compat/PlatformCompatDashboard.java
+++ b/src/com/android/settings/development/compat/PlatformCompatDashboard.java
@@ -100,7 +100,7 @@
     public void onActivityCreated(Bundle savedInstanceState) {
         super.onActivityCreated(savedInstanceState);
         try {
-            mChanges = getPlatformCompat().listAllChanges();
+            mChanges = getPlatformCompat().listUIChanges();
         } catch (RemoteException e) {
             throw new RuntimeException("Could not list changes!", e);
         }
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
index 5ac407d..2716e4c 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
@@ -467,7 +467,7 @@
                 return true;
             }
 
-            return channel.isBlockableSystem()
+            return channel.isBlockable()
                     || channel.getImportance() == IMPORTANCE_NONE;
         }
 
diff --git a/src/com/android/settings/network/ims/ImsQueryController.java b/src/com/android/settings/network/ims/ImsQueryController.java
index 8fdad40..068a805 100644
--- a/src/com/android/settings/network/ims/ImsQueryController.java
+++ b/src/com/android/settings/network/ims/ImsQueryController.java
@@ -20,6 +20,7 @@
 import android.telephony.SubscriptionManager;
 import android.telephony.ims.ImsException;
 import android.telephony.ims.ImsMmTelManager;
+import android.telephony.ims.feature.ImsFeature;
 import android.telephony.ims.feature.MmTelFeature;
 import android.telephony.ims.stub.ImsRegistrationImplBase;
 
@@ -84,4 +85,20 @@
     boolean isProvisionedOnDevice(int subId) {
         return (new ImsQueryProvisioningStat(subId, mCapability, mTech)).query();
     }
+
+    @VisibleForTesting
+    boolean isServiceStateReady(int subId) throws InterruptedException, ImsException,
+            IllegalArgumentException {
+        if (!SubscriptionManager.isValidSubscriptionId(subId)) {
+            return false;
+        }
+
+        final ImsMmTelManager imsMmTelManager = ImsMmTelManager.createForSubscriptionId(subId);
+        // TODO: have a shared thread pool instead of create ExecutorService
+        //       everytime to improve performance.
+        final ExecutorService executor = Executors.newSingleThreadExecutor();
+        final IntegerConsumer intResult = new IntegerConsumer();
+        imsMmTelManager.getFeatureState(executor, intResult);
+        return (intResult.get(TIMEOUT_MILLIS) == ImsFeature.STATE_READY);
+    }
 }
diff --git a/src/com/android/settings/network/ims/IntegerConsumer.java b/src/com/android/settings/network/ims/IntegerConsumer.java
new file mode 100644
index 0000000..02c8227
--- /dev/null
+++ b/src/com/android/settings/network/ims/IntegerConsumer.java
@@ -0,0 +1,58 @@
+/*
+ * 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 com.android.settings.network.ims;
+
+import java.util.concurrent.Semaphore;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.atomic.AtomicInteger;
+import java.util.function.Consumer;
+
+class IntegerConsumer extends Semaphore implements Consumer<Integer> {
+
+    private static final String TAG = "IntegerConsumer";
+
+    IntegerConsumer() {
+        super(0);
+        mValue = new AtomicInteger();
+    }
+
+    private volatile AtomicInteger mValue;
+
+    /**
+     * Get boolean value reported from callback
+     *
+     * @param timeout callback waiting time in milliseconds
+     * @return int value reported
+     * @throws InterruptedException when thread get interrupted
+     */
+    int get(long timeout) throws InterruptedException {
+        tryAcquire(timeout, TimeUnit.MILLISECONDS);
+        return mValue.get();
+    }
+
+    /**
+     * Implementation of {@link Consumer#accept(Integer)}
+     *
+     * @param value int reported from {@link Consumer#accept(Integer)}
+     */
+    public void accept(Integer value) {
+        if (value != null) {
+            mValue.set(value.intValue());
+        }
+        release();
+    }
+}
diff --git a/src/com/android/settings/network/ims/VtQueryImsState.java b/src/com/android/settings/network/ims/VtQueryImsState.java
index 60bd729..c077603 100644
--- a/src/com/android/settings/network/ims/VtQueryImsState.java
+++ b/src/com/android/settings/network/ims/VtQueryImsState.java
@@ -20,20 +20,23 @@
 import android.telecom.TelecomManager;
 import android.telephony.AccessNetworkConstants;
 import android.telephony.SubscriptionManager;
+import android.telephony.ims.ImsException;
 import android.telephony.ims.feature.MmTelFeature;
 import android.telephony.ims.stub.ImsRegistrationImplBase;
+import android.util.Log;
 
 import androidx.annotation.VisibleForTesting;
 
 import com.android.ims.ImsManager;
 import com.android.settings.network.SubscriptionUtil;
-import com.android.settings.network.telephony.MobileNetworkUtils;
 
 /**
  * Controller class for querying VT status
  */
 public class VtQueryImsState extends ImsQueryController {
 
+    private static final String LOG_TAG = "VtQueryImsState";
+
     private Context mContext;
     private int mSubId;
 
@@ -71,14 +74,25 @@
      * @return true when Video Call can be performed, otherwise false
      */
     public boolean isReadyToVideoCall() {
+        if (!isProvisionedOnDevice(mSubId)) {
+            return false;
+        }
+
         final ImsManager imsManager = getImsManager(mSubId);
         if (imsManager == null) {
             return false;
         }
 
-        return imsManager.isVtEnabledByPlatform()
-                && isProvisionedOnDevice(mSubId)
-                && MobileNetworkUtils.isImsServiceStateReady(imsManager);
+        if (!imsManager.isVtEnabledByPlatform()) {
+            return false;
+        }
+
+        try {
+            return isServiceStateReady(mSubId);
+        } catch (InterruptedException | IllegalArgumentException | ImsException exception) {
+            Log.w(LOG_TAG, "fail to get Vt service status. subId=" + mSubId, exception);
+        }
+        return false;
     }
 
     /**
diff --git a/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java b/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
index f3fdcc9..21d49d9 100644
--- a/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
+++ b/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceController.java
@@ -42,7 +42,7 @@
         implements LifecycleObserver {
     private static final String TAG = "ContactDiscoveryPref";
     private static final Uri UCE_URI = Uri.withAppendedPath(Telephony.SimInfo.CONTENT_URI,
-            Telephony.SimInfo.IMS_RCS_UCE_ENABLED);
+            Telephony.SimInfo.COLUMN_IMS_RCS_UCE_ENABLED);
 
     private ImsManager mImsManager;
     private CarrierConfigManager mCarrierConfigManager;
diff --git a/src/com/android/settings/notification/app/NotificationPreferenceController.java b/src/com/android/settings/notification/app/NotificationPreferenceController.java
index be1ce1b..ecba95b 100644
--- a/src/com/android/settings/notification/app/NotificationPreferenceController.java
+++ b/src/com/android/settings/notification/app/NotificationPreferenceController.java
@@ -134,7 +134,7 @@
                 return channel.getImportance() == IMPORTANCE_NONE;
             }
 
-            return channel.isBlockableSystem() || !mAppRow.systemApp
+            return channel.isBlockable() || !mAppRow.systemApp
                     || channel.getImportance() == IMPORTANCE_NONE;
         }
         return false;
diff --git a/src/com/android/settings/panel/MediaOutputPanel.java b/src/com/android/settings/panel/MediaOutputPanel.java
index 2a9669a..998cfc8 100644
--- a/src/com/android/settings/panel/MediaOutputPanel.java
+++ b/src/com/android/settings/panel/MediaOutputPanel.java
@@ -33,6 +33,7 @@
 import android.media.MediaMetadata;
 import android.media.session.MediaController;
 import android.media.session.MediaSessionManager;
+import android.media.session.PlaybackState;
 import android.net.Uri;
 import android.text.TextUtils;
 import android.util.Log;
@@ -66,12 +67,11 @@
     private final Context mContext;
     private final String mPackageName;
 
-    private PanelContentCallback mCallback;
-    private boolean mIsCustomizedButtonUsed = true;
-
     @VisibleForTesting
     LocalMediaManager mLocalMediaManager;
 
+    private PanelContentCallback mCallback;
+    private boolean mIsCustomizedButtonUsed = true;
     private MediaSessionManager mMediaSessionManager;
     private MediaController mMediaController;
 
@@ -255,5 +255,12 @@
                 mCallback.onHeaderChanged();
             }
         }
+
+        @Override
+        public void onPlaybackStateChanged(PlaybackState state) {
+            if (mCallback != null && state.getState() != PlaybackState.STATE_PLAYING) {
+                mCallback.forceClose();
+            }
+        }
     };
 }
diff --git a/src/com/android/settings/panel/PanelContentCallback.java b/src/com/android/settings/panel/PanelContentCallback.java
index 989082f..63c2c55 100644
--- a/src/com/android/settings/panel/PanelContentCallback.java
+++ b/src/com/android/settings/panel/PanelContentCallback.java
@@ -32,4 +32,9 @@
      * a group
      */
     void onHeaderChanged();
+
+    /**
+     * It will be called when panel requests to close itself.
+     */
+    void forceClose();
 }
diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java
index ed5c755..28515fd 100644
--- a/src/com/android/settings/panel/PanelFragment.java
+++ b/src/com/android/settings/panel/PanelFragment.java
@@ -433,5 +433,16 @@
                 mHeaderSubtitle.setText(mPanel.getSubTitle());
             });
         }
+
+        @Override
+        public void forceClose() {
+            mPanelClosedKey = PanelClosedKeys.KEY_OTHERS;
+            getFragmentActivity().finish();
+        }
+
+        @VisibleForTesting
+        FragmentActivity getFragmentActivity() {
+            return getActivity();
+        }
     }
 }
diff --git a/src/com/android/settings/password/BiometricFragment.java b/src/com/android/settings/password/BiometricFragment.java
index bc0e5c7..7e78322 100644
--- a/src/com/android/settings/password/BiometricFragment.java
+++ b/src/com/android/settings/password/BiometricFragment.java
@@ -70,6 +70,13 @@
             });
             cleanup();
         }
+
+        @Override
+        public void onAuthenticationFailed() {
+            mClientExecutor.execute(() -> {
+                mClientCallback.onAuthenticationFailed();
+            });
+        }
     };
 
     private final DialogInterface.OnClickListener mNegativeButtonListener =
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
index 83368f9..220b649 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialActivity.java
@@ -111,6 +111,7 @@
     });
 
     private AuthenticationCallback mAuthenticationCallback = new AuthenticationCallback() {
+        @Override
         public void onAuthenticationError(int errorCode, @NonNull CharSequence errString) {
             if (!mGoingToBackground) {
                 if (errorCode == BiometricPrompt.BIOMETRIC_ERROR_USER_CANCELED
@@ -123,17 +124,24 @@
             }
         }
 
+        @Override
         public void onAuthenticationSucceeded(BiometricPrompt.AuthenticationResult result) {
             mTrustManager.setDeviceLockedForUser(mUserId, false);
-
+            final boolean isStrongAuth = result.getAuthenticationType()
+                    == BiometricPrompt.AUTHENTICATION_RESULT_TYPE_DEVICE_CREDENTIAL;
             ConfirmDeviceCredentialUtils.reportSuccessfulAttempt(mLockPatternUtils, mUserManager,
-                    mUserId);
+                    mDevicePolicyManager, mUserId, isStrongAuth);
             ConfirmDeviceCredentialUtils.checkForPendingIntent(
                     ConfirmDeviceCredentialActivity.this);
 
             setResult(Activity.RESULT_OK);
             finish();
         }
+
+        @Override
+        public void onAuthenticationFailed() {
+            mDevicePolicyManager.reportFailedBiometricAttempt(mUserId);
+        }
     };
 
     private String getStringForError(int errorCode) {
diff --git a/src/com/android/settings/password/ConfirmDeviceCredentialUtils.java b/src/com/android/settings/password/ConfirmDeviceCredentialUtils.java
index 11d6924..a5febeb 100644
--- a/src/com/android/settings/password/ConfirmDeviceCredentialUtils.java
+++ b/src/com/android/settings/password/ConfirmDeviceCredentialUtils.java
@@ -20,6 +20,7 @@
 import android.app.ActivityManager;
 import android.app.ActivityOptions;
 import android.app.IActivityManager;
+import android.app.admin.DevicePolicyManager;
 import android.content.Intent;
 import android.content.IntentSender;
 import android.os.RemoteException;
@@ -54,8 +55,12 @@
     }
 
     public static void reportSuccessfulAttempt(LockPatternUtils utils, UserManager userManager,
-            int userId) {
-        utils.reportSuccessfulPasswordAttempt(userId);
+            DevicePolicyManager dpm, int userId, boolean isStrongAuth) {
+        if (isStrongAuth) {
+            utils.reportSuccessfulPasswordAttempt(userId);
+        } else {
+            dpm.reportSuccessfulBiometricAttempt(userId);
+        }
         if (userManager.isManagedProfile(userId)) {
             // Keyguard is responsible to disable StrongAuth for primary user. Disable StrongAuth
             // for work challenge only here.
diff --git a/src/com/android/settings/password/ConfirmLockPassword.java b/src/com/android/settings/password/ConfirmLockPassword.java
index ce8813f..260919d 100644
--- a/src/com/android/settings/password/ConfirmLockPassword.java
+++ b/src/com/android/settings/password/ConfirmLockPassword.java
@@ -475,7 +475,8 @@
             if (matched) {
                 if (newResult) {
                     ConfirmDeviceCredentialUtils.reportSuccessfulAttempt(mLockPatternUtils,
-                            mUserManager, mEffectiveUserId);
+                            mUserManager, mDevicePolicyManager, mEffectiveUserId,
+                            /* isStrongAuth */ true);
                 }
                 startDisappearAnimation(intent);
                 ConfirmDeviceCredentialUtils.checkForPendingIntent(getActivity());
diff --git a/src/com/android/settings/password/ConfirmLockPattern.java b/src/com/android/settings/password/ConfirmLockPattern.java
index b2afb22..06f3d93 100644
--- a/src/com/android/settings/password/ConfirmLockPattern.java
+++ b/src/com/android/settings/password/ConfirmLockPattern.java
@@ -509,7 +509,8 @@
             if (matched) {
                 if (newResult) {
                     ConfirmDeviceCredentialUtils.reportSuccessfulAttempt(mLockPatternUtils,
-                            mUserManager, mEffectiveUserId);
+                            mUserManager, mDevicePolicyManager, mEffectiveUserId,
+                            /* isStrongAuth */ true);
                 }
                 startDisappearAnimation(intent);
                 ConfirmDeviceCredentialUtils.checkForPendingIntent(getActivity());
diff --git a/src/com/android/settings/security/ConfirmSimDeletionPreferenceController.java b/src/com/android/settings/security/ConfirmSimDeletionPreferenceController.java
index 8d093c0..bf807a1 100644
--- a/src/com/android/settings/security/ConfirmSimDeletionPreferenceController.java
+++ b/src/com/android/settings/security/ConfirmSimDeletionPreferenceController.java
@@ -17,6 +17,7 @@
 package com.android.settings.security;
 
 import android.app.KeyguardManager;
+import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.provider.Settings;
 
@@ -26,19 +27,23 @@
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
 import com.android.settings.network.telephony.MobileNetworkUtils;
+import com.android.settings.overlay.FeatureFactory;
 import com.android.settings.wifi.dpp.WifiDppUtils;
+import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
 
 /** Enable/disable user confirmation before deleting an eSim */
 public class ConfirmSimDeletionPreferenceController extends BasePreferenceController implements
         Preference.OnPreferenceChangeListener{
     public static final String KEY_CONFIRM_SIM_DELETION = "confirm_sim_deletion";
     private boolean mConfirmationDefaultOn;
+    private MetricsFeatureProvider mMetricsFeatureProvider;
 
     public ConfirmSimDeletionPreferenceController(Context context, String key) {
         super(context, key);
         mConfirmationDefaultOn =
                 context.getResources()
                         .getBoolean(R.bool.config_sim_deletion_confirmation_default_on);
+        mMetricsFeatureProvider = FeatureFactory.getFactory(context).getMetricsFeatureProvider();
     }
 
     @Override
@@ -72,11 +77,15 @@
             return false;
         }
         if (!isChecked()) {
+            mMetricsFeatureProvider.action(mContext,
+                    SettingsEnums.ACTION_CONFIRM_SIM_DELETION_ON);
             setChecked(true);
             return true;
         } else {
             // prevent disabling the feature until authorized
             WifiDppUtils.showLockScreen(mContext, () -> {
+                mMetricsFeatureProvider.action(mContext,
+                        SettingsEnums.ACTION_CONFIRM_SIM_DELETION_OFF);
                 // set data
                 setChecked(false);
                 // set UI
diff --git a/src/com/android/settings/wifi/UseOpenWifiPreferenceController.java b/src/com/android/settings/wifi/UseOpenWifiPreferenceController.java
index 27cf1e2..44114e5 100644
--- a/src/com/android/settings/wifi/UseOpenWifiPreferenceController.java
+++ b/src/com/android/settings/wifi/UseOpenWifiPreferenceController.java
@@ -100,6 +100,10 @@
 
     @Override
     public int getAvailabilityStatus() {
+        // It is possible that mEnableUseWifiComponentName is no longer enabled by
+        // USE_OPEN_WIFI_PACKAGE. So update this component to reflect correct availability.
+        updateEnableUseWifiComponentName();
+        checkForFeatureSupportedScorers();
         return mDoFeatureSupportedScorersExist ? AVAILABLE : CONDITIONALLY_UNAVAILABLE;
     }
 
diff --git a/tests/robotests/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceControllerTest.java
new file mode 100644
index 0000000..bc3544d
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/development/AdbAuthorizationTimeoutPreferenceControllerTest.java
@@ -0,0 +1,134 @@
+/*
+ * 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 com.android.settings.development;
+
+import static junit.framework.Assert.assertEquals;
+
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.ContentResolver;
+import android.content.Context;
+import android.provider.Settings;
+
+import androidx.preference.PreferenceScreen;
+import androidx.preference.SwitchPreference;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.mockito.Mock;
+import org.mockito.MockitoAnnotations;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+@RunWith(RobolectricTestRunner.class)
+public class AdbAuthorizationTimeoutPreferenceControllerTest {
+    @Mock
+    private PreferenceScreen mPreferenceScreen;
+    @Mock
+    private DevelopmentSettingsDashboardFragment mFragment;
+
+    private Context mContext;
+    private ContentResolver mContentResolver;
+    private SwitchPreference mPreference;
+    private AdbAuthorizationTimeoutPreferenceController mPreferenceController;
+    private long mInitialAuthTimeout;
+
+    @Before
+    public void setUp() throws Exception {
+        MockitoAnnotations.initMocks(this);
+        mContext = RuntimeEnvironment.application;
+        mContentResolver = mContext.getContentResolver();
+
+        mPreferenceController = new AdbAuthorizationTimeoutPreferenceController(mContext);
+        mPreference = spy(new SwitchPreference(mContext));
+        when(mPreferenceScreen.findPreference(mPreferenceController.getPreferenceKey())).thenReturn(
+                mPreference);
+        mPreferenceController.displayPreference(mPreferenceScreen);
+
+        mInitialAuthTimeout = Settings.Global.getLong(mContext.getContentResolver(),
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME,
+                Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME);
+    }
+
+    @After
+    public void tearDown() throws Exception {
+        Settings.Global.putLong(mContext.getContentResolver(),
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME, mInitialAuthTimeout);
+    }
+
+    @Test
+    public void onPreferenceChange_enableSetting_timeoutSetToZero() throws Exception {
+        // This developer option disables the automatic adb authorization revocation by setting
+        // the timeout value to 0 when enabled.
+        mPreferenceController.onPreferenceChange(mPreference, true);
+        long authTimeout = Settings.Global.getLong(mContentResolver,
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME);
+
+        assertEquals(0, authTimeout);
+    }
+
+    @Test
+    public void onPreferenceChange_enableAndDisableSetting_timeoutSetToDefault()
+            throws Exception {
+        // A non-default setting value is not saved when this developer option is enabled and the
+        // setting value is set to 0. If the user subsequently disables the option the setting
+        // value is restored to the default value.
+        Settings.Global.putLong(mContentResolver, Settings.Global.ADB_ALLOWED_CONNECTION_TIME, 1);
+
+        mPreferenceController.onPreferenceChange(mPreference, true);
+        mPreferenceController.onPreferenceChange(mPreference, false);
+        long authTimeout = Settings.Global.getLong(mContentResolver,
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME);
+
+        assertEquals(Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME, authTimeout);
+    }
+
+    @Test
+    public void updateState_timeoutSetToZero_preferenceDisplayedEnabled() throws Exception {
+        Settings.Global.putLong(mContentResolver, Settings.Global.ADB_ALLOWED_CONNECTION_TIME, 0);
+
+        mPreferenceController.updateState(mPreference);
+
+        verify(mPreference).setChecked(true);
+    }
+
+    @Test
+    public void updateState_timeoutSetToDefault_preferenceDisplayedDisabled() throws Exception {
+        Settings.Global.putLong(mContentResolver, Settings.Global.ADB_ALLOWED_CONNECTION_TIME,
+                Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME);
+
+        mPreferenceController.updateState(mPreference);
+
+        verify(mPreference).setChecked(false);
+    }
+
+    @Test
+    public void onDeveloperOptionsSwitchDisabled_preferenceAndTimeoutDisabled() throws Exception {
+        mPreferenceController.onDeveloperOptionsSwitchDisabled();
+
+        long authTimeout = Settings.Global.getLong(mContentResolver,
+                Settings.Global.ADB_ALLOWED_CONNECTION_TIME);
+
+        assertEquals(Settings.Global.DEFAULT_ADB_ALLOWED_CONNECTION_TIME, authTimeout);
+        verify(mPreference).setChecked(false);
+    }
+}
+
diff --git a/tests/robotests/src/com/android/settings/development/EnhancedConnectivityPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/development/EnhancedConnectivityPreferenceControllerTest.java
index 6fd6f55..171fc6b 100644
--- a/tests/robotests/src/com/android/settings/development/EnhancedConnectivityPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/development/EnhancedConnectivityPreferenceControllerTest.java
@@ -88,20 +88,20 @@
     }
 
     @Test
-    public void onDeveloperOptionsDisabled_shouldDisablePreference() {
-        mController.onDeveloperOptionsDisabled();
+    public void onDeveloperOptionsDisabled_shouldEnablePreference() {
+        mController.onDeveloperOptionsSwitchDisabled();
 
         verify(mPreference).setEnabled(false);
-        verify(mPreference).setChecked(false);
+        verify(mPreference).setChecked(true);
 
-        assertThat(isSettingEnabled()).isFalse();
+        assertThat(isSettingEnabled()).isTrue();
     }
 
     private boolean isSettingEnabled() {
         return Settings.Global.getInt(mContext.getContentResolver(),
                 Settings.Global.ENHANCED_CONNECTIVITY_ENABLED,
-                EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_OFF
-                /* default off */)
+                EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_ON
+                /* default on */)
                 == EnhancedConnectivityPreferenceController.ENHANCED_CONNECTIVITY_ON;
     }
 }
diff --git a/tests/robotests/src/com/android/settings/development/compat/PlatformCompatDashboardTest.java b/tests/robotests/src/com/android/settings/development/compat/PlatformCompatDashboardTest.java
index 1e59167..e59bd0b 100644
--- a/tests/robotests/src/com/android/settings/development/compat/PlatformCompatDashboardTest.java
+++ b/tests/robotests/src/com/android/settings/development/compat/PlatformCompatDashboardTest.java
@@ -93,7 +93,7 @@
         mChanges[2] = new CompatibilityChangeInfo(3L, "Enabled_After_SDK_1_1", 1, false, false, "");
         mChanges[3] = new CompatibilityChangeInfo(4L, "Enabled_After_SDK_1_2", 1, false, false, "");
         mChanges[4] = new CompatibilityChangeInfo(5L, "Enabled_After_SDK_2", 2, false, false, "");
-        when(mPlatformCompat.listAllChanges()).thenReturn(mChanges);
+        when(mPlatformCompat.listUIChanges()).thenReturn(mChanges);
         when(mPlatformCompat.getOverrideValidator()).thenReturn(mOverrideValidator);
         // By default, allow any change
         when(mOverrideValidator.getOverrideAllowedState(anyLong(),anyString()))
diff --git a/tests/robotests/src/com/android/settings/network/ims/MockVtQueryImsState.java b/tests/robotests/src/com/android/settings/network/ims/MockVtQueryImsState.java
index 4fd7d0c..3daf6cb 100644
--- a/tests/robotests/src/com/android/settings/network/ims/MockVtQueryImsState.java
+++ b/tests/robotests/src/com/android/settings/network/ims/MockVtQueryImsState.java
@@ -17,6 +17,7 @@
 package com.android.settings.network.ims;
 
 import android.content.Context;
+import android.telephony.ims.ImsException;
 
 import com.android.ims.ImsManager;
 
@@ -29,6 +30,7 @@
     private Boolean mIsTtyOnVolteEnabled;
     private Boolean mIsProvisionedOnDevice;
     private Boolean mIsEnabledByUser;
+    private Boolean mIsServiceStateReady;
 
     /**
      * Constructor
@@ -68,6 +70,19 @@
         return super.isProvisionedOnDevice(subId);
     }
 
+    public void setServiceStateReady(boolean isReady) {
+        mIsServiceStateReady = isReady;
+    }
+
+    @Override
+    boolean isServiceStateReady(int subId) throws InterruptedException, ImsException,
+            IllegalArgumentException {
+        if (mIsServiceStateReady != null) {
+            return mIsServiceStateReady;
+        }
+        return super.isServiceStateReady(subId);
+    }
+
     public void setIsEnabledByUser(boolean enabled) {
         mIsEnabledByUser = enabled;
     }
diff --git a/tests/robotests/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceControllerTest.java
index 45a4563..0370bfa 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/ContactDiscoveryPreferenceControllerTest.java
@@ -64,7 +64,7 @@
 
     private static final int TEST_SUB_ID = 2;
     private static final Uri UCE_URI = Uri.withAppendedPath(Telephony.SimInfo.CONTENT_URI,
-            Telephony.SimInfo.IMS_RCS_UCE_ENABLED);
+            Telephony.SimInfo.COLUMN_IMS_RCS_UCE_ENABLED);
 
     @Mock private ImsManager mImsManager;
     @Mock private ImsRcsManager mImsRcsManager;
diff --git a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
index c766289..04fc4b9 100644
--- a/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/network/telephony/VideoCallingPreferenceControllerTest.java
@@ -27,7 +27,6 @@
 import android.telephony.CarrierConfigManager;
 import android.telephony.TelephonyManager;
 import android.telephony.ims.ProvisioningManager;
-import android.telephony.ims.feature.ImsFeature;
 
 import androidx.preference.PreferenceScreen;
 import androidx.preference.SwitchPreference;
@@ -98,7 +97,7 @@
 
         doReturn(true).when(mImsManager).isVtEnabledByPlatform();
         mQueryImsState.setIsProvisionedOnDevice(true);
-        doReturn(ImsFeature.STATE_READY).when(mImsManager).getImsServiceState();
+        mQueryImsState.setServiceStateReady(true);
         doReturn(true).when(mTelephonyManager).isDataEnabled();
 
         mController.mCallState = TelephonyManager.CALL_STATE_IDLE;
diff --git a/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
index b83ab77..d203c47 100644
--- a/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/BlockPreferenceControllerTest.java
@@ -200,7 +200,7 @@
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = true;
         NotificationChannel channel = new NotificationChannel("", "", IMPORTANCE_DEFAULT);
-        channel.setBlockableSystem(true);
+        channel.setBlockable(true);
         mController.onResume(appRow, channel, null, null, null, null);
         mController.updateState(mPreference);
         assertTrue(mSwitch.isEnabled());
diff --git a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
index 170a5e0..259f40e 100644
--- a/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/notification/app/NotificationPreferenceControllerTest.java
@@ -236,7 +236,7 @@
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = false;
         NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isBlockableSystem()).thenReturn(false);
+        when(channel.isBlockable()).thenReturn(false);
 
         mController.onResume(appRow, channel, null, null, null, null);
         assertTrue(mController.isChannelBlockable());
@@ -247,7 +247,7 @@
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = true;
         NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isBlockableSystem()).thenReturn(false);
+        when(channel.isBlockable()).thenReturn(false);
         when(channel.getImportance()).thenReturn(IMPORTANCE_HIGH);
 
         mController.onResume(appRow, channel, null, null, null, null);
@@ -259,7 +259,7 @@
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = true;
         NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isBlockableSystem()).thenReturn(true);
+        when(channel.isBlockable()).thenReturn(true);
 
         mController.onResume(appRow, channel, null, null, null, null);
         assertTrue(mController.isChannelBlockable());
@@ -270,7 +270,7 @@
         NotificationBackend.AppRow appRow = new NotificationBackend.AppRow();
         appRow.systemApp = true;
         NotificationChannel channel = mock(NotificationChannel.class);
-        when(channel.isBlockableSystem()).thenReturn(false);
+        when(channel.isBlockable()).thenReturn(false);
         when(channel.getImportance()).thenReturn(IMPORTANCE_NONE);
 
         mController.onResume(appRow, channel, null, null, null, null);
diff --git a/tests/robotests/src/com/android/settings/panel/MediaOutputPanelTest.java b/tests/robotests/src/com/android/settings/panel/MediaOutputPanelTest.java
index 07f01fc..43cecfe 100644
--- a/tests/robotests/src/com/android/settings/panel/MediaOutputPanelTest.java
+++ b/tests/robotests/src/com/android/settings/panel/MediaOutputPanelTest.java
@@ -22,6 +22,7 @@
 
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.mock;
+import static org.mockito.Mockito.never;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
 import static org.mockito.Mockito.when;
@@ -30,6 +31,7 @@
 import android.media.MediaMetadata;
 import android.media.session.MediaController;
 import android.media.session.MediaSessionManager;
+import android.media.session.PlaybackState;
 import android.net.Uri;
 
 import com.android.settings.R;
@@ -67,6 +69,8 @@
     private LocalMediaManager mLocalMediaManager;
     @Mock
     private PanelContentCallback mCallback;
+    @Mock
+    private PlaybackState mPlaybackState;
 
     private MediaOutputPanel mPanel;
     private Context mContext;
@@ -259,4 +263,19 @@
 
         verify(mCallback).onHeaderChanged();
     }
+
+    @Test
+    public void onPlaybackStateChanged_stateFromPlayingToStopped_verifyCallForceClose() {
+        mPanel.onStart();
+        verify(mMediaController).registerCallback(mControllerCbs.capture());
+        final MediaController.Callback controllerCallbacks = mControllerCbs.getValue();
+        when(mPlaybackState.getState()).thenReturn(PlaybackState.STATE_PLAYING);
+        controllerCallbacks.onPlaybackStateChanged(mPlaybackState);
+        verify(mCallback, never()).forceClose();
+
+        when(mPlaybackState.getState()).thenReturn(PlaybackState.STATE_STOPPED);
+        controllerCallbacks.onPlaybackStateChanged(mPlaybackState);
+
+        verify(mCallback).forceClose();
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
index 07ca48b..9df5af1 100644
--- a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
@@ -23,6 +23,7 @@
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
 import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
 
 import android.app.settings.SettingsEnums;
 import android.content.Context;
@@ -236,4 +237,17 @@
         assertThat(headerTitle.getText()).isEqualTo(TITLE2);
         assertThat(headerSubtitle.getText()).isEqualTo(SUBTITLE2);
     }
+
+    @Test
+    public void forceClose_verifyFinish() {
+        initFakeActivity();
+        verify(mFakePanelContent).registerCallback(mPanelContentCbs.capture());
+        final PanelContentCallback panelContentCallbacks = spy(mPanelContentCbs.getValue());
+        when(((PanelFragment.LocalPanelCallback) panelContentCallbacks).getFragmentActivity())
+                .thenReturn(mActivity);
+
+        panelContentCallbacks.forceClose();
+
+        verify(mActivity).finish();
+    }
 }
\ No newline at end of file
diff --git a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
index beaa1a6..ca636a4 100644
--- a/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
+++ b/tests/robotests/src/com/android/settings/wifi/UseOpenWifiPreferenceControllerTest.java
@@ -39,7 +39,6 @@
 import android.provider.Settings;
 
 import androidx.fragment.app.Fragment;
-import androidx.preference.Preference;
 import androidx.preference.SwitchPreference;
 
 import com.android.settings.R;
@@ -144,6 +143,19 @@
     }
 
     @Test
+    public void isAvailable_disableUseOpenWifiComponentBetweenCalls_returnsTrueThenReturnsFalse() {
+        setupScorers(Lists.newArrayList(sAppData));
+        createController();
+
+        assertThat(mController.isAvailable()).isTrue();
+
+        // Update NetworkScorerAppData so that it no longer has openWifiActivity.
+        setupScorers(Lists.newArrayList(sAppDataNoActivity));
+
+        assertThat(mController.isAvailable()).isFalse();
+    }
+
+    @Test
     public void setChecked_withTrue_enableShouldStartEnableActivity() {
         setupScorers(Lists.newArrayList(sAppData, sAppDataNoActivity));
         createController();