diff --git a/res/layout/wifi_ap_configure.xml b/res/layout/wifi_ap_configure.xml
index ecd6337..e3ddf35 100644
--- a/res/layout/wifi_ap_configure.xml
+++ b/res/layout/wifi_ap_configure.xml
@@ -109,15 +109,6 @@
                         android:layout_height="wrap_content"
                         android:layout_marginTop="2dip"
                         android:singleLine="true" />
-                <TextView android:id="@+id/client_certificate_text"
-                        style="?android:attr/textAppearanceSmallInverse"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content"
-                        android:layout_marginTop="8dip"
-                        android:text="@string/please_select_client_certificate" />
-                <Spinner android:id="@+id/client_certificate_spinner"
-                        android:layout_width="fill_parent"
-                        android:layout_height="wrap_content" />
                 <TextView android:id="@+id/ca_certificate_text"
                         style="?android:attr/textAppearanceSmallInverse"
                         android:layout_width="fill_parent"
@@ -127,13 +118,13 @@
                 <Spinner android:id="@+id/ca_certificate_spinner"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content" />
-                <TextView android:id="@+id/private_key_text"
+                <TextView android:id="@+id/client_certificate_text"
                         style="?android:attr/textAppearanceSmallInverse"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content"
                         android:layout_marginTop="8dip"
-                        android:text="@string/please_select_private_key" />
-                <Spinner android:id="@+id/private_key_spinner"
+                        android:text="@string/please_select_client_certificate" />
+                <Spinner android:id="@+id/client_certificate_spinner"
                         android:layout_width="fill_parent"
                         android:layout_height="wrap_content" />
                 <TextView android:id="@+id/private_key_passwd_text"
diff --git a/res/values/strings.xml b/res/values/strings.xml
index c6c3a2c..492ffe5 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -674,8 +674,6 @@
     <!-- Caption for the ca certificate -->
     <string name="please_select_ca_certificate">CA certificate</string>
     <!-- Caption for the Private Key -->
-    <string name="please_select_private_key">Private key</string>
-    <!-- Caption for the private key passwd -->
     <string name="please_type_private_key_passwd">Private key password</string>
     <!-- Caption for the wireless password -->
     <string name="please_type_passphrase">Wireless password</string>
@@ -1087,11 +1085,11 @@
     <!-- SD card & phone storage settings screen, setting option summary text under Internal phone storage heading -->
     <string name="master_clear_summary">Erases all data on phone</string>
     <!-- SD card & phone storage settings screen, message on screen after user selects Factory data reset -->
-    <string name="master_clear_desc">This action will reset the phone to its initial factory state, erasing all data and downloaded applications!</string>
+    <string name="master_clear_desc">Factory data reset erases all of your personal information from the phone, including details about your Google account and any other accounts, system and application data and preferences, and any applications that you have downloaded. It does not change the version of the system software and bundled applications. It does not erase any photos, music, or other information stored on an SD card.</string>
     <!-- SD card & phone storage settings screen, button on screen after user selects Factory data reset -->
     <string name="master_clear_button_text">Reset phone</string>
     <!-- SD card & phone storage settings screen, message on screen after user selects Reset phone button -->
-    <string name="master_clear_final_desc">Reset phone, erasing all your data and applications? Action cannot be reversed!</string>
+    <string name="master_clear_final_desc">Erase all of your personal information and any downloaded applications? It is impossible to reverse this action!</string>
     <!-- SD card & phone storage settings screen, button on screen after user selects Reset phone button -->
     <string name="master_clear_final_button_text">Erase everything</string>
     <!-- Message to draw an unlock pattern before clearing the device -->
@@ -1130,7 +1128,7 @@
     <string name="network_settings_summary">Set options for roaming, networks, APNs</string>
 
     <!-- Security & location settings screen, section header for settings relating to location -->
