am eb7836f1
: Apply the new keystore and certtool library in Wifi setting.
Merge commit 'eb7836f11ec4e9753db7c6ecd9414e153bb7bdbe' * commit 'eb7836f11ec4e9753db7c6ecd9414e153bb7bdbe': Apply the new keystore and certtool library in Wifi setting.
This commit is contained in:
committed by
The Android Open Source Project
commit
bd7f05701a
@@ -66,7 +66,7 @@
|
|||||||
<LinearLayout android:id="@+id/enterprise_wrapper"
|
<LinearLayout android:id="@+id/enterprise_wrapper"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:padding="8dip"
|
android:padding="0dip"
|
||||||
android:orientation="vertical">
|
android:orientation="vertical">
|
||||||
<TextView android:id="@+id/eap_text"
|
<TextView android:id="@+id/eap_text"
|
||||||
style="?android:attr/textAppearanceSmallInverse"
|
style="?android:attr/textAppearanceSmallInverse"
|
||||||
@@ -87,28 +87,6 @@
|
|||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
android:layout_height="wrap_content" />
|
android:layout_height="wrap_content" />
|
||||||
|
|
||||||
<TextView android:id="@+id/identity_text"
|
|
||||||
style="?android:attr/textAppearanceSmallInverse"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dip"
|
|
||||||
android:text="@string/please_type_identity" />
|
|
||||||
<EditText android:id="@+id/identity_edit"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dip"
|
|
||||||
android:singleLine="true" />
|
|
||||||
<TextView android:id="@+id/anonymous_identity_text"
|
|
||||||
style="?android:attr/textAppearanceSmallInverse"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="8dip"
|
|
||||||
android:text="@string/please_type_anonymous_identity" />
|
|
||||||
<EditText android:id="@+id/anonymous_identity_edit"
|
|
||||||
android:layout_width="fill_parent"
|
|
||||||
android:layout_height="wrap_content"
|
|
||||||
android:layout_marginTop="2dip"
|
|
||||||
android:singleLine="true" />
|
|
||||||
<TextView android:id="@+id/ca_certificate_text"
|
<TextView android:id="@+id/ca_certificate_text"
|
||||||
style="?android:attr/textAppearanceSmallInverse"
|
style="?android:attr/textAppearanceSmallInverse"
|
||||||
android:layout_width="fill_parent"
|
android:layout_width="fill_parent"
|
||||||
@@ -138,6 +116,28 @@
|
|||||||
android:layout_height="wrap_content"
|
android:layout_height="wrap_content"
|
||||||
android:layout_marginTop="2dip"
|
android:layout_marginTop="2dip"
|
||||||
android:singleLine="true" />
|
android:singleLine="true" />
|
||||||
|
<TextView android:id="@+id/identity_text"
|
||||||
|
style="?android:attr/textAppearanceSmallInverse"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dip"
|
||||||
|
android:text="@string/please_type_identity" />
|
||||||
|
<EditText android:id="@+id/identity_edit"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dip"
|
||||||
|
android:singleLine="true" />
|
||||||
|
<TextView android:id="@+id/anonymous_identity_text"
|
||||||
|
style="?android:attr/textAppearanceSmallInverse"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="8dip"
|
||||||
|
android:text="@string/please_type_anonymous_identity" />
|
||||||
|
<EditText android:id="@+id/anonymous_identity_edit"
|
||||||
|
android:layout_width="fill_parent"
|
||||||
|
android:layout_height="wrap_content"
|
||||||
|
android:layout_marginTop="2dip"
|
||||||
|
android:singleLine="true" />
|
||||||
</LinearLayout>
|
</LinearLayout>
|
||||||
|
|
||||||
<!-- Password -->
|
<!-- Password -->
|
||||||
|
@@ -17,11 +17,14 @@
|
|||||||
package com.android.settings.wifi;
|
package com.android.settings.wifi;
|
||||||
|
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.SecuritySettings;
|
||||||
|
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
|
import android.content.Intent;
|
||||||
import android.content.res.Resources;
|
import android.content.res.Resources;
|
||||||
|
import android.security.CertTool;
|
||||||
import android.security.Keystore;
|
import android.security.Keystore;
|
||||||
import android.net.wifi.WifiInfo;
|
import android.net.wifi.WifiInfo;
|
||||||
import android.net.wifi.WifiManager;
|
import android.net.wifi.WifiManager;
|
||||||
@@ -129,13 +132,13 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
private TextView mSecurityText;
|
private TextView mSecurityText;
|
||||||
private Spinner mSecuritySpinner;
|
private Spinner mSecuritySpinner;
|
||||||
private Spinner mWepTypeSpinner;
|
private Spinner mWepTypeSpinner;
|
||||||
private Keystore mKeystore;
|
private CertTool mCertTool;
|
||||||
|
|
||||||
public AccessPointDialog(Context context, WifiLayer wifiLayer) {
|
public AccessPointDialog(Context context, WifiLayer wifiLayer) {
|
||||||
super(context);
|
super(context);
|
||||||
|
|
||||||
mWifiLayer = wifiLayer;
|
mWifiLayer = wifiLayer;
|
||||||
mKeystore = Keystore.getInstance();
|
mCertTool = CertTool.getInstance();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -240,7 +243,7 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
setEnterpriseFieldsVisible(false);
|
setEnterpriseFieldsVisible(false);
|
||||||
|
|
||||||
} else if (mMode == MODE_INFO) {
|
} else if (mMode == MODE_INFO) {
|
||||||
if (isEnterprise() && !mState.configured) {
|
if (mState.isEnterprise() && !mState.configured) {
|
||||||
setLayout(R.layout.wifi_ap_configure);
|
setLayout(R.layout.wifi_ap_configure);
|
||||||
defaultPasswordVisibility = false;
|
defaultPasswordVisibility = false;
|
||||||
setEnterpriseFieldsVisible(true);
|
setEnterpriseFieldsVisible(true);
|
||||||
@@ -287,16 +290,6 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
setButtons(positiveButtonResId, negativeButtonResId, neutralButtonResId);
|
setButtons(positiveButtonResId, negativeButtonResId, neutralButtonResId);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean isEnterprise() {
|
|
||||||
|
|
||||||
if(AccessPointState.WPA_EAP.equals(mState.security) ||
|
|
||||||
AccessPointState.IEEE8021X.equals(mState.security)) {
|
|
||||||
return true;
|
|
||||||
} else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/** Called when we need to set our member variables to point to the views. */
|
/** Called when we need to set our member variables to point to the views. */
|
||||||
private void onReferenceViews(View view) {
|
private void onReferenceViews(View view) {
|
||||||
mPasswordText = (TextView) view.findViewById(R.id.password_text);
|
mPasswordText = (TextView) view.findViewById(R.id.password_text);
|
||||||
@@ -322,7 +315,8 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
mTable = (ViewGroup) view.findViewById(R.id.table);
|
mTable = (ViewGroup) view.findViewById(R.id.table);
|
||||||
}
|
}
|
||||||
/* for enterprise one */
|
/* for enterprise one */
|
||||||
if (mMode == MODE_CONFIGURE || (isEnterprise() && !mState.configured)) {
|
if (mMode == MODE_CONFIGURE ||
|
||||||
|
(mState.isEnterprise() && !mState.configured)) {
|
||||||
setEnterpriseFields(view);
|
setEnterpriseFields(view);
|
||||||
mEapSpinner.setSelection(getSelectionIndex(
|
mEapSpinner.setSelection(getSelectionIndex(
|
||||||
R.array.wifi_eap_entries, mState.getEap()));
|
R.array.wifi_eap_entries, mState.getEap()));
|
||||||
@@ -336,15 +330,14 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
}
|
}
|
||||||
|
|
||||||
private String[] getAllCaCertificateKeys() {
|
private String[] getAllCaCertificateKeys() {
|
||||||
return appendEmptyInSelection(mKeystore.getAllCaCertificateKeys());
|
return appendEmptyInSelection(mCertTool.getAllCaCertificateKeys());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] getAllUserCertificateKeys() {
|
private String[] getAllUserCertificateKeys() {
|
||||||
return appendEmptyInSelection(mKeystore.getAllUserCertificateKeys());
|
return appendEmptyInSelection(mCertTool.getAllUserCertificateKeys());
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] appendEmptyInSelection(String[] keys) {
|
private String[] appendEmptyInSelection(String[] keys) {
|
||||||
if (keys.length == 0) return keys;
|
|
||||||
String[] selections = new String[keys.length + 1];
|
String[] selections = new String[keys.length + 1];
|
||||||
System.arraycopy(keys, 0, selections, 0, keys.length);
|
System.arraycopy(keys, 0, selections, 0, keys.length);
|
||||||
selections[keys.length] = NOT_APPLICABLE;
|
selections[keys.length] = NOT_APPLICABLE;
|
||||||
@@ -436,9 +429,10 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
if (!TextUtils.isEmpty(ssid)) {
|
if (!TextUtils.isEmpty(ssid)) {
|
||||||
mSsidEdit.setText(ssid);
|
mSsidEdit.setText(ssid);
|
||||||
}
|
}
|
||||||
|
if (mState.configured) {
|
||||||
mPasswordEdit.setHint(R.string.wifi_password_unchanged);
|
mPasswordEdit.setHint(R.string.wifi_password_unchanged);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
updatePasswordCaption(mState.security);
|
updatePasswordCaption(mState.security);
|
||||||
}
|
}
|
||||||
@@ -505,15 +499,15 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
Log.w(TAG, "Assuming connecting to a new network.");
|
Log.w(TAG, "Assuming connecting to a new network.");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEnterprise()) {
|
if (mState.isEnterprise()) {
|
||||||
if(!mState.configured) {
|
if(!mState.configured) {
|
||||||
updateEnterpriseFields(
|
updateEnterpriseFields(
|
||||||
AccessPointState.WPA_EAP.equals(mState.security) ?
|
AccessPointState.WPA_EAP.equals(mState.security) ?
|
||||||
SECURITY_WPA_EAP : SECURITY_IEEE8021X);
|
SECURITY_WPA_EAP : SECURITY_IEEE8021X);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
updatePasswordField();
|
|
||||||
}
|
}
|
||||||
|
updatePasswordField();
|
||||||
|
|
||||||
mWifiLayer.connectToNetwork(mState);
|
mWifiLayer.connectToNetwork(mState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -559,56 +553,51 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
|
|
||||||
int securityType = getSecurityTypeFromSpinner();
|
int securityType = getSecurityTypeFromSpinner();
|
||||||
|
|
||||||
if (!TextUtils.isEmpty(password)) {
|
if (!TextUtils.isEmpty(password) && (securityType != SECURITY_WEP)) {
|
||||||
switch (securityType) {
|
mState.setPassword(password);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (securityType) {
|
||||||
case SECURITY_WPA_PERSONAL: {
|
case SECURITY_WPA_PERSONAL: {
|
||||||
mState.setSecurity(AccessPointState.WPA);
|
mState.setSecurity(AccessPointState.WPA);
|
||||||
mState.setPassword(password);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SECURITY_WPA2_PERSONAL: {
|
case SECURITY_WPA2_PERSONAL: {
|
||||||
mState.setSecurity(AccessPointState.WPA2);
|
mState.setSecurity(AccessPointState.WPA2);
|
||||||
mState.setPassword(password);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SECURITY_AUTO: {
|
case SECURITY_AUTO: {
|
||||||
mState.setPassword(password);
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
case SECURITY_WEP: {
|
case SECURITY_WEP: {
|
||||||
mState.setSecurity(AccessPointState.WEP);
|
mState.setSecurity(AccessPointState.WEP);
|
||||||
mState.setPassword(password,
|
mState.setPassword(password, WEP_TYPE_VALUES[
|
||||||
WEP_TYPE_VALUES[mWepTypeSpinner.getSelectedItemPosition()]);
|
mWepTypeSpinner.getSelectedItemPosition()]);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
switch (securityType) {
|
|
||||||
case SECURITY_WPA_EAP:
|
case SECURITY_WPA_EAP:
|
||||||
mState.setSecurity(AccessPointState.WPA_EAP);
|
mState.setSecurity(AccessPointState.WPA_EAP);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case SECURITY_IEEE8021X:
|
case SECURITY_IEEE8021X:
|
||||||
mState.setSecurity(AccessPointState.IEEE8021X);
|
mState.setSecurity(AccessPointState.IEEE8021X);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case SECURITY_NONE:
|
||||||
default:
|
default:
|
||||||
mState.setSecurity(AccessPointState.OPEN);
|
mState.setSecurity(AccessPointState.OPEN);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (isEnterprise() && !mState.configured) {
|
|
||||||
|
if (mState.isEnterprise() && !mState.configured) {
|
||||||
updateEnterpriseFields(
|
updateEnterpriseFields(
|
||||||
AccessPointState.WPA_EAP.equals(mState.security) ?
|
AccessPointState.WPA_EAP.equals(mState.security) ?
|
||||||
SECURITY_WPA_EAP : SECURITY_IEEE8021X);
|
SECURITY_WPA_EAP : SECURITY_IEEE8021X);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (securityType == SECURITY_NONE) {
|
|
||||||
mState.setSecurity(AccessPointState.OPEN);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mWifiLayer.saveNetwork(mState)) {
|
if (!mWifiLayer.saveNetwork(mState)) {
|
||||||
return;
|
return;
|
||||||
@@ -649,13 +638,13 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
Spinner spinner = mClientCertSpinner;
|
Spinner spinner = mClientCertSpinner;
|
||||||
int index = spinner.getSelectedItemPosition();
|
int index = spinner.getSelectedItemPosition();
|
||||||
if (index != (spinner.getCount() - 1)) {
|
if (index != (spinner.getCount() - 1)) {
|
||||||
String key = getAllUserCertificateKeys()[index];
|
String key = (String)spinner.getSelectedItem();
|
||||||
value = mKeystore.getUserCertificate(key);
|
value = mCertTool.getUserCertificate(key);
|
||||||
if (!TextUtils.isEmpty(value)) {
|
if (!TextUtils.isEmpty(value)) {
|
||||||
mState.setEnterpriseField(AccessPointState.CLIENT_CERT,
|
mState.setEnterpriseField(AccessPointState.CLIENT_CERT,
|
||||||
value);
|
value);
|
||||||
}
|
}
|
||||||
value = mKeystore.getUserPrivateKey(key);
|
value = mCertTool.getUserPrivateKey(key);
|
||||||
if (!TextUtils.isEmpty(value)) {
|
if (!TextUtils.isEmpty(value)) {
|
||||||
mState.setEnterpriseField(AccessPointState.PRIVATE_KEY,
|
mState.setEnterpriseField(AccessPointState.PRIVATE_KEY,
|
||||||
value);
|
value);
|
||||||
@@ -664,8 +653,8 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
spinner = mCaCertSpinner;
|
spinner = mCaCertSpinner;
|
||||||
index = spinner.getSelectedItemPosition();
|
index = spinner.getSelectedItemPosition();
|
||||||
if (index != (spinner.getCount() - 1)) {
|
if (index != (spinner.getCount() - 1)) {
|
||||||
String key = getAllCaCertificateKeys()[index];
|
String key = (String)spinner.getSelectedItem();
|
||||||
value = mKeystore.getCaCertificate(key);
|
value = mCertTool.getCaCertificate(key);
|
||||||
if (!TextUtils.isEmpty(value)) {
|
if (!TextUtils.isEmpty(value)) {
|
||||||
mState.setEnterpriseField(AccessPointState.CA_CERT,
|
mState.setEnterpriseField(AccessPointState.CA_CERT,
|
||||||
value);
|
value);
|
||||||
@@ -738,7 +727,6 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
mEnterpriseView.setVisibility(visibility);
|
mEnterpriseView.setVisibility(visibility);
|
||||||
if (visible) {
|
if (visible) {
|
||||||
setWepVisible(false);
|
setWepVisible(false);
|
||||||
setGenericPasswordVisible(false);
|
|
||||||
}
|
}
|
||||||
if (mMode != MODE_CONFIGURE) {
|
if (mMode != MODE_CONFIGURE) {
|
||||||
mSsidText.setVisibility(View.GONE);
|
mSsidText.setVisibility(View.GONE);
|
||||||
@@ -792,7 +780,17 @@ public class AccessPointDialog extends AlertDialog implements DialogInterface.On
|
|||||||
}
|
}
|
||||||
case SECURITY_WPA_EAP:
|
case SECURITY_WPA_EAP:
|
||||||
case SECURITY_IEEE8021X: {
|
case SECURITY_IEEE8021X: {
|
||||||
|
// Unlock the keystore if it is not unlocked yet.
|
||||||
|
if (Keystore.getInstance().getState() != Keystore.UNLOCKED) {
|
||||||
|
getContext().startActivity(new Intent(
|
||||||
|
SecuritySettings.ACTION_UNLOCK_CREDENTIAL_STORAGE));
|
||||||
|
mSecuritySpinner.setSelection(0);
|
||||||
|
return;
|
||||||
|
}
|
||||||
setEnterpriseFieldsVisible(true);
|
setEnterpriseFieldsVisible(true);
|
||||||
|
setGenericPasswordVisible(true);
|
||||||
|
// Both WPA and WPA2 show the same caption, so either is ok
|
||||||
|
updatePasswordCaption(AccessPointState.WPA);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -277,6 +277,11 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isEnterprise() {
|
||||||
|
return (WPA_EAP.equals(security) ||
|
||||||
|
AccessPointState.IEEE8021X.equals(security));
|
||||||
|
}
|
||||||
|
|
||||||
public void setSecurity(String security) {
|
public void setSecurity(String security) {
|
||||||
if (TextUtils.isEmpty(this.security) || !this.security.equals(security)) {
|
if (TextUtils.isEmpty(this.security) || !this.security.equals(security)) {
|
||||||
this.security = security;
|
this.security = security;
|
||||||
@@ -592,15 +597,18 @@ public final class AccessPointState implements Comparable<AccessPointState>, Par
|
|||||||
|
|
||||||
} else if (security.equals(OPEN)) {
|
} else if (security.equals(OPEN)) {
|
||||||
config.allowedKeyManagement.set(KeyMgmt.NONE);
|
config.allowedKeyManagement.set(KeyMgmt.NONE);
|
||||||
} else if (security.equals(WPA_EAP)) {
|
} else if (security.equals(WPA_EAP) || security.equals(IEEE8021X)) {
|
||||||
config.allowedGroupCiphers.set(GroupCipher.TKIP);
|
config.allowedGroupCiphers.set(GroupCipher.TKIP);
|
||||||
config.allowedGroupCiphers.set(GroupCipher.CCMP);
|
config.allowedGroupCiphers.set(GroupCipher.CCMP);
|
||||||
|
if (security.equals(WPA_EAP)) {
|
||||||
config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
|
config.allowedKeyManagement.set(KeyMgmt.WPA_EAP);
|
||||||
} else if (security.equals(IEEE8021X)) {
|
} else {
|
||||||
config.allowedGroupCiphers.set(GroupCipher.TKIP);
|
|
||||||
config.allowedGroupCiphers.set(GroupCipher.CCMP);
|
|
||||||
config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
|
config.allowedKeyManagement.set(KeyMgmt.IEEE8021X);
|
||||||
}
|
}
|
||||||
|
if (!TextUtils.isEmpty(mPassword)) {
|
||||||
|
config.password = convertToQuotedString(mPassword);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static boolean isHexWepKey(String wepKey) {
|
private static boolean isHexWepKey(String wepKey) {
|
||||||
|
@@ -18,6 +18,7 @@ package com.android.settings.wifi;
|
|||||||
|
|
||||||
import com.android.settings.ProgressCategory;
|
import com.android.settings.ProgressCategory;
|
||||||
import com.android.settings.R;
|
import com.android.settings.R;
|
||||||
|
import com.android.settings.SecuritySettings;
|
||||||
|
|
||||||
import android.app.Dialog;
|
import android.app.Dialog;
|
||||||
import android.content.DialogInterface;
|
import android.content.DialogInterface;
|
||||||
@@ -29,6 +30,7 @@ import android.preference.PreferenceActivity;
|
|||||||
import android.preference.PreferenceScreen;
|
import android.preference.PreferenceScreen;
|
||||||
import android.preference.CheckBoxPreference;
|
import android.preference.CheckBoxPreference;
|
||||||
import android.provider.Settings;
|
import android.provider.Settings;
|
||||||
|
import android.security.Keystore;
|
||||||
import android.util.Log;
|
import android.util.Log;
|
||||||
import android.view.ContextMenu;
|
import android.view.ContextMenu;
|
||||||
import android.view.Menu;
|
import android.view.Menu;
|
||||||
@@ -352,6 +354,12 @@ public class WifiSettings extends PreferenceActivity implements WifiLayer.Callba
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showAccessPointDialog(AccessPointState state, int mode) {
|
public void showAccessPointDialog(AccessPointState state, int mode) {
|
||||||
|
if (state.isEnterprise() &&
|
||||||
|
Keystore.getInstance().getState() != Keystore.UNLOCKED) {
|
||||||
|
startActivity(new Intent(
|
||||||
|
SecuritySettings.ACTION_UNLOCK_CREDENTIAL_STORAGE));
|
||||||
|
return;
|
||||||
|
}
|
||||||
AccessPointDialog dialog = new AccessPointDialog(this, mWifiLayer);
|
AccessPointDialog dialog = new AccessPointDialog(this, mWifiLayer);
|
||||||
dialog.setMode(mode);
|
dialog.setMode(mode);
|
||||||
dialog.setState(state);
|
dialog.setState(state);
|
||||||
|
Reference in New Issue
Block a user