diff --git a/res/layout/radio_info.xml b/res/layout/radio_info.xml
index fc8cc26..5c918fc 100644
--- a/res/layout/radio_info.xml
+++ b/res/layout/radio_info.xml
@@ -25,6 +25,19 @@
         android:descendantFocusability="beforeDescendants"
         android:focusableInTouchMode="true">
 
+        <!-- Phone index -->
+        <TextView
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/phone_index_label"
+                style="@style/info_label"
+                />
+
+        <Spinner android:id="@+id/phoneIndex"
+                 android:layout_width="match_parent"
+                 android:layout_height="wrap_content"
+                />
+
         <!-- IMEI -->
         <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_imei_label" style="@style/info_label" />
@@ -37,6 +50,18 @@
             <TextView android:id="@+id/number" style="@style/info_value" />
         </LinearLayout>
 
+        <!-- Subscription ID -->
+        <LinearLayout style="@style/entry_layout">
+            <TextView android:text="@string/radio_info_subid" style="@style/info_label" />
+            <TextView android:id="@+id/subid" style="@style/info_value" />
+        </LinearLayout>
+
+        <!-- Default data subscription -->
+        <LinearLayout style="@style/entry_layout">
+            <TextView android:text="@string/radio_info_dds" style="@style/info_label" />
+            <TextView android:id="@+id/dds" style="@style/info_value" />
+        </LinearLayout>
+
         <!-- IMSI -->
         <LinearLayout style="@style/entry_layout">
             <TextView android:text="@string/radio_info_imsi_label" style="@style/info_label" />
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 1567c75..9c24dd3 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -485,6 +485,10 @@
     <string name="proxy_url_title">"PAC URL: "</string>
 
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
+    <string name="radio_info_subid">Current subId:</string>
+    <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
+    <string name="radio_info_dds">SubId of default data SIM:</string>
+    <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_dl_kbps">DL Bandwidth (kbps):</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_ul_kbps">UL Bandwidth (kbps):</string>
@@ -531,6 +535,8 @@
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_data_network_type_label">Data Network Type:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
+    <string name="phone_index_label">Select phone index</string>
+    <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_set_perferred_label">Set Preferred Network Type:</string>
     <!-- Radio Info screen. Label for a status item.  Used for diagnostic info screens, precise translation isn't needed -->
     <string name="radio_info_ping_hostname_v4">Ping Hostname(www.google.com) IPv4:</string>
@@ -2237,6 +2243,8 @@
     <string name="wifi_carrier_content">Connect via <xliff:g id="name">%1$s</xliff:g></string>
 
     <string name="wifi_scan_always_turnon_message">To improve location accuracy and for other purposes, <xliff:g id="app_name">%1$s</xliff:g> wants to turn on network scanning, even when Wi-Fi is off.\n\nAllow this for all apps that want to scan?</string>
+    <!-- Message to inform user, an unknown app want to enable network scanning.  [CHAR LIMIT=200] -->
+    <string name="wifi_scan_always_turn_on_message_unknown">To improve location accuracy and for other purposes, an unknown app wants to turn on network scanning, even when Wi\u2011Fi is off.\n\nAllow this for all apps that want to scan?</string>
     <!-- Message informing the user how to turn off  [CHAR LIMIT=200] -->
     <string name="wifi_scan_always_turnoff_message">To turn this off, go to Advanced in the overflow menu.</string>
     <string name="wifi_scan_always_confirm_allow">Allow</string>
diff --git a/src/com/android/settings/RadioInfo.java b/src/com/android/settings/RadioInfo.java
index 0b7d1be..e0ce1c0 100644
--- a/src/com/android/settings/RadioInfo.java
+++ b/src/com/android/settings/RadioInfo.java
@@ -125,6 +125,7 @@
             "Unknown"
     };
 
+    private static String[] mPhoneIndexLabels;
 
     private static final int CELL_INFO_LIST_RATE_DISABLED = Integer.MAX_VALUE;
     private static final int CELL_INFO_LIST_RATE_MAX = 0;
@@ -160,7 +161,7 @@
         60000
     };
 
-    private void log(String s) {
+    private static void log(String s) {
         Log.d(TAG, s);
     }
 
@@ -171,15 +172,17 @@
     private static final int EVENT_QUERY_SMSC_DONE = 1005;
     private static final int EVENT_UPDATE_SMSC_DONE = 1006;
 
-    private static final int MENU_ITEM_SELECT_BAND  = 0;
-    private static final int MENU_ITEM_VIEW_ADN     = 1;
-    private static final int MENU_ITEM_VIEW_FDN     = 2;
-    private static final int MENU_ITEM_VIEW_SDN     = 3;
-    private static final int MENU_ITEM_GET_IMS_STATUS = 4;
-    private static final int MENU_ITEM_TOGGLE_DATA  = 5;
+    private static final int MENU_ITEM_SELECT_BAND         = 0;
+    private static final int MENU_ITEM_VIEW_ADN            = 1;
+    private static final int MENU_ITEM_VIEW_FDN            = 2;
+    private static final int MENU_ITEM_VIEW_SDN            = 3;
+    private static final int MENU_ITEM_GET_IMS_STATUS      = 4;
+    private static final int MENU_ITEM_TOGGLE_DATA         = 5;
 
     private TextView mDeviceId; //DeviceId is the IMEI in GSM and the MEID in CDMA
     private TextView number;
+    private TextView mSubscriptionId;
+    private TextView mDds;
     private TextView mSubscriberId;
     private TextView callState;
     private TextView operatorName;
@@ -219,12 +222,13 @@
     private Switch cbrsDataSwitch;
     private Switch dsdsSwitch;
     private Spinner preferredNetworkType;
+    private Spinner mSelectPhoneIndex;
     private Spinner cellInfoRefreshRateSpinner;
 
     private ConnectivityManager mConnectivityManager;
     private TelephonyManager mTelephonyManager;
     private ImsManager mImsManager = null;
-    private Phone phone = null;
+    private Phone mPhone = null;
 
     private String mPingHostnameResultV4;
     private String mPingHostnameResultV6;
@@ -237,6 +241,7 @@
 
     private int mPreferredNetworkTypeResult;
     private int mCellInfoRefreshRateIndex;
+    private int mSelectedPhoneIndex;
 
     private final NetworkRequest mDefaultNetworkRequest = new NetworkRequest.Builder()
             .addTransportType(NetworkCapabilities.TRANSPORT_CELLULAR)
@@ -251,7 +256,9 @@
         }
     };
 
-    private final PhoneStateListener mPhoneStateListener = new PhoneStateListener() {
+    // not final because we need to recreate this object to register on a new subId (b/117555407)
+    private PhoneStateListener mPhoneStateListener = new RadioInfoPhoneStateListener();
+    private class RadioInfoPhoneStateListener extends PhoneStateListener {
         @Override
         public void onDataConnectionStateChanged(int state) {
             updateDataState();
@@ -319,7 +326,7 @@
             updatePhysicalChannelConfiguration(configs);
         }
 
-    };
+    }
 
     private void updatePhysicalChannelConfiguration(List<PhysicalChannelConfig> configs) {
             StringBuilder sb = new StringBuilder();
@@ -346,6 +353,21 @@
         preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
     }
 