-    <string name="location_title">My Location sources</string>
+    <string name="location_title">My Location</string>
     <!-- Security & location settings screen, setting check box label if the user wants to use wireless network-based positioning (cell ID, wifi, etc.) -->
     <string name="location_network_based">Use wireless networks</string>
     <!-- Security & location settings screen, setting summary when Use wireless networks check box is clear -->
@@ -1143,9 +1141,19 @@
     <string name="location_street_level">When locating, accurate to street level (deselect to conserve battery)</string>
     <!-- Security & location settings screen, setting summary when Enable GPS satellites check box is clear -->
     <string name="location_gps_disabled">Locate to street-level (requires more battery plus view of sky)</string>
-    <!-- Title of warning dialog to user that location information will be logged -->
+    <!-- Setting title for allow sending location to google -->
+    <string name="use_location_title">Share with Google</string>
+    <!-- Title of dialog to user requesting use of location information to improve services -->
+    <string name="use_location_summary">Allow Google to use location for improved search results and other services</string>
+    <!-- Message of dialog to user requesting use of location information -->
+    <string name="use_location_warning_message">Allow Google to use location for improved search results and other services</string>
+    <!-- Agree -->
+    <string name="agree">Agree</string>
+    <!-- Disagree -->
+    <string name="disagree">Disagree</string>
 
-    <!-- About -->
+
+    <!-- About --> <skip />
     <!-- Main settings screen, setting title for the user to go into the About phone screen -->
     <string name="about_settings">About phone</string>
     <!-- Main settings screen, setting summary for the user to go into the About phone screen-->
diff --git a/res/xml/security_settings.xml b/res/xml/security_settings.xml
index 788aae3..8dd9d89 100644
--- a/res/xml/security_settings.xml
+++ b/res/xml/security_settings.xml
@@ -17,11 +17,12 @@
 <PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
 
     <PreferenceCategory
+        android:key="location_category"
         android:title="@string/location_title">
         
         <CheckBoxPreference 
             android:key="location_network" 
-            android:title="@string/location_network_based" 
+            android:title="@string/location_network_based"
             android:summaryOn="@string/location_neighborhood_level"
             android:summaryOff="@string/location_networks_disabled"/>
         
@@ -30,7 +31,13 @@
             android:title="@string/location_gps"
             android:summaryOn="@string/location_street_level"
             android:summaryOff="@string/location_gps_disabled"/>
-            
+
+        <CheckBoxPreference
+            android:key="use_location"
+            android:title="@string/use_location_title"
+            android:persistent="false"
+            android:summary="@string/use_location_summary"/>
+
     </PreferenceCategory>
             
 </PreferenceScreen>
diff --git a/src/com/android/settings/SecuritySettings.java b/src/com/android/settings/SecuritySettings.java
index ccf360a..41b4148 100644
--- a/src/com/android/settings/SecuritySettings.java
+++ b/src/com/android/settings/SecuritySettings.java
@@ -18,10 +18,14 @@
 
 
 import android.app.Activity;
+import android.app.AlertDialog;
+import android.app.Dialog;
 import android.content.ContentQueryMap;
+import android.content.ContentResolver;
 import android.content.Context;
+import android.content.DialogInterface;
 import android.content.Intent;
-import android.content.SharedPreferences;
+import android.content.pm.PackageManager.NameNotFoundException;
 import android.database.Cursor;
 import android.location.LocationManager;
 import android.net.vpn.VpnManager;
@@ -30,20 +34,22 @@
 import android.preference.Preference;
 import android.preference.PreferenceActivity;
 import android.preference.PreferenceCategory;
+import android.preference.PreferenceGroup;
 import android.preference.PreferenceScreen;
 import android.provider.Settings;
-import android.util.Config;
-import android.util.Log;
+import android.text.method.LinkMovementMethod;
+import android.widget.TextView;
+
+import com.android.internal.widget.LockPatternUtils;
 
 import java.util.Observable;
 import java.util.Observer;
 
-import com.android.internal.widget.LockPatternUtils;
-
 /**
  * Gesture lock pattern settings.
  */
