diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index c17e2a0..ffeac34 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -41,6 +41,7 @@
 import android.widget.TextView;
 
 import com.android.internal.widget.LockPatternUtils;
+import android.telephony.TelephonyManager;
 
 import java.util.Observable;
 import java.util.Observer;
@@ -166,18 +167,24 @@
         mChoosePattern.setIntent(intent);
         inlinePrefCat.addPreference(mChoosePattern);
         
-        PreferenceScreen simLockPreferences = getPreferenceManager()
-                .createPreferenceScreen(this);
-        simLockPreferences.setTitle(R.string.sim_lock_settings_category);
-        // Intent to launch SIM lock settings
-        intent = new Intent();
-        intent.setClassName("com.android.settings", "com.android.settings.IccLockSettings");
-        simLockPreferences.setIntent(intent);
+        int activePhoneType = TelephonyManager.getDefault().getPhoneType();
+
+        // do not display SIM lock for CDMA phone
+        if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType)
+        {
+            PreferenceScreen simLockPreferences = getPreferenceManager()
+                    .createPreferenceScreen(this);
+            simLockPreferences.setTitle(R.string.sim_lock_settings_category);
+            // Intent to launch SIM lock settings
+            intent = new Intent();
+            intent.setClassName("com.android.settings", "com.android.settings.IccLockSettings");
+            simLockPreferences.setIntent(intent);
         
-        PreferenceCategory simLockCat = new PreferenceCategory(this);
-        simLockCat.setTitle(R.string.sim_lock_settings_title);
-        root.addPreference(simLockCat);
-        simLockCat.addPreference(simLockPreferences);
+            PreferenceCategory simLockCat = new PreferenceCategory(this);
+            simLockCat.setTitle(R.string.sim_lock_settings_title);
+            root.addPreference(simLockCat);
+            simLockCat.addPreference(simLockPreferences);
+        }
 
         // Passwords
         PreferenceCategory passwordsCat = new PreferenceCategory(this);
diff --git a/src/com/android/settings/SoundAndDisplaySettings.java b/src/com/android/settings/SoundAndDisplaySettings.java
index 4111450..3d3a5d0 100644
--- a/src/com/android/settings/SoundAndDisplaySettings.java
+++ b/src/com/android/settings/SoundAndDisplaySettings.java
@@ -37,6 +37,7 @@
 import android.provider.Settings;
 import android.util.Log;
 import android.view.IWindowManager;
+import android.telephony.TelephonyManager;
 
 public class SoundAndDisplaySettings extends PreferenceActivity implements
         Preference.OnPreferenceChangeListener {
@@ -44,6 +45,7 @@
 
     /** If there is no setting in the provider, use this. */
     private static final int FALLBACK_SCREEN_TIMEOUT_VALUE = 30000;
+    private static final int FALLBACK_EMERGENCY_TONE_VALUE = 0;
     
     private static final String KEY_SILENT = "silent";
     private static final String KEY_VIBRATE = "vibrate";
@@ -54,6 +56,7 @@
     private static final String KEY_ACCELEROMETER = "accelerometer";
     private static final String KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS = "play_media_notification_sounds";
     private static final String KEY_COMPATIBILITY_MODE = "compatibility_mode";
+    private static final String KEY_EMERGENCY_TONE ="emergency_tone";
     
     private CheckBoxPreference mSilent;
 
@@ -91,6 +94,7 @@
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         ContentResolver resolver = getContentResolver();
+        int activePhoneType = TelephonyManager.getDefault().getPhoneType();
         
         mAudioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
         mWindowManager = IWindowManager.Stub.asInterface(ServiceManager.getService("window"));
@@ -99,6 +103,11 @@
         
         addPreferencesFromResource(R.xml.sound_and_display_settings);
         
+        if (TelephonyManager.PHONE_TYPE_CDMA != activePhoneType) {
+            // device is not CDMA, do not display CDMA emergency_tone
+            getPreferenceScreen().removePreference(findPreference(KEY_EMERGENCY_TONE));
+         }
+
         mSilent = (CheckBoxPreference) findPreference(KEY_SILENT);
         mPlayMediaNotificationSounds = (CheckBoxPreference) findPreference(KEY_PLAY_MEDIA_NOTIFICATION_SOUNDS);
 
@@ -125,6 +134,14 @@
         screenTimeoutPreference.setValue(String.valueOf(Settings.System.getInt(
                 resolver, SCREEN_OFF_TIMEOUT, FALLBACK_SCREEN_TIMEOUT_VALUE)));
         screenTimeoutPreference.setOnPreferenceChangeListener(this);
+
+        if (TelephonyManager.PHONE_TYPE_CDMA == activePhoneType) {
+            ListPreference emergencyTonePreference =
+                (ListPreference) findPreference(KEY_EMERGENCY_TONE);
+            emergencyTonePreference.setValue(String.valueOf(Settings.System.getInt(
+                resolver, Settings.System.EMERGENCY_TONE, FALLBACK_EMERGENCY_TONE_VALUE)));
+            emergencyTonePreference.setOnPreferenceChangeListener(this);
+        }
     }
     
     @Override
@@ -273,6 +290,14 @@
             } catch (NumberFormatException e) {
                 Log.e(TAG, "could not persist screen timeout setting", e);
             }
+        } else if (KEY_EMERGENCY_TONE.equals(preference.getKey())) {
+            int value = Integer.parseInt((String) objValue);
+            try {
+                Settings.System.putInt(getContentResolver(),
+                        Settings.System.EMERGENCY_TONE, value);
+            } catch (NumberFormatException e) {
+                Log.e(TAG, "could not persist emergency tone setting", e);
+            }
         }
         
         return true;
diff --git a/src/com/android/settings/deviceinfo/Status.java b/src/com/android/settings/deviceinfo/Status.java
index ece5346..a165754 100644
--- a/src/com/android/settings/deviceinfo/Status.java
+++ b/src/com/android/settings/deviceinfo/Status.java
@@ -182,11 +182,27 @@
         mUptime = findPreference("up_time");
         
         //NOTE "imei" is the "Device ID" since it represents the IMEI in GSM and the MEID in CDMA
-        setSummaryText("imei", mPhone.getDeviceId());
-        
-        setSummaryText("imei_sv",
-                ((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
+        if (mPhone.getPhoneName().equals("CDMA")) {
+            setSummaryText("meid_number", mPhone.getMeid());
+            setSummaryText("min_number", mPhone.getCdmaMin());
+            setSummaryText("prl_version", mPhone.getCdmaPrlVersion());
+
+            // device is not GSM/UMTS, do not display GSM/UMTS features
+            getPreferenceScreen().removePreference(findPreference("imei"));
+            getPreferenceScreen().removePreference(findPreference("imei_sv"));
+        } else {
+            setSummaryText("imei", mPhone.getDeviceId());
+
+            setSummaryText("imei_sv",
+                    ((TelephonyManager) getSystemService(TELEPHONY_SERVICE))
                         .getDeviceSoftwareVersion());
+
+            // device is not CDMA, do not display CDMA features
+            getPreferenceScreen().removePreference(findPreference("prl_version"));
+            getPreferenceScreen().removePreference(findPreference("meid_number"));
+            getPreferenceScreen().removePreference(findPreference("min_number"));
+        }
+
         setSummaryText("number", mPhone.getLine1Number());
 
         mPhoneStateReceiver = new PhoneStateIntentReceiver(this, mHandler);