+    private void updatePhoneIndex(int phoneIndex, int subId) {
+        // unregister listeners on the old subId
+        unregisterPhoneStateListener();
+        mTelephonyManager.setCellInfoListRate(CELL_INFO_LIST_RATE_DISABLED);
+
+        // update the subId
+        mTelephonyManager = mTelephonyManager.createForSubscriptionId(subId);
+
+        // update the phoneId
+        mImsManager = ImsManager.getInstance(getApplicationContext(), phoneIndex);
+        mPhone = PhoneFactory.getPhone(phoneIndex);
+
+        updateAllFields();
+    }
+
     private Handler mHandler = new Handler() {
         @Override
         public void handleMessage(Message msg) {
@@ -404,15 +426,17 @@
 
         mTelephonyManager = (TelephonyManager)getSystemService(TELEPHONY_SERVICE);
         mConnectivityManager = (ConnectivityManager)getSystemService(CONNECTIVITY_SERVICE);
-        phone = PhoneFactory.getDefaultPhone();
+        mPhone = PhoneFactory.getDefaultPhone();
 
-        //TODO: Need to update this if the default phoneId changes?
-        //      Better to have an instance per phone?
         mImsManager = ImsManager.getInstance(getApplicationContext(),
                 SubscriptionManager.getDefaultVoicePhoneId());
 
+        mPhoneIndexLabels = getPhoneIndexLabels(mTelephonyManager);
+
         mDeviceId = (TextView) findViewById(R.id.imei);
         number = (TextView) findViewById(R.id.number);
+        mSubscriptionId = (TextView) findViewById(R.id.subid);
+        mDds = (TextView) findViewById(R.id.dds);
         mSubscriberId = (TextView) findViewById(R.id.imsi);
         callState = (TextView) findViewById(R.id.call);
         operatorName = (TextView) findViewById(R.id.operator);
@@ -439,10 +463,17 @@
         mPhyChanConfig = (TextView) findViewById(R.id.phy_chan_config);
 
         preferredNetworkType = (Spinner) findViewById(R.id.preferredNetworkType);
-        ArrayAdapter<String> adapter = new ArrayAdapter<String> (this,
+        ArrayAdapter<String> preferredNetworkTypeAdapter = new ArrayAdapter<String> (this,
                 android.R.layout.simple_spinner_item, mPreferredNetworkLabels);
-        adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
-        preferredNetworkType.setAdapter(adapter);
+        preferredNetworkTypeAdapter
+                .setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        preferredNetworkType.setAdapter(preferredNetworkTypeAdapter);
+
+        mSelectPhoneIndex = (Spinner) findViewById(R.id.phoneIndex);
+        ArrayAdapter<String> phoneIndexAdapter = new ArrayAdapter<String> (this,
+                android.R.layout.simple_spinner_item, mPhoneIndexLabels);
+        phoneIndexAdapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);
+        mSelectPhoneIndex.setAdapter(phoneIndexAdapter);
 
         cellInfoRefreshRateSpinner = (Spinner) findViewById(R.id.cell_info_rate_select);
         ArrayAdapter<String> cellInfoAdapter = new ArrayAdapter<String>(this,
@@ -455,7 +486,7 @@
         imsWfcProvisionedSwitch = (Switch) findViewById(R.id.wfc_provisioned_switch);
         eabProvisionedSwitch = (Switch) findViewById(R.id.eab_provisioned_switch);
 
-        if (!ImsManager.isImsSupportedOnDevice(phone.getContext())) {
+        if (!ImsManager.isImsSupportedOnDevice(mPhone.getContext())) {
             imsVolteProvisionedSwitch.setVisibility(View.GONE);
             imsVtProvisionedSwitch.setVisibility(View.GONE);
             imsWfcProvisionedSwitch.setVisibility(View.GONE);
@@ -513,9 +544,10 @@
 
         mCellInfoRefreshRateIndex = 0; //disabled
         mPreferredNetworkTypeResult = mPreferredNetworkLabels.length - 1; //Unknown
+        mSelectedPhoneIndex = 0; //phone 0
 
         //FIXME: Replace with TelephonyManager call
-        phone.getPreferredNetworkType(
+        mPhone.getPreferredNetworkType(
                 mHandler.obtainMessage(EVENT_QUERY_PREFERRED_TYPE_DONE));
 
         restoreFromBundle(icicle);
@@ -527,6 +559,10 @@
 
         log("Started onResume");
 
+        updateAllFields();
+    }
+
+    private void updateAllFields() {
         updateMessageWaiting();
         updateCallRedirect();
         updateDataState();
@@ -539,6 +575,7 @@
 
         updateLocation(mCellLocationResult);
         updateCellInfo(mCellInfoResult);
+        updateSubscriptionIds();
 
         mPingHostnameV4.setText(mPingHostnameResultV4);
         mPingHostnameV6.setText(mPingHostnameResultV6);
@@ -552,6 +589,10 @@
         preferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
         preferredNetworkType.setOnItemSelectedListener(mPreferredNetworkHandler);
 
+        // set phone index
+        mSelectPhoneIndex.setSelection(mSelectedPhoneIndex, true);
+        mSelectPhoneIndex.setOnItemSelectedListener(mSelectPhoneIndexHandler);
+
         radioPowerOnSwitch.setOnCheckedChangeListener(mRadioPowerOnChangeListener);
         imsVolteProvisionedSwitch.setOnCheckedChangeListener(mImsVolteCheckedChangeListener);
         imsVtProvisionedSwitch.setOnCheckedChangeListener(mImsVtCheckedChangeListener);
@@ -563,19 +604,8 @@
             cbrsDataSwitch.setOnCheckedChangeListener(mCbrsDataSwitchChangeListener);
         }
 
-        mTelephonyManager.listen(mPhoneStateListener,
-                  PhoneStateListener.LISTEN_CALL_STATE
-        //b/27803938 - RadioInfo currently cannot read PRECISE_CALL_STATE
-        //      | PhoneStateListener.LISTEN_PRECISE_CALL_STATE
-                | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
-                | PhoneStateListener.LISTEN_DATA_ACTIVITY
-                | PhoneStateListener.LISTEN_CELL_LOCATION
-                | PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
-                | PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
-                | PhoneStateListener.LISTEN_CELL_INFO
-                | PhoneStateListener.LISTEN_SERVICE_STATE
-                | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
-                | PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION);
+        unregisterPhoneStateListener();
+        registerPhoneStateListener();
 
         mConnectivityManager.registerNetworkCallback(
                 mDefaultNetworkRequest, mNetworkCallback, mHandler);
@@ -611,6 +641,8 @@
         mPreferredNetworkTypeResult = b.getInt("mPreferredNetworkTypeResult",
                                                mPreferredNetworkLabels.length - 1);
 
+        mSelectedPhoneIndex = b.getInt("mSelectedPhoneIndex", 0);
+
         mCellInfoRefreshRateIndex = b.getInt("mCellInfoRefreshRateIndex", 0);
     }
 
@@ -621,6 +653,7 @@
         outState.putString("mHttpClientTestResult", mHttpClientTestResult);
 
         outState.putInt("mPreferredNetworkTypeResult", mPreferredNetworkTypeResult);
+        outState.putInt("mSelectedPhoneIndex", mSelectedPhoneIndex);
         outState.putInt("mCellInfoRefreshRateIndex", mCellInfoRefreshRateIndex);
 
     }
@@ -636,7 +669,7 @@
                 R.string.radioInfo_menu_viewFDN).setOnMenuItemClickListener(mViewFDNCallback);
         menu.add(1, MENU_ITEM_VIEW_SDN, 0,
                 R.string.radioInfo_menu_viewSDN).setOnMenuItemClickListener(mViewSDNCallback);
-        if (ImsManager.isImsSupportedOnDevice(phone.getContext())) {
+        if (ImsManager.isImsSupportedOnDevice(mPhone.getContext())) {
             menu.add(1, MENU_ITEM_GET_IMS_STATUS,
                     0, R.string.radioInfo_menu_getIMS).setOnMenuItemClickListener(mGetImsStatus);
         }
@@ -668,9 +701,61 @@
         return true;
     }
 
+    // returns array of string labels for each phone index. The array index is equal to the phone
+    // index.
+    private static String[] getPhoneIndexLabels(TelephonyManager tm) {
+        int phones = tm.getPhoneCount();
+        String[] labels = new String[phones];
+        for (int i = 0; i < phones; i++) {
+            labels[i] = "Phone " + i;
+        }
+        return labels;
+    }
+
+    private void unregisterPhoneStateListener() {
+        mTelephonyManager.listen(mPhoneStateListener, PhoneStateListener.LISTEN_NONE);
+
+        // clear all fields so they are blank until the next listener event occurs
+        operatorName.setText("");
+        gprsState.setText("");
+        dataNetwork.setText("");
+        voiceNetwork.setText("");
+        sent.setText("");
+        received.setText("");
+        callState.setText("");
+        mLocation.setText("");
+        mMwiValue = false;
+        mMwi.setText("");
+        mCfiValue = false;
+        mCfi.setText("");
+        mCellInfo.setText("");
+        dBm.setText("");
+        gsmState.setText("");
+        roamingState.setText("");
+        mPhyChanConfig.setText("");
+    }
+
+    // register mPhoneStateListener for relevant fields using the current TelephonyManager
+    private void registerPhoneStateListener() {
+        mPhoneStateListener = new RadioInfoPhoneStateListener();
+        mTelephonyManager.listen(mPhoneStateListener,
+                  PhoneStateListener.LISTEN_CALL_STATE
+        //b/27803938 - RadioInfo currently cannot read PRECISE_CALL_STATE
+        //      | PhoneStateListener.LISTEN_PRECISE_CALL_STATE
+                | PhoneStateListener.LISTEN_DATA_CONNECTION_STATE
+                | PhoneStateListener.LISTEN_DATA_ACTIVITY
+                | PhoneStateListener.LISTEN_CELL_LOCATION
+                | PhoneStateListener.LISTEN_MESSAGE_WAITING_INDICATOR
+                | PhoneStateListener.LISTEN_CALL_FORWARDING_INDICATOR
+                | PhoneStateListener.LISTEN_CELL_INFO
+                | PhoneStateListener.LISTEN_SERVICE_STATE
+                | PhoneStateListener.LISTEN_SIGNAL_STRENGTHS
+                | PhoneStateListener.LISTEN_PHYSICAL_CHANNEL_CONFIGURATION);
+    }
+
     private void updateDnsCheckState() {
         //FIXME: Replace with a TelephonyManager call
-        dnsCheckState.setText(phone.isDnsCheckDisabled() ?
+        dnsCheckState.setText(mPhone.isDnsCheckDisabled() ?
                 "0.0.0.0 allowed" :"0.0.0.0 not allowed");
     }
 
@@ -889,6 +974,11 @@
         mCellInfo.setText(buildCellInfoString(arrayCi));
     }
 
+    private final void updateSubscriptionIds() {
+        mSubscriptionId.setText(Integer.toString(mPhone.getSubId()));
+        mDds.setText(Integer.toString(SubscriptionManager.getDefaultDataSubscriptionId()));
+    }
+
     private final void
     updateMessageWaiting() {
         mMwi.setText(String.valueOf(mMwiValue));
@@ -975,12 +1065,12 @@
     }
 
     private final void updateNetworkType() {
-        if(phone != null) {
-            ServiceState ss = phone.getServiceState();
+        if(mPhone != null) {
+            ServiceState ss = mPhone.getServiceState();
             dataNetwork.setText(ServiceState.rilRadioTechnologyToString(
-                    phone.getServiceState().getRilDataRadioTechnology()));
+                    mPhone.getServiceState().getRilDataRadioTechnology()));
             voiceNetwork.setText(ServiceState.rilRadioTechnologyToString(
-                    phone.getServiceState().getRilVoiceRadioTechnology()));
+                    mPhone.getServiceState().getRilVoiceRadioTechnology()));
         }
     }
 