-public class SecuritySettings extends PreferenceActivity {
+public class SecuritySettings extends PreferenceActivity implements
+        DialogInterface.OnDismissListener, DialogInterface.OnClickListener {
 
     // Lock Settings
     
@@ -61,10 +67,18 @@
     private CheckBoxPreference mShowPassword;
     
     // Location Settings
-    
+    private static final String LOCATION_CATEGORY = "location_category";
     private static final String LOCATION_NETWORK = "location_network";
     private static final String LOCATION_GPS = "location_gps";
 
+    // Vendor specific
+    private static final String GSETTINGS_PROVIDER = "com.google.android.providers.settings";
+    private static final String USE_LOCATION = "use_location";
+    private static final String KEY_DONE_USE_LOCATION = "doneLocation";
+    private CheckBoxPreference mUseLocation;
+    private boolean mOkClicked;
+    private Dialog mUseLocationDialog;
+
     private CheckBoxPreference mNetwork;
     private CheckBoxPreference mGps;
 
@@ -89,6 +103,17 @@
 
         mNetwork = (CheckBoxPreference) getPreferenceScreen().findPreference(LOCATION_NETWORK);
         mGps = (CheckBoxPreference) getPreferenceScreen().findPreference(LOCATION_GPS);
+        mUseLocation = (CheckBoxPreference) getPreferenceScreen().findPreference(USE_LOCATION);
+
+        // Vendor specific
+        try {
+            if (mUseLocation != null
+                    && getPackageManager().getPackageInfo(GSETTINGS_PROVIDER, 0) == null) {
+                ((PreferenceGroup)findPreference(LOCATION_CATEGORY))
+                        .removePreference(mUseLocation);
+            }
+        } catch (NameNotFoundException nnfe) {
+        }
         updateToggles();
 
         // listen for Location Manager settings changes
@@ -98,6 +123,11 @@
                 null);
         mContentQueryMap = new ContentQueryMap(settingsCursor, Settings.System.NAME, true, null);
         mContentQueryMap.addObserver(new SettingsObserver());
+        boolean doneUseLocation = savedInstanceState != null
+                && savedInstanceState.getBoolean(KEY_DONE_USE_LOCATION, true);
+        if (getIntent().getBooleanExtra("SHOW_USE_LOCATION", false) && !doneUseLocation) {
+            showUseLocationDialog(true);
+        }
     }
 
     private PreferenceScreen createPreferenceHierarchy() {
@@ -199,6 +229,23 @@
     }
 
     @Override
+    public void onPause() {
+        if (mUseLocationDialog != null && mUseLocationDialog.isShowing()) {
+            mUseLocationDialog.dismiss();
+        }
+        mUseLocationDialog = null;
+        super.onPause();
+    }
+
+    @Override
+    public void onSaveInstanceState(Bundle icicle) {
+        if (mUseLocationDialog != null && mUseLocationDialog.isShowing()) {
+            icicle.putBoolean(KEY_DONE_USE_LOCATION, false);
+        }
+        super.onSaveInstanceState(icicle);
+    }
+
+    @Override
     public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen,
             Preference preference) {
         final String key = preference.getKey();
@@ -218,25 +265,84 @@
         } else if (preference == mGps) {
             Settings.Secure.setLocationProviderEnabled(getContentResolver(),
                     LocationManager.GPS_PROVIDER, mGps.isChecked());
+        } else if (preference == mUseLocation) {
+            //normally called on the toggle click
+            if (mUseLocation.isChecked()) {
+                showUseLocationDialog(false);
+            } else {
+                updateUseLocation();
+            }
         }
 
         return false;
     }
 
