Merge change 4378 into donut
* changes:
Make the Quick Launch settings show localized application names.
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);
+ }
}
/**