@@ -989,16 +1079,16 @@
         String s;
         Resources r = getResources();
 
-        s = phone.getDeviceId();
+        s = mPhone.getDeviceId();
         if (s == null) s = r.getString(R.string.radioInfo_unknown);
         mDeviceId.setText(s);
 
-        s = phone.getSubscriberId();
+        s = mPhone.getSubscriberId();
         if (s == null) s = r.getString(R.string.radioInfo_unknown);
         mSubscriberId.setText(s);
 
         //FIXME: Replace with a TelephonyManager call
-        s = phone.getLine1Number();
+        s = mPhone.getLine1Number();
         if (s == null) s = r.getString(R.string.radioInfo_unknown);
         number.setText(s);
     }
@@ -1075,7 +1165,7 @@
 
     private void refreshSmsc() {
         //FIXME: Replace with a TelephonyManager call
-        phone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
+        mPhone.getSmscAddress(mHandler.obtainMessage(EVENT_QUERY_SMSC_DONE));
     }
 
     private final void updateAllCellInfo() {
@@ -1147,8 +1237,7 @@
             // the content provider, which causes it to be loaded in a process
             // other than the Dialer process, which causes a lot of stuff to
             // break.
-            intent.setClassName("com.android.phone",
-                    "com.android.phone.SimContacts");
+            intent.setClassName("com.android.phone", "com.android.phone.SimContacts");
             startActivity(intent);
             return true;
         }
@@ -1162,8 +1251,7 @@
             // the content provider, which causes it to be loaded in a process
             // other than the Dialer process, which causes a lot of stuff to
             // break.
-            intent.setClassName("com.android.phone",
-                    "com.android.phone.settings.fdn.FdnList");
+            intent.setClassName("com.android.phone", "com.android.phone.settings.fdn.FdnList");
             startActivity(intent);
             return true;
         }
@@ -1178,8 +1266,7 @@
             // the content provider, which causes it to be loaded in a process
             // other than the Dialer process, which causes a lot of stuff to
             // break.
-            intent.setClassName("com.android.phone",
-                    "com.android.phone.ADNList");
+            intent.setClassName("com.android.phone", "com.android.phone.ADNList");
             startActivity(intent);
             return true;
         }
