Fix Carrier settings crash issue

When world_phone enabled, "carrier settings" option
present in Mobile Network Settings menu and if we
select on it there is a crash in PhoneApp.

To fix it, modify "enabled_networks_key" handling properly
to do not display "carrier settings" menu option when
config config_carrier_settings_enable is set to false

Change-Id: Ie5fc1f60872cbed7ad82098df01720b77d88b453
diff --git a/src/com/android/phone/CdmaOptions.java b/src/com/android/phone/CdmaOptions.java
index 3e3c8b5..8971fa4 100644
--- a/src/com/android/phone/CdmaOptions.java
+++ b/src/com/android/phone/CdmaOptions.java
@@ -43,6 +43,7 @@
     private static final String BUTTON_CDMA_SYSTEM_SELECT_KEY = "cdma_system_select_key";
     private static final String BUTTON_CDMA_SUBSCRIPTION_KEY = "cdma_subscription_key";
     private static final String BUTTON_CDMA_ACTIVATE_DEVICE_KEY = "cdma_activate_device_key";
+    private static final String BUTTON_CARRIER_SETTINGS_KEY = "carrier_settings_key";
 
     private PreferenceActivity mPrefActivity;
     private PreferenceScreen mPrefScreen;
@@ -83,6 +84,16 @@
             mPrefScreen.removePreference(
                     mPrefScreen.findPreference(BUTTON_CDMA_ACTIVATE_DEVICE_KEY));
         }
+
+        // Read platform settings for carrier settings
+        final boolean isCarrierSettingsEnabled = mPrefActivity.getResources().getBoolean(
+                R.bool.config_carrier_settings_enable);
+        if (!isCarrierSettingsEnabled) {
+            Preference pref = mPrefScreen.findPreference(BUTTON_CARRIER_SETTINGS_KEY);
+            if (pref != null) {
+                mPrefScreen.removePreference(pref);
+            }
+        }
     }
 
     private boolean deviceSupportsNvAndRuim() {