+    private void showPrivacyPolicy() {
+        Intent intent = new Intent("android.settings.TERMS");
+        startActivity(intent);
+    }
+
+    private void showUseLocationDialog(boolean force) {
+        // Show a warning to the user that location data will be shared
+        mOkClicked = false;
+        if (force) {
+            mUseLocation.setChecked(true);
+        }
+        /*
+        Resources res = getResources();
+        CharSequence msg = new SpannableString(
+                res.getText(R.string.use_location_warning_message));
+        SpannableString spannable = (SpannableString) msg;
+        Annotation[] spans = spannable.getSpans(0, spannable.length(), Annotation.class);
+        if (spans != null && spans.length > 0) {
+            SpannableStringBuilder builder = new SpannableStringBuilder(spannable);
+            int start = spannable.getSpanStart(spans[0]);
+            int end = spannable.getSpanEnd(spans[0]);
+            ClickableSpan link = new ClickableSpan() {
+                @Override
+                public void onClick(View view) {
+                    showPrivacyPolicy();
+                }
+            };
+            builder.setSpan(link, start, end, spannable.getSpanFlags(link));
+            msg = builder;
+        }
+        */
+        CharSequence msg = getResources().getText(R.string.use_location_warning_message);
+        mUseLocationDialog = new AlertDialog.Builder(this).setMessage(msg)
+                .setTitle(R.string.use_location_title)
+                .setIcon(android.R.drawable.ic_dialog_alert)
+                .setPositiveButton(R.string.agree, this)
+                .setNegativeButton(R.string.disagree, this)
+                .show();
+        ((TextView)mUseLocationDialog.findViewById(android.R.id.message))
+                .setMovementMethod(LinkMovementMethod.getInstance());
+        mUseLocationDialog.setOnDismissListener(this);
+    }
+
     /*
      * Creates toggles for each available location provider
      */
     private void updateToggles() {
+        ContentResolver res = getContentResolver();
         mNetwork.setChecked(Settings.Secure.isLocationProviderEnabled(
-                getContentResolver(), LocationManager.NETWORK_PROVIDER));
+                res, LocationManager.NETWORK_PROVIDER));
         mGps.setChecked(Settings.Secure.isLocationProviderEnabled(
-                getContentResolver(), LocationManager.GPS_PROVIDER));
+                res, LocationManager.GPS_PROVIDER));
+        mUseLocation.setChecked(Settings.Gservices.getInt(res,
+                Settings.Gservices.USE_LOCATION_FOR_SERVICES, 2) == 1);
     }
 
     private boolean isToggled(Preference pref) {
         return ((CheckBoxPreference) pref).isChecked();
     }
 
+    private void updateUseLocation() {
+        boolean use = mUseLocation.isChecked();
+        Settings.Gservices.putString(getContentResolver(),
+                Settings.Gservices.USE_LOCATION_FOR_SERVICES, use ? "1" : "0");
+    }
+
 
     /**
      * For the user to disable keyguard, we first make them verify their
@@ -272,15 +378,33 @@
      * @see #confirmPatternThenDisableAndClear
      */
     @Override
-    protected void onActivityResult(int requestCode, int resultCode,
-            Intent data) {
+    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
         super.onActivityResult(requestCode, resultCode, data);
 
         final boolean resultOk = resultCode == Activity.RESULT_OK;
 
-        if ((requestCode == CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE) && resultOk) {
+        if ((requestCode == CONFIRM_PATTERN_THEN_DISABLE_AND_CLEAR_REQUEST_CODE)
+                && resultOk) {
             mLockPatternUtils.setLockPatternEnabled(false);
             mLockPatternUtils.saveLockPattern(null);
         }
     }
+
+    public void onClick(DialogInterface dialog, int which) {
+        if (which == DialogInterface.BUTTON_POSITIVE) {
+            //updateProviders();
+            mOkClicked = true;
+        } else {
+            // Reset the toggle
+            mUseLocation.setChecked(false);
+        }
+        updateUseLocation();
+    }
+
+    public void onDismiss(DialogInterface dialog) {
+        // Assuming that onClick gets called first
+        if (!mOkClicked) {
+            mUseLocation.setChecked(false);
+        }
+    }
 }
