diff --git a/res/xml/my_device_info.xml b/res/xml/my_device_info.xml
index aec064b..1f402a8 100644
--- a/res/xml/my_device_info.xml
+++ b/res/xml/my_device_info.xml
@@ -52,12 +52,11 @@
             settings:controller="com.android.settings.deviceinfo.BrandedAccountPreferenceController"/>
 
         <!-- Phone number -->
-        <Preference
+        <com.android.settings.deviceinfo.PhoneNumberSummaryPreference
             android:key="phone_number"
             android:order="3"
             android:title="@string/status_number"
             android:summary="@string/summary_placeholder"
-            android:selectable="false"
             settings:isPreferenceVisible="@bool/config_show_sim_info"
             settings:controller="com.android.settings.deviceinfo.PhoneNumberPreferenceController"
             settings:enableCopying="true"/>
@@ -120,6 +119,7 @@
             android:key="eid_info"
             android:order="31"
             android:title="@string/status_eid"
+            android:summary="@string/device_info_protected_single_press"
             android:positiveButtonText="@string/dlg_ok"
             android:dialogLayout="@layout/dialog_eid_status"
             settings:isPreferenceVisible="@bool/config_show_sim_info"
@@ -127,7 +127,7 @@
             settings:controller="com.android.settings.deviceinfo.simstatus.SimEidPreferenceController"/>
 
         <!-- IMEI -->
-        <Preference
+        <com.android.settings.deviceinfo.PhoneNumberSummaryPreference
             android:key="imei_info"
             android:order="32"
             android:title="@string/status_imei"
diff --git a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
index 6df100c..a3288db 100644
--- a/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/PhoneNumberPreferenceController.java
@@ -56,6 +56,28 @@
     }
 
     @Override
+    public CharSequence getSummary() {
+        return mContext.getString(R.string.device_info_protected_single_press);
+    }
+
+    @Override
+    public boolean handlePreferenceTreeClick(Preference preference) {
+        String prefKey = preference.getKey();
+        if (prefKey.startsWith(KEY_PHONE_NUMBER)) {
+            int simSlotNumber = 0;
+            if (!TextUtils.equals(prefKey, KEY_PHONE_NUMBER)) {
+                // Get multisim slot number from preference key.
+                // Multisim preference key is KEY_PHONE_NUMBER + simSlotNumber
+                simSlotNumber = Integer.parseInt(
+                        prefKey.replaceAll("[^0-9]", ""));
+            }
+            final Preference simStatusPreference = mPreferenceList.get(simSlotNumber);
+            simStatusPreference.setSummary(getPhoneNumber(simSlotNumber));
+        }
+        return super.handlePreferenceTreeClick(preference);
+    }
+
+    @Override
     public void displayPreference(PreferenceScreen screen) {
         super.displayPreference(screen);
         if (!SubscriptionUtil.isSimHardwareVisible(mContext)) {
@@ -84,7 +106,7 @@
         for (int simSlotNumber = 0; simSlotNumber < mPreferenceList.size(); simSlotNumber++) {
             final Preference simStatusPreference = mPreferenceList.get(simSlotNumber);
             simStatusPreference.setTitle(getPreferenceTitle(simSlotNumber));
-            simStatusPreference.setSummary(getPhoneNumber(simSlotNumber));
+            simStatusPreference.setSummary(getSummary());
         }
     }
 
@@ -134,7 +156,7 @@
     }
 
     @VisibleForTesting
-    protected String getFormattedPhoneNumber(SubscriptionInfo subscriptionInfo) {
+    protected CharSequence getFormattedPhoneNumber(SubscriptionInfo subscriptionInfo) {
         final String phoneNumber = SubscriptionUtil.getBidiFormattedPhoneNumber(mContext,
                 subscriptionInfo);
         return TextUtils.isEmpty(phoneNumber) ? mContext.getString(R.string.device_info_default)
@@ -143,6 +165,6 @@
 
     @VisibleForTesting
     protected Preference createNewPreference(Context context) {
-        return new Preference(context);
+        return new PhoneNumberSummaryPreference(context);
     }
 }
diff --git a/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java b/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
index ff55184..2045b96 100644
--- a/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
+++ b/src/com/android/settings/deviceinfo/imei/ImeiInfoPreferenceController.java
@@ -33,6 +33,7 @@
 
 import com.android.settings.R;
 import com.android.settings.core.BasePreferenceController;
+import com.android.settings.deviceinfo.PhoneNumberSummaryPreference;
 import com.android.settings.deviceinfo.simstatus.SlotSimStatus;
 import com.android.settings.network.SubscriptionUtil;
 import com.android.settingslib.Utils;
@@ -102,7 +103,6 @@
             multiImeiPreference.setKey(DEFAULT_KEY + (1 + simSlotNumber));
             multiImeiPreference.setEnabled(true);
             multiImeiPreference.setCopyingEnabled(true);
-
             category.addPreference(multiImeiPreference);
        }
     }
@@ -112,6 +112,11 @@
         updatePreference(preference, keyToSlotIndex(preference.getKey()));
     }
 