@@ -1187,11 +1274,11 @@
 
     private MenuItem.OnMenuItemClickListener mGetImsStatus = new MenuItem.OnMenuItemClickListener() {
         public boolean onMenuItemClick(MenuItem item) {
-            boolean isImsRegistered = phone.isImsRegistered();
-            boolean availableVolte = phone.isVolteEnabled();
-            boolean availableWfc = phone.isWifiCallingEnabled();
-            boolean availableVt = phone.isVideoEnabled();
-            boolean availableUt = phone.isUtEnabled();
+            boolean isImsRegistered = mPhone.isImsRegistered();
+            boolean availableVolte = mPhone.isVolteEnabled();
+            boolean availableWfc = mPhone.isWifiCallingEnabled();
+            boolean availableVt = mPhone.isVideoEnabled();
+            boolean availableUt = mPhone.isUtEnabled();
 
             final String imsRegString = isImsRegistered ?
                 getString(R.string.radio_info_ims_reg_status_registered) :
@@ -1248,7 +1335,7 @@
 
     private boolean isRadioOn() {
         //FIXME: Replace with a TelephonyManager call
-        return phone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
+        return mPhone.getServiceState().getState() != ServiceState.STATE_POWER_OFF;
     }
 
     private void updateRadioPowerState() {
@@ -1280,7 +1367,7 @@
     }
 
     void setImsConfigProvisionedState(int configItem, boolean state) {
-        if (phone != null && mImsManager != null) {
+        if (mPhone != null && mImsManager != null) {
             QueuedWork.queue(new Runnable() {
                 public void run() {
                     try {
@@ -1299,14 +1386,14 @@
         @Override
         public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
             log("toggle radio power: currently " + (isRadioOn()?"on":"off"));
-            phone.setRadioPower(isChecked);
+            mPhone.setRadioPower(isChecked);
        }
     };
 
     private boolean isImsVolteProvisioned() {
-        if (phone != null && mImsManager != null) {
-            return mImsManager.isVolteEnabledByPlatform(phone.getContext())
-                && mImsManager.isVolteProvisionedOnDevice(phone.getContext());
+        if (mPhone != null && mImsManager != null) {
+            return mImsManager.isVolteEnabledByPlatform(mPhone.getContext())
+                && mImsManager.isVolteProvisionedOnDevice(mPhone.getContext());
         }
         return false;
     }
@@ -1319,9 +1406,9 @@
     };
 
     private boolean isImsVtProvisioned() {
-        if (phone != null && mImsManager != null) {
-            return mImsManager.isVtEnabledByPlatform(phone.getContext())
-                && mImsManager.isVtProvisionedOnDevice(phone.getContext());
+        if (mPhone != null && mImsManager != null) {
+            return mImsManager.isVtEnabledByPlatform(mPhone.getContext())
+                && mImsManager.isVtProvisionedOnDevice(mPhone.getContext());
         }
         return false;
     }
@@ -1334,9 +1421,9 @@
     };
 
     private boolean isImsWfcProvisioned() {
-        if (phone != null && mImsManager != null) {
-            return mImsManager.isWfcEnabledByPlatform(phone.getContext())
-                && mImsManager.isWfcProvisionedOnDevice(phone.getContext());
+        if (mPhone != null && mImsManager != null) {
+            return mImsManager.isWfcEnabledByPlatform(mPhone.getContext())
+                && mImsManager.isWfcProvisionedOnDevice(mPhone.getContext());
         }
         return false;
     }
@@ -1391,7 +1478,7 @@
     }
 
     private void updateImsProvisionedState() {
-        if (!ImsManager.isImsSupportedOnDevice(phone.getContext())) {
+        if (!ImsManager.isImsSupportedOnDevice(mPhone.getContext())) {
             return;
         }
         log("updateImsProvisionedState isImsVolteProvisioned()=" + isImsVolteProvisioned());
@@ -1401,31 +1488,31 @@
         imsVolteProvisionedSwitch.setChecked(isImsVolteProvisioned());
         imsVolteProvisionedSwitch.setOnCheckedChangeListener(mImsVolteCheckedChangeListener);
         imsVolteProvisionedSwitch.setEnabled(!Build.IS_USER
-                && mImsManager.isVolteEnabledByPlatform(phone.getContext()));
+                && mImsManager.isVolteEnabledByPlatform(mPhone.getContext()));
 
         imsVtProvisionedSwitch.setOnCheckedChangeListener(null);
         imsVtProvisionedSwitch.setChecked(isImsVtProvisioned());
         imsVtProvisionedSwitch.setOnCheckedChangeListener(mImsVtCheckedChangeListener);
         imsVtProvisionedSwitch.setEnabled(!Build.IS_USER
-                && mImsManager.isVtEnabledByPlatform(phone.getContext()));
+                && mImsManager.isVtEnabledByPlatform(mPhone.getContext()));
 
         imsWfcProvisionedSwitch.setOnCheckedChangeListener(null);
         imsWfcProvisionedSwitch.setChecked(isImsWfcProvisioned());
         imsWfcProvisionedSwitch.setOnCheckedChangeListener(mImsWfcCheckedChangeListener);
         imsWfcProvisionedSwitch.setEnabled(!Build.IS_USER
-                && mImsManager.isWfcEnabledByPlatform(phone.getContext()));
+                && mImsManager.isWfcEnabledByPlatform(mPhone.getContext()));
 
         eabProvisionedSwitch.setOnCheckedChangeListener(null);
         eabProvisionedSwitch.setChecked(isEabProvisioned());
         eabProvisionedSwitch.setOnCheckedChangeListener(mEabCheckedChangeListener);
         eabProvisionedSwitch.setEnabled(!Build.IS_USER
-                && isEabEnabledByPlatform(phone.getContext()));
+                && isEabEnabledByPlatform(mPhone.getContext()));
     }
 
     OnClickListener mDnsCheckButtonHandler = new OnClickListener() {
         public void onClick(View v) {
             //FIXME: Replace with a TelephonyManager call
-            phone.disableDnsCheck(!phone.isDnsCheckDisabled());
+            mPhone.disableDnsCheck(!mPhone.isDnsCheckDisabled());
             updateDnsCheckState();
         }
     };
@@ -1452,7 +1539,7 @@
     OnClickListener mUpdateSmscButtonHandler = new OnClickListener() {
         public void onClick(View v) {
             updateSmscButton.setEnabled(false);
-            phone.setSmscAddress(smsc.getText().toString(),
+            mPhone.setSmscAddress(smsc.getText().toString(),
                     mHandler.obtainMessage(EVENT_UPDATE_SMSC_DONE));
         }
     };
@@ -1497,14 +1584,40 @@
                 // want this setting to be set, so that if the radio hiccups and this setting
                 // is for some reason unsuccessful, future calls to the radio will reflect
                 // the users's preference which is set here.
-                final int subId = phone.getSubId();
+                final int subId = mPhone.getSubId();
                 if (SubscriptionManager.isUsableSubIdValue(subId)) {
-                    Settings.Global.putInt(phone.getContext().getContentResolver(),
+                    Settings.Global.putInt(mPhone.getContext().getContentResolver(),
                             PREFERRED_NETWORK_MODE + subId, mPreferredNetworkTypeResult);
                 }
                 log("Calling setPreferredNetworkType(" + mPreferredNetworkTypeResult + ")");
                 Message msg = mHandler.obtainMessage(EVENT_SET_PREFERRED_TYPE_DONE);
-                phone.setPreferredNetworkType(mPreferredNetworkTypeResult, msg);
+                mPhone.setPreferredNetworkType(mPreferredNetworkTypeResult, msg);
+            }
+        }
+
+        public void onNothingSelected(AdapterView parent) {
+        }
+    };
+
+    AdapterView.OnItemSelectedListener mSelectPhoneIndexHandler =
+            new AdapterView.OnItemSelectedListener() {
+
+        public void onItemSelected(AdapterView parent, View v, int pos, long id) {
+            if (pos >= 0 && pos <= mPhoneIndexLabels.length - 1) {
+                // the array position is equal to the phone index
+                int phoneIndex = pos;
+                Phone[] phones = PhoneFactory.getPhones();
+                if (phones == null || phones.length <= phoneIndex) {
+                    return;
+                }
+                // getSubId says it takes a slotIndex, but it actually takes a phone index
+                int[] subIds = SubscriptionManager.getSubId(phoneIndex);
+                if (subIds == null || subIds.length < 1) {
+                    return;
+                }
+                mSelectedPhoneIndex = phoneIndex;
+
+                updatePhoneIndex(phoneIndex, subIds[0]);
             }
         }
 
diff --git a/src/com/android/settings/SetupWizardUtils.java b/src/com/android/settings/SetupWizardUtils.java
index 7a2fe80..077d94c 100644
--- a/src/com/android/settings/SetupWizardUtils.java
+++ b/src/com/android/settings/SetupWizardUtils.java
@@ -25,11 +25,16 @@
 
 public class SetupWizardUtils {
 
-    public static int getTheme(Intent intent) {
+    public static String getThemeString(Intent intent) {
         String theme = intent.getStringExtra(WizardManagerHelper.EXTRA_THEME);
         if (theme == null) {
             theme = SetupWizardProperties.theme().orElse("");
         }
+        return theme;
+    }
+
+    public static int getTheme(Intent intent) {
+        String theme = getThemeString(intent);
         // TODO(yukl): Move to ThemeResolver and add any additional required attributes in
         // onApplyThemeResource using Theme overlays
         if (theme != null) {
diff --git a/src/com/android/settings/applications/manageapplications/ManageApplications.java b/src/com/android/settings/applications/manageapplications/ManageApplications.java
index b4b909d..ba5e73f 100644
--- a/src/com/android/settings/applications/manageapplications/ManageApplications.java
+++ b/src/com/android/settings/applications/manageapplications/ManageApplications.java
@@ -135,7 +135,7 @@
         implements View.OnClickListener, OnItemSelectedListener, SearchView.OnQueryTextListener {
 
     static final String TAG = "ManageApplications";
-    static final boolean DEBUG = true;
+    static final boolean DEBUG = false;
 
     // Intent extras.
     public static final String EXTRA_CLASSNAME = "classname";
@@ -151,6 +151,7 @@
     private static final String EXTRA_HAS_ENTRIES = "hasEntries";
     private static final String EXTRA_HAS_BRIDGE = "hasBridge";
     private static final String EXTRA_FILTER_TYPE = "filterType";
+    private static final String EXTRA_EXPAND_SEARCH_VIEW = "expand_search_view";
 
     // attributes used as keys when passing values to AppInfoDashboardFragment activity
     public static final String APP_CHG = "chg";
@@ -220,6 +221,9 @@
     FilterSpinnerAdapter mFilterAdapter;
     @VisibleForTesting
     RecyclerView mRecyclerView;
+    // Whether or not search view is expanded.
+    @VisibleForTesting
+    boolean mExpandSearch;
 
     private View mRootView;
     private Spinner mFilterSpinner;
@@ -307,12 +311,14 @@
         mFilter = appFilterRegistry.get(appFilterRegistry.getDefaultFilterType(mListType));
         mIsWorkOnly = args != null ? args.getBoolean(EXTRA_WORK_ONLY) : false;
         mWorkUserId = args != null ? args.getInt(EXTRA_WORK_ID) : NO_USER_SPECIFIED;
+        mExpandSearch = activity.getIntent().getBooleanExtra(EXTRA_EXPAND_SEARCH_VIEW, false);
 
         if (savedInstanceState != null) {
             mSortOrder = savedInstanceState.getInt(EXTRA_SORT_ORDER, mSortOrder);
             mShowSystem = savedInstanceState.getBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
             mFilterType =
                     savedInstanceState.getInt(EXTRA_FILTER_TYPE, AppFilterRegistry.FILTER_APPS_ALL);
+            mExpandSearch = savedInstanceState.getBoolean(EXTRA_EXPAND_SEARCH_VIEW);
         }
 
         mInvalidSizeStr = activity.getText(R.string.invalid_size_value);
@@ -501,6 +507,7 @@
         outState.putBoolean(EXTRA_SHOW_SYSTEM, mShowSystem);
         outState.putBoolean(EXTRA_HAS_ENTRIES, mApplications.mHasReceivedLoadEntries);
         outState.putBoolean(EXTRA_HAS_BRIDGE, mApplications.mHasReceivedBridgeCallback);
+        outState.putBoolean(EXTRA_EXPAND_SEARCH_VIEW, !mSearchView.isIconified());
         outState.putInt(EXTRA_FILTER_TYPE, mFilter.getFilterType());
         if (mApplications != null) {
             mApplications.onSaveInstanceState(outState);
@@ -607,6 +614,9 @@
             mSearchView = (SearchView) searchMenuItem.getActionView();
             mSearchView.setQueryHint(getText(R.string.search_settings));
             mSearchView.setOnQueryTextListener(this);
+            if (mExpandSearch) {
+                searchMenuItem.expandActionView();
+            }
         }
 
         updateOptionsMenu();
diff --git a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
index 81b70b5..a8e4206 100644
--- a/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
+++ b/src/com/android/settings/biometrics/BiometricEnrollIntroduction.java
@@ -27,6 +27,7 @@
 
 import com.android.internal.widget.LockPatternUtils;
 import com.android.settings.R;
+import com.android.settings.SetupWizardUtils;
 import com.android.settings.password.ChooseLockGeneric;
 import com.android.settings.password.ChooseLockGeneric.ChooseLockGenericFragment;
 import com.android.settings.password.ChooseLockSettingsHelper;
@@ -123,6 +124,15 @@
     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
+
+        Intent intent = getIntent();
+        if (intent.getStringExtra(WizardManagerHelper.EXTRA_THEME) == null) {
+            // Put the theme in the intent so it gets propagated to other activities in the flow
+            intent.putExtra(
+                    WizardManagerHelper.EXTRA_THEME,
+                    SetupWizardUtils.getThemeString(intent));
+        }
+
         mBiometricUnlockDisabledByAdmin = isDisabledByAdmin();
 
         setContentView(getLayoutResource());
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProvider.java b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProvider.java
index bba7f53..bdf863e 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProvider.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProvider.java
@@ -16,8 +16,11 @@
 
 package com.android.settings.homepage.contextualcards;
 
-import java.util.List;
+import androidx.slice.Slice;
 
 /** Feature provider for the contextual card feature. */
 public interface ContextualCardFeatureProvider {
+
+    /** Log package when user clicks contextual notification channel card. */
+    void logNotificationPackage(Slice slice);
 }
diff --git a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java
index 03a1550..4af2838 100644
--- a/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java
+++ b/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImpl.java
@@ -16,7 +16,22 @@
 
 package com.android.settings.homepage.contextualcards;
 
+import static android.content.Context.MODE_PRIVATE;
+
 import android.content.Context;
+import android.content.SharedPreferences;
+import android.util.ArraySet;
+
+import androidx.slice.Slice;
+import androidx.slice.SliceMetadata;
+import androidx.slice.core.SliceAction;
+
+import com.android.settings.SettingsActivity;
+import com.android.settings.applications.AppInfoBase;
+import com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice;
+import com.android.settings.slices.CustomSliceRegistry;
+
+import java.util.Set;
 
 public class ContextualCardFeatureProviderImpl implements ContextualCardFeatureProvider {
     private final Context mContext;
@@ -24,4 +39,27 @@
     public ContextualCardFeatureProviderImpl(Context context) {
         mContext = context;
     }
+
+    @Override
+    public void logNotificationPackage(Slice slice) {
+        if (slice == null || !slice.getUri().equals(
+                CustomSliceRegistry.CONTEXTUAL_NOTIFICATION_CHANNEL_SLICE_URI)) {
+            return;
+        }
+
+        final SliceAction primaryAction = SliceMetadata.from(mContext, slice).getPrimaryAction();
+        final String currentPackage = primaryAction.getAction().getIntent()
+                .getBundleExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS)
+                .getString(AppInfoBase.ARG_PACKAGE_NAME);
+
+        final SharedPreferences prefs = mContext.getSharedPreferences(
+                ContextualNotificationChannelSlice.PREFS, MODE_PRIVATE);
+        final Set<String> interactedPackages = prefs.getStringSet(
+                ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+
+        final Set<String> newInteractedPackages = new ArraySet<>(interactedPackages);
+        newInteractedPackages.add(currentPackage);
+        prefs.edit().putStringSet(ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES,
+                newInteractedPackages).apply();
+    }
 }
diff --git a/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSlice.java
index 2025a06..17cae77 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSlice.java
@@ -16,14 +16,23 @@
 
 package com.android.settings.homepage.contextualcards.slices;
 
+import static android.content.Context.MODE_PRIVATE;
+
 import android.content.Context;
 import android.net.Uri;
+import android.util.ArraySet;
 
 import com.android.settings.R;
 import com.android.settings.slices.CustomSliceRegistry;
+import com.android.settings.slices.SliceBackgroundWorker;
+
+import java.util.Set;
 
 public class ContextualNotificationChannelSlice extends NotificationChannelSlice {
 
+    public static final String PREFS = "notification_channel_slice_prefs";
+    public static final String PREF_KEY_INTERACTED_PACKAGES = "interacted_packages";
+
     public ContextualNotificationChannelSlice(Context context) {
         super(context);
     }
@@ -37,4 +46,18 @@
     protected CharSequence getSubTitle(String packageName, int uid) {
         return mContext.getText(R.string.recently_installed_app);
     }
+
+    @Override
+    protected boolean isUserInteracted(String packageName) {
+        // Check the package has been interacted on current slice or not.
+        final Set<String> interactedPackages =
+                mContext.getSharedPreferences(PREFS, MODE_PRIVATE)
+                        .getStringSet(PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+        return interactedPackages.contains(packageName);
+    }
+
+    @Override
+    public Class<? extends SliceBackgroundWorker> getBackgroundWorkerClass() {
+        return NotificationChannelWorker.class;
+    }
 }
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
index 0550e7b..e5cee37 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSlice.java
@@ -218,6 +218,17 @@
                 .toIntent();
     }
 
+    /**
+     * Check the package has been interacted by user or not.
+     * Will use to filter package in {@link #getRecentlyInstalledPackages()}.
+     *
+     * @param packageName The app package name.
+     * @return true if the package was interacted, false otherwise.
+     */
+    protected boolean isUserInteracted(String packageName) {
+        return false;
+    }
+
     @VisibleForTesting
     IconCompat getApplicationIcon(String packageName) {
         final Drawable drawable;
@@ -328,8 +339,9 @@
         final List<PackageInfo> installedPackages =
                 mContext.getPackageManager().getInstalledPackages(0);
         for (PackageInfo packageInfo : installedPackages) {
-            // Not include system app.
-            if (packageInfo.applicationInfo.isSystemApp()) {
+            // Not include system app and interacted app.
+            if (packageInfo.applicationInfo.isSystemApp()
+                    || isUserInteracted(packageInfo.packageName)) {
                 continue;
             }
 
diff --git a/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorker.java b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorker.java
new file mode 100644
index 0000000..f1d0d59
--- /dev/null
+++ b/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorker.java
@@ -0,0 +1,77 @@
+/*
+ * 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 com.android.settings.homepage.contextualcards.slices;
+
+import static android.content.Context.MODE_PRIVATE;
+
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREFS;
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageInfo;
+import android.net.Uri;
+import android.util.ArraySet;
+
+import com.android.settings.slices.SliceBackgroundWorker;
+
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class NotificationChannelWorker extends SliceBackgroundWorker<Void> {
+
+    public NotificationChannelWorker(Context context, Uri uri) {
+        super(context, uri);
+    }
+
+    @Override
+    protected void onSlicePinned() {
+    }
+
+    @Override
+    protected void onSliceUnpinned() {
+        removeUninstalledPackages();
+    }
+
+    @Override
+    public void close() throws IOException {
+    }
+
+    private void removeUninstalledPackages() {
+        final SharedPreferences prefs = getContext().getSharedPreferences(PREFS, MODE_PRIVATE);
+        final Set<String> interactedPackages =
+                prefs.getStringSet(PREF_KEY_INTERACTED_PACKAGES, new ArraySet());
+        if (interactedPackages.isEmpty()) {
+            return;
+        }
+
+        final List<PackageInfo> installedPackageInfos =
+                getContext().getPackageManager().getInstalledPackages(0);
+        final List<String> installedPackages = installedPackageInfos.stream()
+                .map(packageInfo -> packageInfo.packageName)
+                .collect(Collectors.toList());
+        final Set<String> newInteractedPackages = new ArraySet<>();
+        for (String packageName : interactedPackages) {
+            if (installedPackages.contains(packageName)) {
+                newInteractedPackages.add(packageName);
+            }
+        }
+        prefs.edit().putStringSet(PREF_KEY_INTERACTED_PACKAGES, newInteractedPackages).apply();
+    }
+}
diff --git a/src/com/android/settings/homepage/contextualcards/slices/SliceFullCardRendererHelper.java b/src/com/android/settings/homepage/contextualcards/slices/SliceFullCardRendererHelper.java
index a9a8346..f7b2bf5 100644
--- a/src/com/android/settings/homepage/contextualcards/slices/SliceFullCardRendererHelper.java
+++ b/src/com/android/settings/homepage/contextualcards/slices/SliceFullCardRendererHelper.java
@@ -27,6 +27,7 @@
 
 import com.android.settings.R;
 import com.android.settings.homepage.contextualcards.ContextualCard;
+import com.android.settings.homepage.contextualcards.ContextualCardFeatureProvider;
 import com.android.settings.homepage.contextualcards.logging.ContextualCardLogUtils;
 import com.android.settings.overlay.FeatureFactory;
 import com.android.settingslib.core.instrumentation.MetricsFeatureProvider;
@@ -64,6 +65,12 @@
 
                     metricsFeatureProvider.action(mContext,
                             SettingsEnums.ACTION_CONTEXTUAL_CARD_CLICK, log);
+
+                    final ContextualCardFeatureProvider contextualCardFeatureProvider =
+                            FeatureFactory.getFactory(mContext).getContextualCardFeatureProvider(
+                                    mContext);
+
+                    contextualCardFeatureProvider.logNotificationPackage(slice);
                 });
 
         // Customize slice view for Settings
diff --git a/src/com/android/settings/network/telephony/NetworkOperatorPreference.java b/src/com/android/settings/network/telephony/NetworkOperatorPreference.java
index fd57bf5..a334aeb 100644
--- a/src/com/android/settings/network/telephony/NetworkOperatorPreference.java
+++ b/src/com/android/settings/network/telephony/NetworkOperatorPreference.java
@@ -50,6 +50,7 @@
     private List<String> mForbiddenPlmns;
     private int mLevel = LEVEL_NONE;
     private boolean mShow4GForLTE;
+    private boolean mUseNewApi;
 
     // The following constants are used to draw signal icon.
     private static final Drawable EMPTY_DRAWABLE = new ColorDrawable(Color.TRANSPARENT);
@@ -61,6 +62,8 @@
         mCellInfo = cellinfo;
         mForbiddenPlmns = forbiddenPlmns;
         mShow4GForLTE = show4GForLTE;
+        mUseNewApi = context.getResources().getBoolean(
+                com.android.internal.R.bool.config_enableNewAutoSelectNetworkUI);
         refresh();
     }
 
@@ -114,7 +117,9 @@
     }
 
     private void updateIcon(int level) {
-        if (level < 0 || level >= NUMBER_OF_LEVELS) return;
+        if (!mUseNewApi || level < 0 || level >= NUMBER_OF_LEVELS) {
+            return;
+        }
         Context context = getContext();
         SignalDrawable signalDrawable = new SignalDrawable(getContext());
         signalDrawable.setLevel(
diff --git a/src/com/android/settings/panel/PanelFragment.java b/src/com/android/settings/panel/PanelFragment.java
index f1391dc..7f71925 100644
--- a/src/com/android/settings/panel/PanelFragment.java
+++ b/src/com/android/settings/panel/PanelFragment.java
@@ -19,6 +19,7 @@
 import android.app.settings.SettingsEnums;
 import android.content.Context;
 import android.os.Bundle;
+import android.text.TextUtils;
 import android.view.LayoutInflater;
 import android.view.View;
 import android.view.ViewGroup;
@@ -50,6 +51,7 @@
 
     private PanelContent mPanel;
     private MetricsFeatureProvider mMetricsProvider;
+    private String mPanelClosedKey;
 
     @VisibleForTesting
     PanelSlicesAdapter mAdapter;
@@ -111,15 +113,26 @@
         return view;
     }
 
+    @Override
+    public void onDestroyView() {
+        super.onDestroyView();
+
+        if (TextUtils.isEmpty(mPanelClosedKey)) {
+            mPanelClosedKey = PanelClosedKeys.KEY_OTHERS;
+        }
+
+        mMetricsProvider.action(
+                0 /* attribution */,
+                SettingsEnums.PAGE_HIDE,
+                mPanel.getMetricsCategory(),
+                mPanelClosedKey,
+                0 /* value */);
+    }
+
     @VisibleForTesting
     View.OnClickListener getSeeMoreListener() {
         return (v) -> {
-            mMetricsProvider.action(
-                    0 /* attribution */,
-                    SettingsEnums.PAGE_HIDE ,
-                    mPanel.getMetricsCategory(),
-                    PanelClosedKeys.KEY_SEE_MORE,
-                    0 /* value */);
+            mPanelClosedKey = PanelClosedKeys.KEY_SEE_MORE;
             final FragmentActivity activity = getActivity();
             activity.startActivityForResult(mPanel.getSeeMoreIntent(), 0);
             activity.finish();
@@ -129,12 +142,7 @@
     @VisibleForTesting
     View.OnClickListener getCloseListener() {
         return (v) -> {
-            mMetricsProvider.action(
-                    0 /* attribution */,
-                    SettingsEnums.PAGE_HIDE,
-                    mPanel.getMetricsCategory(),
-                    PanelClosedKeys.KEY_DONE,
-                    0 /* value */);
+            mPanelClosedKey = PanelClosedKeys.KEY_DONE;
             getActivity().finish();
         };
     }
diff --git a/src/com/android/settings/panel/PanelLoggingContract.java b/src/com/android/settings/panel/PanelLoggingContract.java
index e149186..e6e3012 100644
--- a/src/com/android/settings/panel/PanelLoggingContract.java
+++ b/src/com/android/settings/panel/PanelLoggingContract.java
@@ -39,8 +39,9 @@
         String KEY_DONE = "done";
 
         /**
-         * The user clicked outside the dialog, closing the Panel.
+         * The user closed the panel by other ways, for example: clicked outside of dialog, tapping
+         * on back button, etc.
          */
-        String KEY_CLICKED_OUT = "clicked_out";
+        String KEY_OTHERS = "others";
     }
 }
diff --git a/src/com/android/settings/panel/SettingsPanelActivity.java b/src/com/android/settings/panel/SettingsPanelActivity.java
index 8aee382..eabd715 100644
--- a/src/com/android/settings/panel/SettingsPanelActivity.java
+++ b/src/com/android/settings/panel/SettingsPanelActivity.java
@@ -97,21 +97,4 @@
             fragmentManager.beginTransaction().add(R.id.main_content, panelFragment).commit();
         }
     }
-
-    @Override
-    public boolean onTouchEvent(MotionEvent event) {
-        if (event.getAction() == MotionEvent.ACTION_OUTSIDE) {
-            final PanelContent panelContent = FeatureFactory.getFactory(this)
-                    .getPanelFeatureProvider()
-                    .getPanel(this, getIntent().getAction(), null /* Media Package Name */);
-            FeatureFactory.getFactory(this)
-                    .getMetricsFeatureProvider()
-                    .action(0 /* attribution */,
-                            SettingsEnums.PAGE_HIDE,
-                            panelContent.getMetricsCategory(),
-                            PanelClosedKeys.KEY_CLICKED_OUT,
-                            0 /* value */);
-        }
-        return super.onTouchEvent(event);
-    }
 }
diff --git a/src/com/android/settings/wifi/WifiScanModeActivity.java b/src/com/android/settings/wifi/WifiScanModeActivity.java
index 934e972..5342729 100644
--- a/src/com/android/settings/wifi/WifiScanModeActivity.java
+++ b/src/com/android/settings/wifi/WifiScanModeActivity.java
@@ -25,6 +25,7 @@
 import android.net.wifi.WifiManager;
 import android.os.Bundle;
 import android.provider.Settings;
+import android.text.TextUtils;
 
 import androidx.appcompat.app.AlertDialog;
 import androidx.fragment.app.DialogFragment;
@@ -132,7 +133,9 @@
         @Override
         public Dialog onCreateDialog(Bundle savedInstanceState) {
             return new AlertDialog.Builder(getActivity())
-                    .setMessage(getString(R.string.wifi_scan_always_turnon_message, mApp))
+                    .setMessage(TextUtils.isEmpty(mApp) ?
+                        getString(R.string.wifi_scan_always_turn_on_message_unknown) :
+                        getString(R.string.wifi_scan_always_turnon_message, mApp))
                     .setPositiveButton(R.string.wifi_scan_always_confirm_allow,
                             new DialogInterface.OnClickListener() {
                                 public void onClick(DialogInterface dialog, int whichButton) {
diff --git a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
index 27c3e7d..58b1408 100644
--- a/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
+++ b/tests/robotests/src/com/android/settings/applications/manageapplications/ManageApplicationsTest.java
@@ -19,17 +19,14 @@
 import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_DRAGGING;
 import static androidx.recyclerview.widget.RecyclerView.SCROLL_STATE_IDLE;
 
-import static com.android.settings.applications.manageapplications.AppFilterRegistry
-        .FILTER_APPS_ALL;
-import static com.android.settings.applications.manageapplications.ManageApplications
-        .LIST_TYPE_MAIN;
-import static com.android.settings.applications.manageapplications.ManageApplications
-        .LIST_TYPE_NOTIFICATION;
+import static com.android.settings.applications.manageapplications.AppFilterRegistry.FILTER_APPS_ALL;
+import static com.android.settings.applications.manageapplications.ManageApplications.LIST_TYPE_MAIN;
+import static com.android.settings.applications.manageapplications.ManageApplications.LIST_TYPE_NOTIFICATION;
 
 import static com.google.common.truth.Truth.assertThat;
 
-import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.anyBoolean;
 import static org.mockito.ArgumentMatchers.anyInt;
 import static org.mockito.ArgumentMatchers.eq;
 import static org.mockito.Mockito.doNothing;
@@ -172,7 +169,7 @@
         when(searchMenu.getActionView()).thenReturn(searchView);
         when(mMenu.findItem(R.id.search_app_list_menu)).thenReturn(searchMenu);
         when(mMenu.add(anyInt() /* groupId */, anyInt() /* itemId */, anyInt() /* order */,
-            anyInt() /* titleRes */)).thenReturn(helpMenu);
+                anyInt() /* titleRes */)).thenReturn(helpMenu);
         doReturn("Test").when(mFragment).getText(anyInt() /* resId */);
         doNothing().when(mFragment).updateOptionsMenu();
 
@@ -182,9 +179,27 @@
     }
 
     @Test
+    public void onCreateOptionsMenu_hasExpandSearchFlag_shouldExpandSearchView() {
+        final SearchView searchView = mock(SearchView.class);
+        final MenuItem searchMenu = mock(MenuItem.class);
+        final MenuItem helpMenu = mock(MenuItem.class);
+        when(searchMenu.getActionView()).thenReturn(searchView);
+        when(mMenu.findItem(R.id.search_app_list_menu)).thenReturn(searchMenu);
+        when(mMenu.add(anyInt() /* groupId */, anyInt() /* itemId */, anyInt() /* order */,
+                anyInt() /* titleRes */)).thenReturn(helpMenu);
+        doReturn("Test").when(mFragment).getText(anyInt() /* resId */);
+        doNothing().when(mFragment).updateOptionsMenu();
+
+        mFragment.mExpandSearch = true;
+        mFragment.onCreateOptionsMenu(mMenu, mock(MenuInflater.class));
+
+        verify(searchMenu).expandActionView();
+    }
+
+    @Test
     public void onQueryTextChange_shouldFilterSearchInApplicationsAdapter() {
         final ManageApplications.ApplicationsAdapter adapter =
-            mock(ManageApplications.ApplicationsAdapter.class);
+                mock(ManageApplications.ApplicationsAdapter.class);
         final String query = "Test App";
         ReflectionHelpers.setField(mFragment, "mApplications", adapter);
 
@@ -289,13 +304,13 @@
         when(listContainer.getVisibility()).thenReturn(View.VISIBLE);
         ReflectionHelpers.setField(mFragment, "mListContainer", listContainer);
         ReflectionHelpers.setField(
-            mFragment, "mFilterAdapter", mock(ManageApplications.FilterSpinnerAdapter.class));
+                mFragment, "mFilterAdapter", mock(ManageApplications.FilterSpinnerAdapter.class));
         final ArrayList<ApplicationsState.AppEntry> appList = new ArrayList<>();
         appList.add(mock(ApplicationsState.AppEntry.class));
         final ManageApplications.ApplicationsAdapter adapter =
-            spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
-                AppFilterRegistry.getInstance().get(FILTER_APPS_ALL),
-                null /* savedInstanceState */));
+                spy(new ManageApplications.ApplicationsAdapter(mState, mFragment,
+                        AppFilterRegistry.getInstance().get(FILTER_APPS_ALL),
+                        null /* savedInstanceState */));
 
         adapter.onRebuildComplete(appList);
 
@@ -365,7 +380,7 @@
         ReflectionHelpers.setField(holder, "itemView", mock(View.class));
         ManageApplications.ApplicationsAdapter adapter =
                 new ManageApplications.ApplicationsAdapter(mState,
-                    mFragment, mock(AppFilterItem.class),
+                        mFragment, mock(AppFilterItem.class),
                         mock(Bundle.class));
         final ArrayList<ApplicationsState.AppEntry> appList = new ArrayList<>();
         final ApplicationsState.AppEntry appEntry = mock(ApplicationsState.AppEntry.class);
@@ -399,8 +414,8 @@
     @Test
     public void applicationsAdapter_filterSearch_emptyQuery_shouldShowFullList() {
         final ManageApplications.ApplicationsAdapter adapter =
-            new ManageApplications.ApplicationsAdapter(
-                mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
+                new ManageApplications.ApplicationsAdapter(
+                        mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
         final String[] appNames = {"Apricot", "Banana", "Cantaloupe", "Fig", "Mango"};
         ReflectionHelpers.setField(adapter, "mOriginalEntries", getTestAppList(appNames));
 
@@ -412,8 +427,8 @@
     @Test
     public void applicationsAdapter_filterSearch_noMatch_shouldShowEmptyList() {
         final ManageApplications.ApplicationsAdapter adapter =
-            new ManageApplications.ApplicationsAdapter(
-                mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
+                new ManageApplications.ApplicationsAdapter(
+                        mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
         final String[] appNames = {"Apricot", "Banana", "Cantaloupe", "Fig", "Mango"};
         ReflectionHelpers.setField(adapter, "mOriginalEntries", getTestAppList(appNames));
 
@@ -425,8 +440,8 @@
     @Test
     public void applicationsAdapter_filterSearch_shouldShowMatchedItemsOnly() {
         final ManageApplications.ApplicationsAdapter adapter =
-            new ManageApplications.ApplicationsAdapter(
-                mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
+                new ManageApplications.ApplicationsAdapter(
+                        mState, mFragment, mock(AppFilterItem.class), Bundle.EMPTY);
         final String[] appNames = {"Apricot", "Banana", "Cantaloupe", "Fig", "Mango"};
         ReflectionHelpers.setField(adapter, "mOriginalEntries", getTestAppList(appNames));
 
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java
new file mode 100644
index 0000000..e380636
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/ContextualCardFeatureProviderImplTest.java
@@ -0,0 +1,130 @@
+/*
+ * 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 com.android.settings.homepage.contextualcards;
+
+import static android.content.Context.MODE_PRIVATE;
+
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREFS;
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES;
+import static com.android.settings.slices.CustomSliceRegistry.CONTEXTUAL_NOTIFICATION_CHANNEL_SLICE_URI;
+import static com.android.settings.slices.CustomSliceRegistry.FLASHLIGHT_SLICE_URI;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.mockito.Mockito.doReturn;
+import static org.mockito.Mockito.spy;
+
+import android.app.PendingIntent;
+import android.content.Context;
+import android.content.Intent;
+import android.content.SharedPreferences;
+import android.net.Uri;
+import android.os.Bundle;
+import android.util.ArraySet;
+
+import androidx.core.graphics.drawable.IconCompat;
+import androidx.slice.Slice;
+import androidx.slice.SliceProvider;
+import androidx.slice.builders.ListBuilder;
+import androidx.slice.builders.SliceAction;
+import androidx.slice.widget.SliceLiveData;
+
+import com.android.settings.R;
+import com.android.settings.SettingsActivity;
+import com.android.settings.applications.AppInfoBase;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+
+import java.util.Set;
+
+@RunWith(RobolectricTestRunner.class)
+public class ContextualCardFeatureProviderImplTest {
+
+    private Context mContext;
+    private ContextualCardFeatureProviderImpl mImpl;
+    private SharedPreferences mSharedPreferences;
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mImpl = new ContextualCardFeatureProviderImpl(mContext);
+        mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE);
+        // Set-up specs for SliceMetadata.
+        SliceProvider.setSpecs(SliceLiveData.SUPPORTED_SPECS);
+    }
+
+    @After
+    public void tearDown() {
+        removeInteractedPackageFromSharedPreference();
+    }
+
+    @Test
+    public void logNotificationPackage_isContextualNotificationChannel_shouldLogPackage() {
+        final String packageName = "com.android.test.app";
+        final Slice slice = buildSlice(CONTEXTUAL_NOTIFICATION_CHANNEL_SLICE_URI, packageName);
+
+        mImpl.logNotificationPackage(slice);
+
+        final Set<String> interactedPackages = mSharedPreferences.getStringSet(
+                PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+        assertThat(interactedPackages.contains(packageName)).isTrue();
+    }
+
+    @Test
+    public void logNotificationPackage_isNotContextualNotificationChannel_shouldNotLogPackage() {
+        final String packageName = "com.android.test.app";
+        final Slice slice = buildSlice(FLASHLIGHT_SLICE_URI, packageName);
+
+        mImpl.logNotificationPackage(slice);
+
+        final Set<String> interactedPackages = mSharedPreferences.getStringSet(
+                PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+        assertThat(interactedPackages.contains(packageName)).isFalse();
+    }
+
+    private Slice buildSlice(Uri sliceUri, String packageName) {
+        final Bundle args = new Bundle();
+        args.putString(AppInfoBase.ARG_PACKAGE_NAME, packageName);
+        final Intent intent = new Intent("action");
+        intent.putExtra(SettingsActivity.EXTRA_SHOW_FRAGMENT_ARGUMENTS, args);
+
+        final PendingIntent pendingIntent = spy(
+                PendingIntent.getActivity(mContext, 0 /* requestCode */, intent, 0 /* flags */));
+        doReturn(intent).when(pendingIntent).getIntent();
+        final IconCompat icon = IconCompat.createWithResource(mContext, R.drawable.empty_icon);
+        final SliceAction action = SliceAction.createDeeplink(pendingIntent, icon,
+                ListBuilder.SMALL_IMAGE, "title");
+
+        return new ListBuilder(mContext, sliceUri, ListBuilder.INFINITY)
+                .addRow(new ListBuilder.RowBuilder()
+                        .addEndItem(icon, ListBuilder.ICON_IMAGE)
+                        .setTitle("title")
+                        .setPrimaryAction(action))
+                .build();
+    }
+
+    private void removeInteractedPackageFromSharedPreference() {
+        if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) {
+            mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply();
+        }
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSliceTest.java
index f2b87be..8541a30 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSliceTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/ContextualNotificationChannelSliceTest.java
@@ -16,30 +16,49 @@
 
 package com.android.settings.homepage.contextualcards.slices;
 
+import static android.content.Context.MODE_PRIVATE;
+
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREFS;
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES;
+
 import static com.google.common.truth.Truth.assertThat;
 
 import android.content.Context;
+import android.content.SharedPreferences;
 import android.net.Uri;
+import android.util.ArraySet;
 
 import com.android.settings.R;
 import com.android.settings.slices.CustomSliceRegistry;
 
+import org.junit.After;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
 import org.robolectric.RobolectricTestRunner;
 import org.robolectric.RuntimeEnvironment;
 
+import java.util.Set;
+
 @RunWith(RobolectricTestRunner.class)
 public class ContextualNotificationChannelSliceTest {
 
+    private static final String PACKAGE_NAME = "package_name";
+
     private Context mContext;
     private ContextualNotificationChannelSlice mNotificationChannelSlice;
+    private SharedPreferences mSharedPreferences;
 
     @Before
     public void setUp() {
         mContext = RuntimeEnvironment.application;
         mNotificationChannelSlice = new ContextualNotificationChannelSlice(mContext);
+        mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE);
+    }
+
+    @After
+    public void tearDown() {
+        removeInteractedPackageFromSharedPreference();
     }
 
     @Test
@@ -55,4 +74,34 @@
 
         assertThat(subTitle).isEqualTo(mContext.getText(R.string.recently_installed_app));
     }
+
+    @Test
+    public void isUserInteracted_hasInteractedPackage_shouldBeTrue() {
+        addInteractedPackageToSharedPreference();
+
+        final boolean isInteracted = mNotificationChannelSlice.isUserInteracted(PACKAGE_NAME);
+
+        assertThat(isInteracted).isTrue();
+    }
+
+    @Test
+    public void isUserInteracted_noInteractedPackage_shouldBeFalse() {
+        final boolean isInteracted = mNotificationChannelSlice.isUserInteracted(PACKAGE_NAME);
+
+        assertThat(isInteracted).isFalse();
+    }
+
+    private void addInteractedPackageToSharedPreference() {
+        final Set<String> interactedPackages = new ArraySet<>();
+        interactedPackages.add(PACKAGE_NAME);
+
+        mSharedPreferences.edit().putStringSet(PREF_KEY_INTERACTED_PACKAGES,
+                interactedPackages).apply();
+    }
+
+    private void removeInteractedPackageFromSharedPreference() {
+        if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) {
+            mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply();
+        }
+    }
 }
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSliceTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSliceTest.java
index 12513f6..81f5797 100644
--- a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSliceTest.java
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelSliceTest.java
@@ -26,7 +26,6 @@
 import static org.mockito.ArgumentMatchers.any;
 import static org.mockito.Mockito.doReturn;
 import static org.mockito.Mockito.spy;
-import static org.mockito.Mockito.when;
 import static org.robolectric.Shadows.shadowOf;
 
 import android.app.NotificationChannel;
@@ -299,6 +298,21 @@
         assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.no_suggested_app));
     }
 
+    @Test
+    @Config(shadows = ShadowRestrictedLockUtilsInternal.class)
+    public void getSlice_isInteractedPackage_shouldHaveNoSuggestedAppTitle() {
+        addMockPackageToPackageManager(true /* isRecentlyInstalled */,
+                ApplicationInfo.FLAG_INSTALLED);
+        mockNotificationBackend(CHANNEL_COUNT, NOTIFICATION_COUNT, false /* banned */,
+                false /* isChannelBlocked */);
+        doReturn(true).when(mNotificationChannelSlice).isUserInteracted(any(String.class));
+
+        final Slice slice = mNotificationChannelSlice.getSlice();
+
+        final SliceMetadata metadata = SliceMetadata.from(mContext, slice);
+        assertThat(metadata.getTitle()).isEqualTo(mContext.getString(R.string.no_suggested_app));
+    }
+
     private void addMockPackageToPackageManager(boolean isRecentlyInstalled, int flags) {
         final ApplicationInfo applicationInfo = new ApplicationInfo();
         applicationInfo.name = APP_LABEL;
diff --git a/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorkerTest.java b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorkerTest.java
new file mode 100644
index 0000000..6ac8b70
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/homepage/contextualcards/slices/NotificationChannelWorkerTest.java
@@ -0,0 +1,112 @@
+/*
+ * 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 com.android.settings.homepage.contextualcards.slices;
+
+import static android.content.Context.MODE_PRIVATE;
+
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREFS;
+import static com.android.settings.homepage.contextualcards.slices.ContextualNotificationChannelSlice.PREF_KEY_INTERACTED_PACKAGES;
+
+import static com.google.common.truth.Truth.assertThat;
+
+import static org.robolectric.Shadows.shadowOf;
+
+import android.content.Context;
+import android.content.SharedPreferences;
+import android.content.pm.PackageInfo;
+import android.net.Uri;
+import android.util.ArraySet;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.robolectric.RobolectricTestRunner;
+import org.robolectric.RuntimeEnvironment;
+import org.robolectric.shadows.ShadowPackageManager;
+
+import java.util.Set;
+
+@RunWith(RobolectricTestRunner.class)
+public class NotificationChannelWorkerTest {
+    private static final Uri URI = Uri.parse("content://com.android.settings.slices/test");
+    private static final String PACKAGE_NAME = "com.test.notification.channel.slice";
+
+    private Context mContext;
+    private NotificationChannelWorker mNotificationChannelWorker;
+    private ShadowPackageManager mPackageManager;
+    private SharedPreferences mSharedPreferences;
+
+
+    @Before
+    public void setUp() {
+        mContext = RuntimeEnvironment.application;
+        mNotificationChannelWorker = new NotificationChannelWorker(mContext, URI);
+
+        // Shadow PackageManager to add mock package.
+        mPackageManager = shadowOf(mContext.getPackageManager());
+
+        mSharedPreferences = mContext.getSharedPreferences(PREFS, MODE_PRIVATE);
+        addInteractedPackageToSharedPreference();
+    }
+
+    @After
+    public void tearDown() {
+        mPackageManager.removePackage(PACKAGE_NAME);
+        removeInteractedPackageFromSharedPreference();
+    }
+
+    @Test
+    public void onSliceUnpinned_interactedPackageIsUninstalled_shouldRemovePackage() {
+        mNotificationChannelWorker.onSliceUnpinned();
+
+        final Set<String> interactedPackages = mSharedPreferences.getStringSet(
+                PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+        assertThat(interactedPackages.contains(PACKAGE_NAME)).isFalse();
+    }
+
+    @Test
+    public void onSliceUnpinned_interactedPackageIsInstalled_shouldKeepPackage() {
+        mockInteractedPackageAsInstalled();
+
+        mNotificationChannelWorker.onSliceUnpinned();
+
+        final Set<String> interactedPackages = mSharedPreferences.getStringSet(
+                PREF_KEY_INTERACTED_PACKAGES, new ArraySet<>());
+        assertThat(interactedPackages.contains(PACKAGE_NAME)).isTrue();
+    }
+
+    private void mockInteractedPackageAsInstalled() {
+        final PackageInfo packageInfo = new PackageInfo();
+        packageInfo.packageName = PACKAGE_NAME;
+        mPackageManager.addPackage(packageInfo);
+    }
+
+    private void addInteractedPackageToSharedPreference() {
+        final Set<String> interactedPackages = new ArraySet<>();
+        interactedPackages.add(PACKAGE_NAME);
+
+        mSharedPreferences.edit().putStringSet(PREF_KEY_INTERACTED_PACKAGES,
+                interactedPackages).apply();
+    }
+
+    private void removeInteractedPackageFromSharedPreference() {
+        if (mSharedPreferences.contains(PREF_KEY_INTERACTED_PACKAGES)) {
+            mSharedPreferences.edit().remove(PREF_KEY_INTERACTED_PACKAGES).apply();
+        }
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/network/telephony/NetworkOperatorPreferenceTest.java b/tests/robotests/src/com/android/settings/network/telephony/NetworkOperatorPreferenceTest.java
new file mode 100644
index 0000000..704dd95
--- /dev/null
+++ b/tests/robotests/src/com/android/settings/network/telephony/NetworkOperatorPreferenceTest.java
@@ -0,0 +1,70 @@
+/*
+ * 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 com.android.settings.network.telephony;
+
+import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.Mockito.never;
+import static org.mockito.Mockito.spy;
+import static org.mockito.Mockito.verify;
+import static org.mockito.Mockito.when;
+
+import android.content.Context;
+import android.content.res.Resources;
+import android.graphics.drawable.Drawable;
+import android.telephony.CellInfo;
+
+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;
+
+import java.util.ArrayList;
+
+@RunWith(RobolectricTestRunner.class)
+public class NetworkOperatorPreferenceTest {
+    private static final int LEVEL = 2;
+
+    @Mock
+    private Resources mResources;
+    @Mock
+    private CellInfo mCellInfo;
+    private Context mContext;
+
+    @Before
+    public void setUp() {
+        MockitoAnnotations.initMocks(this);
+
+        mContext = spy(RuntimeEnvironment.application);
+        when(mContext.getResources()).thenReturn(mResources);
+    }
+
+    @Test
+    public void setIcon_useOldApi_doNothing() {
+        when(mResources.getBoolean(com.android.internal.R.bool.config_enableNewAutoSelectNetworkUI))
+                .thenReturn(false);
+        final NetworkOperatorPreference preference = spy(
+                new NetworkOperatorPreference(mCellInfo, mContext,
+                        new ArrayList<>() /* forbiddenPlmns */, false /* show4GForLTE */));
+
+        preference.setIcon(LEVEL);
+
+        verify(preference, never()).setIcon(any(Drawable.class));
+    }
+}
diff --git a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
index be8d8bc..d606ac7 100644
--- a/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
+++ b/tests/robotests/src/com/android/settings/panel/PanelFragmentTest.java
@@ -100,6 +100,16 @@
     }
 
     @Test
+    public void onDestroy_logCloseEvent() {
+        mPanelFragment.onDestroy();
+        verify(mFakeFeatureFactory.metricsFeatureProvider).action(
+                0,
+                SettingsEnums.PAGE_VISIBLE,
+                mFakePanelContent.getMetricsCategory(),
+                any(String.class),
+                0);    }
+
+    @Test
     public void panelSeeMoreClick_logsCloseEvent() {
         final View.OnClickListener listener = mPanelFragment.getSeeMoreListener();
 
diff --git a/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java b/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
index 1d5c3c2..fa15aa0 100644
--- a/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
+++ b/tests/robotests/src/com/android/settings/panel/SettingsPanelActivityTest.java
@@ -99,7 +99,7 @@
                 0,
                 SettingsEnums.PAGE_HIDE,
                 SettingsEnums.TESTING,
-                PanelLoggingContract.PanelClosedKeys.KEY_CLICKED_OUT,
+                PanelLoggingContract.PanelClosedKeys.KEY_OTHERS,
                 0
         );
     }