diff --git a/src/com/android/settings/vpn/L2tpIpsecEditor.java b/src/com/android/settings/vpn/L2tpIpsecEditor.java
index 2dee92e..bb63772 100644
--- a/src/com/android/settings/vpn/L2tpIpsecEditor.java
+++ b/src/com/android/settings/vpn/L2tpIpsecEditor.java
@@ -34,7 +34,6 @@
 
     private ListPreference mUserCertificate;
     private ListPreference mCaCertificate;
-    private ListPreference mUserkey;
 
     private L2tpIpsecProfile mProfile;
 
@@ -46,7 +45,6 @@
     @Override
     protected void loadExtraPreferencesTo(PreferenceGroup subpanel) {
         Context c = subpanel.getContext();
-        subpanel.addPreference(createUserkeyPreference(c));
         subpanel.addPreference(createUserCertificatePreference(c));
         subpanel.addPreference(createCaCertificatePreference(c));
     }
@@ -56,8 +54,6 @@
         String result = super.validate(c);
         if (result != null) {
             return result;
-        } else if (Util.isNullOrEmpty(mUserkey.getValue())) {
-            return c.getString(R.string.vpn_error_userkey_not_selected);
         } else if (Util.isNullOrEmpty(mUserCertificate.getValue())) {
             return c.getString(R.string.vpn_error_user_certificate_not_selected);
         } else if (Util.isNullOrEmpty(mCaCertificate.getValue())) {
@@ -71,7 +67,7 @@
         mUserCertificate = createListPreference(c,
                 R.string.vpn_user_certificate_title,
                 mProfile.getUserCertificate(),
-                Keystore.getInstance().getAllCertificateKeys(),
+                Keystore.getInstance().getAllUserCertificateKeys(),
                 new Preference.OnPreferenceChangeListener() {
                     public boolean onPreferenceChange(
                             Preference pref, Object newValue) {
@@ -86,7 +82,7 @@
         mCaCertificate = createListPreference(c,
                 R.string.vpn_ca_certificate_title,
                 mProfile.getCaCertificate(),
-                Keystore.getInstance().getAllCertificateKeys(),
+                Keystore.getInstance().getAllCaCertificateKeys(),
                 new Preference.OnPreferenceChangeListener() {
                     public boolean onPreferenceChange(
                             Preference pref, Object newValue) {
@@ -97,21 +93,6 @@
         return mCaCertificate;
     }
 
-    private Preference createUserkeyPreference(Context c) {
-        mUserkey = createListPreference(c,
-                R.string.vpn_userkey_title,
-                mProfile.getUserkey(),
-                Keystore.getInstance().getAllUserkeyKeys(),
-                new Preference.OnPreferenceChangeListener() {
-                    public boolean onPreferenceChange(
-                            Preference pref, Object newValue) {
-                        mProfile.setUserkey((String) newValue);
-                        return onPreferenceChangeCommon(pref, newValue);
-                    }
-                });
-        return mUserkey;
-    }
-
     private ListPreference createListPreference(Context c, int titleResId,
             String text, String[] keys,
             Preference.OnPreferenceChangeListener listener) {
diff --git a/src/com/android/settings/wifi/AccessPointDialog.java b/src/com/android/settings/wifi/AccessPointDialog.java
index 572ca85..43081a5 100644
--- a/src/com/android/settings/wifi/AccessPointDialog.java
+++ b/src/com/android/settings/wifi/AccessPointDialog.java
@@ -111,16 +111,13 @@
     private EditText mIdentityEdit;
     private TextView mAnonymousIdentityText;
     private EditText mAnonymousIdentityEdit;
-    private TextView mClientCertText;
-    private Spinner mClientCertSpinner;
     private TextView mCaCertText;
     private Spinner mCaCertSpinner;
-    private TextView mPrivateKeyText;
-    private Spinner mPrivateKeySpinner;
+    private TextView mClientCertText;
+    private Spinner mClientCertSpinner;
     private TextView mPrivateKeyPasswdText;
     private EditText mPrivateKeyPasswdEdit;
     private EditText[] mEnterpriseTextFields;
-    private Spinner[] mEnterpriseSpinnerFields;
 
     
     // Info-specific views
@@ -330,23 +327,20 @@
             mEapSpinner.setSelection(getSelectionIndex(
                     R.array.wifi_eap_entries, mState.getEap()));
             mClientCertSpinner.setSelection(getSelectionIndex(
-                    getAllCertificateKeys(), mState.getEnterpriseField(
+                    getAllUserCertificateKeys(), mState.getEnterpriseField(
                     AccessPointState.CLIENT_CERT)));
             mCaCertSpinner.setSelection(getSelectionIndex(
-                    getAllCertificateKeys(), mState.getEnterpriseField(
+                    getAllCaCertificateKeys(), mState.getEnterpriseField(
                     AccessPointState.CA_CERT)));
-            mPrivateKeySpinner.setSelection(getSelectionIndex(
-                    getAllUserkeyKeys(), mState.getEnterpriseField(
-                    AccessPointState.PRIVATE_KEY)));
         }
     }
 
-    private String[] getAllCertificateKeys() {
-        return appendEmptyInSelection(mKeystore.getAllCertificateKeys());
+    private String[] getAllCaCertificateKeys() {
+        return appendEmptyInSelection(mKeystore.getAllCaCertificateKeys());
     }
 
-    private String[] getAllUserkeyKeys() {
-        return appendEmptyInSelection(mKeystore.getAllUserkeyKeys());
+    private String[] getAllUserCertificateKeys() {
+        return appendEmptyInSelection(mKeystore.getAllUserCertificateKeys());
     }
 
     private String[] appendEmptyInSelection(String[] keys) {
@@ -367,9 +361,6 @@
         mClientCertText =
                 (TextView) view.findViewById(R.id.client_certificate_text);
         mCaCertText = (TextView) view.findViewById(R.id.ca_certificate_text);
-        mPrivateKeyText = (TextView) view.findViewById(R.id.private_key_text);
-        mPrivateKeyPasswdText =
-                (TextView) view.findViewById(R.id.private_key_passwd_text);
         mPrivateKeyPasswdEdit =
                 (EditText) view.findViewById(R.id.private_key_passwd_edit);
         mEapText = (TextView) view.findViewById(R.id.eap_text);
@@ -389,28 +380,18 @@
         mClientCertSpinner.setOnItemSelectedListener(this);
         mClientCertSpinner.setPromptId(
                 R.string.please_select_client_certificate);
-        setSpinnerAdapter(mClientCertSpinner, getAllCertificateKeys());
+        setSpinnerAdapter(mClientCertSpinner, getAllUserCertificateKeys());
 
         mCaCertSpinner =
                 (Spinner) view.findViewById(R.id.ca_certificate_spinner);
         mCaCertSpinner.setOnItemSelectedListener(this);
         mCaCertSpinner.setPromptId(R.string.please_select_ca_certificate);
-        setSpinnerAdapter(mCaCertSpinner, getAllCertificateKeys());
-
-        mPrivateKeySpinner =
-                (Spinner) view.findViewById(R.id.private_key_spinner);
-        mPrivateKeySpinner.setOnItemSelectedListener(this);
-        mPrivateKeySpinner.setPromptId(R.string.please_select_private_key);
-        setSpinnerAdapter(mPrivateKeySpinner, getAllUserkeyKeys());
+        setSpinnerAdapter(mCaCertSpinner, getAllCaCertificateKeys());
 
         mEnterpriseTextFields = new EditText[] {
             mIdentityEdit, mAnonymousIdentityEdit, mPrivateKeyPasswdEdit
         };
 
-        mEnterpriseSpinnerFields = new Spinner[] {
-            mClientCertSpinner, mCaCertSpinner, mPrivateKeySpinner
-        };
-
     }
 
     private void setSpinnerAdapter(Spinner spinner, String[] items) {
@@ -655,48 +636,55 @@
     }
 
     private void updateEnterpriseFields(int securityType) {
-            int i;
-            for (i = AccessPointState.IDENTITY ;
-                i < AccessPointState.MAX_ENTRPRISE_FIELD ; i++) {
-                String value;
-                if (i <= AccessPointState.PRIVATE_KEY_PASSWD) {
-                    value = mEnterpriseTextFields[i].getText().toString();
-                } else {
-                    Spinner spinner =  mEnterpriseSpinnerFields[i -
-                        AccessPointState.CLIENT_CERT];
-                    int index = spinner.getSelectedItemPosition();
-                    if (index == (spinner.getCount() - 1)) {
-                        value = "";
-                    } else {
-                        if (i != AccessPointState.PRIVATE_KEY) {
-                            value = mKeystore.getCertificate(
-                                    getAllCertificateKeys()[index]);
-                        } else {
-                            value = mKeystore.getUserkey(
-                                    getAllUserkeyKeys()[index]);
-                        }
-                    }
-                }
-                if (!TextUtils.isEmpty(value) ||
-                        (i == AccessPointState.PRIVATE_KEY_PASSWD)) {
-                    mState.setEnterpriseField(i, value);
-                }
+        int i;
+        String value;
+        for (i = AccessPointState.IDENTITY ;
+                i <= AccessPointState.PRIVATE_KEY_PASSWD ; i++) {
+            value = mEnterpriseTextFields[i].getText().toString();
+            if (!TextUtils.isEmpty(value) ||
+                    (i == AccessPointState.PRIVATE_KEY_PASSWD)) {
+                mState.setEnterpriseField(i, value);
             }
-
-            switch (securityType) {
-                case SECURITY_WPA_EAP: {
-                    mState.setSecurity(AccessPointState.WPA_EAP);
-                    mState.setEap(mEapSpinner.getSelectedItemPosition());
-                    break;
-                }
-                case SECURITY_IEEE8021X: {
-                    mState.setSecurity(AccessPointState.IEEE8021X);
-                    mState.setEap(mEapSpinner.getSelectedItemPosition());
-                  break;
-                }
-                default:
-                    mState.setSecurity(AccessPointState.OPEN);
+        }
+        Spinner spinner = mClientCertSpinner;
+        int index = spinner.getSelectedItemPosition();
+        if (index != (spinner.getCount() - 1)) {
+            String key = getAllUserCertificateKeys()[index];
+            value = mKeystore.getUserCertificate(key);
+            if (!TextUtils.isEmpty(value)) {
+                mState.setEnterpriseField(AccessPointState.CLIENT_CERT,
+                        value);
             }
+            value = mKeystore.getUserPrivateKey(key);
+            if (!TextUtils.isEmpty(value)) {
+                mState.setEnterpriseField(AccessPointState.PRIVATE_KEY,
+                        value);
+            }
+        }
+        spinner = mCaCertSpinner;
+        index = spinner.getSelectedItemPosition();
+        if (index != (spinner.getCount() - 1)) {
+            String key = getAllCaCertificateKeys()[index];
+            value = mKeystore.getCaCertificate(key);
+            if (!TextUtils.isEmpty(value)) {
+                mState.setEnterpriseField(AccessPointState.CA_CERT,
+                        value);
+            }
+        }
+        switch (securityType) {
+            case SECURITY_WPA_EAP: {
+                mState.setSecurity(AccessPointState.WPA_EAP);
+                mState.setEap(mEapSpinner.getSelectedItemPosition());
+                break;
+            }
+            case SECURITY_IEEE8021X: {
+                mState.setSecurity(AccessPointState.IEEE8021X);
+                mState.setEap(mEapSpinner.getSelectedItemPosition());
+                break;
+            }
+            default:
+                mState.setSecurity(AccessPointState.OPEN);
+        }
     }
 
     /**