+    @Override
+    public CharSequence getSummary() {
+        return mContext.getString(R.string.device_info_protected_single_press);
+    }
+
     private CharSequence getSummary(int simSlot) {
         final int phoneType = getPhoneType(simSlot);
         return phoneType == PHONE_TYPE_CDMA ? mTelephonyManager.getMeid(simSlot)
@@ -145,12 +150,8 @@
 
     @VisibleForTesting
     protected void updatePreference(Preference preference, int simSlot) {
-        if (simSlot < 0) {
-            preference.setVisible(false);
-            return;
-        }
         preference.setTitle(getTitle(simSlot));
-        preference.setSummary(getSummary(simSlot));
+        preference.setSummary(getSummary());
     }
 
     private CharSequence getTitleForGsmPhone(int simSlot, boolean isPrimaryImei) {
@@ -194,6 +195,6 @@
 
     @VisibleForTesting
     Preference createNewPreference(Context context) {
-        return new Preference(context);
+        return new PhoneNumberSummaryPreference(context);
     }
 }
diff --git a/src/com/android/settings/deviceinfo/simstatus/SimEidPreferenceController.kt b/src/com/android/settings/deviceinfo/simstatus/SimEidPreferenceController.kt
index f765d8c..e0376dc 100644
--- a/src/com/android/settings/deviceinfo/simstatus/SimEidPreferenceController.kt
+++ b/src/com/android/settings/deviceinfo/simstatus/SimEidPreferenceController.kt
@@ -92,7 +92,6 @@
             }
             preference.title = title
             preference.dialogTitle = title
-            preference.summary = eid
             updateDialog()
         }
     }
@@ -131,6 +130,9 @@
 
         val qrCodeView = dialog.requireViewById<ImageView>(R.id.esim_id_qrcode)
         qrCodeView.setImageBitmap(getEidQrCode(eid))
+
+        // After "Tap to show", eid is displayed on preference.
+        preference.summary = textView.text
     }
 
     override fun handlePreferenceTreeClick(preference: Preference): Boolean {
diff --git a/tests/unit/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java b/tests/unit/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
index 9a5399c..5f02b04 100644
--- a/tests/unit/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
+++ b/tests/unit/src/com/android/settings/deviceinfo/PhoneNumberPreferenceControllerTest.java
@@ -37,6 +37,7 @@
 import androidx.test.core.app.ApplicationProvider;
 import androidx.test.ext.junit.runners.AndroidJUnit4;
 
+import com.android.settings.core.BasePreferenceController;
 import com.android.settings.testutils.ResourcesUtils;
 
 import org.junit.Before;
@@ -88,10 +89,27 @@
         mCategory.setKey(categoryKey);
         mScreen.addPreference(mCategory);
 
+        doReturn(mSubscriptionInfo).when(mController).getSubscriptionInfo(anyInt());
         doReturn(mSecondPreference).when(mController).createNewPreference(mContext);
     }
 
     @Test
+    public void getAvailabilityStatus_isVoiceCapable_shouldBeAVAILABLE() {
+        when(mTelephonyManager.isVoiceCapable()).thenReturn(true);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BasePreferenceController.AVAILABLE);
+    }
+
+    @Test
+    public void getAvailabilityStatus_isNotVoiceCapable_shouldBeUNSUPPORTED_ON_DEVICE() {
+        when(mTelephonyManager.isVoiceCapable()).thenReturn(false);
+
+        assertThat(mController.getAvailabilityStatus()).isEqualTo(
+                BasePreferenceController.UNSUPPORTED_ON_DEVICE);
+    }
+
+    @Test
     public void displayPreference_multiSim_shouldAddSecondPreference() {
         when(mTelephonyManager.getPhoneCount()).thenReturn(2);
 
@@ -105,7 +123,6 @@
     @Test
     public void updateState_singleSim_shouldUpdateTitleAndPhoneNumber() {
         final String phoneNumber = "1111111111";
-        doReturn(mSubscriptionInfo).when(mController).getSubscriptionInfo(anyInt());
         doReturn(phoneNumber).when(mController).getFormattedPhoneNumber(mSubscriptionInfo);
         when(mTelephonyManager.getPhoneCount()).thenReturn(1);
         mController.displayPreference(mScreen);
@@ -119,7 +136,6 @@
     @Test
     public void updateState_multiSim_shouldUpdateTitleAndPhoneNumberOfMultiplePreferences() {
         final String phoneNumber = "1111111111";
-        doReturn(mSubscriptionInfo).when(mController).getSubscriptionInfo(anyInt());
         doReturn(phoneNumber).when(mController).getFormattedPhoneNumber(mSubscriptionInfo);
         when(mTelephonyManager.getPhoneCount()).thenReturn(2);
         mController.displayPreference(mScreen);
@@ -137,11 +153,11 @@
     @Test
     public void getSummary_cannotGetActiveSubscriptionInfo_shouldShowUnknown() {
         when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(null);
-        mController.displayPreference(mScreen);
 
-        mController.updateState(mPreference);
+        CharSequence primaryNumber = mController.getSummary();
 
-        verify(mPreference).setSummary(ResourcesUtils.getResourcesString(
+        assertThat(primaryNumber).isNotNull();
+        assertThat(primaryNumber).isEqualTo(ResourcesUtils.getResourcesString(
                 mContext, "device_info_default"));
     }
 
@@ -150,10 +166,9 @@
         List<SubscriptionInfo> infos = new ArrayList<>();
         when(mSubscriptionManager.getActiveSubscriptionInfoList()).thenReturn(infos);
 
-        mController.displayPreference(mScreen);
-        mController.updateState(mPreference);
+        CharSequence primaryNumber = mController.getSummary();
 
-        verify(mPreference).setSummary(ResourcesUtils.getResourcesString(
+        assertThat(primaryNumber).isEqualTo(ResourcesUtils.getResourcesString(
                 mContext, "device_info_default"));
     }
 }
