Merge "VpnSettings: rename some fields."
diff --git a/res/layout/vpn_dialog.xml b/res/layout/vpn_dialog.xml
index 3e4b441..a4bb216 100644
--- a/res/layout/vpn_dialog.xml
+++ b/res/layout/vpn_dialog.xml
@@ -93,8 +93,8 @@
android:prompt="@string/vpn_ipsec_ca_cert" />
</LinearLayout>
- <TextView style="@style/vpn_label" android:text="@string/vpn_domains"/>
- <EditText style="@style/vpn_value" android:id="@+id/domains"
+ <TextView style="@style/vpn_label" android:text="@string/vpn_search_domains"/>
+ <EditText style="@style/vpn_value" android:id="@+id/search_domains"
android:hint="@string/vpn_not_used"/>
<!-- Not sure if we have time to make it. -->
diff --git a/res/values/strings.xml b/res/values/strings.xml
index 2aaa197..d0e85d2 100644
--- a/res/values/strings.xml
+++ b/res/values/strings.xml
@@ -3511,7 +3511,7 @@
<!-- Selection label for the IPSec CA certificate of a VPN network. [CHAR LIMIT=40] -->
<string name="vpn_ipsec_ca_cert">IPSec CA certificate</string>
<!-- Input label for the DNS search domains of a VPN network. [CHAR LIMIT=40] -->
- <string name="vpn_domains">DNS search domains</string>
+ <string name="vpn_search_domains">DNS search domains</string>
<!-- Input label for the forwarding routes of a VPN network. [CHAR LIMIT=40] -->
<string name="vpn_routes">Forwarding routes</string>
<!-- Input label for the username of a VPN network. [CHAR LIMIT=40] -->
@@ -3519,7 +3519,7 @@
<!-- Input label for the password of a VPN network. [CHAR LIMIT=40] -->
<string name="vpn_password">Password</string>
<!-- Checkbox label to save the username and the password for a VPN network. [CHAR LIMIT=40] -->
- <string name="vpn_save_login">Save this information</string>
+ <string name="vpn_save_login">Save account information</string>
<!-- Hint for an optional input of a VPN network. [CHAR LIMIT=40] -->
<string name="vpn_not_used">(not used)</string>
diff --git a/src/com/android/settings/vpn2/VpnDialog.java b/src/com/android/settings/vpn2/VpnDialog.java
index 92ad362..2914b1b 100644
--- a/src/com/android/settings/vpn2/VpnDialog.java
+++ b/src/com/android/settings/vpn2/VpnDialog.java
@@ -60,7 +60,7 @@
private TextView mServer;
private TextView mUsername;
private TextView mPassword;
- private TextView mDomains;
+ private TextView mSearchDomains;
private TextView mRoutes;
private CheckBox mMppe;
private TextView mL2tpSecret;
@@ -92,7 +92,7 @@
mServer = (TextView) mView.findViewById(R.id.server);
mUsername = (TextView) mView.findViewById(R.id.username);
mPassword = (TextView) mView.findViewById(R.id.password);
- mDomains = (TextView) mView.findViewById(R.id.domains);
+ mSearchDomains = (TextView) mView.findViewById(R.id.search_domains);
mRoutes = (TextView) mView.findViewById(R.id.routes);
mMppe = (CheckBox) mView.findViewById(R.id.mppe);
mL2tpSecret = (TextView) mView.findViewById(R.id.l2tp_secret);
@@ -108,7 +108,7 @@
mServer.setText(mProfile.server);
mUsername.setText(mProfile.username);
mPassword.setText(getDummy(mProfile.password));
- mDomains.setText(mProfile.domains);
+ mSearchDomains.setText(mProfile.searchDomains);
mRoutes.setText(mProfile.routes);
mMppe.setChecked(mProfile.mppe);
mL2tpSecret.setText(getDummy(mProfile.l2tpSecret));
@@ -288,7 +288,7 @@
profile.server = mServer.getText().toString().trim();
profile.username = mUsername.getText().toString();
profile.password = getSecret(mProfile.password, mPassword);
- profile.domains = mDomains.getText().toString().trim();
+ profile.searchDomains = mSearchDomains.getText().toString().trim();
profile.routes = mRoutes.getText().toString().trim();
// Then, save type-specific fields.
diff --git a/src/com/android/settings/vpn2/VpnProfile.java b/src/com/android/settings/vpn2/VpnProfile.java
index 9e4c528..24c2f5f 100644
--- a/src/com/android/settings/vpn2/VpnProfile.java
+++ b/src/com/android/settings/vpn2/VpnProfile.java
@@ -42,14 +42,15 @@
String server = ""; // 2
String username = ""; // 3
String password = ""; // 4
- String domains = ""; // 5
- String routes = ""; // 6
- boolean mppe = false; // 7
- String l2tpSecret = ""; // 8
- String ipsecIdentifier = "";// 9
- String ipsecSecret = ""; // 10
- String ipsecUserCert = ""; // 11
- String ipsecCaCert = ""; // 12
+ String dnsServers = ""; // 5
+ String searchDomains = ""; // 6
+ String routes = ""; // 7
+ boolean mppe = false; // 8
+ String l2tpSecret = ""; // 9
+ String ipsecIdentifier = "";// 10
+ String ipsecSecret = ""; // 11
+ String ipsecUserCert = ""; // 12
+ String ipsecCaCert = ""; // 13
// Helper fields.
boolean saveLogin = false;
@@ -65,8 +66,8 @@
}
String[] values = new String(value, Charsets.UTF_8).split("\0", -1);
- // Currently it always has 13 fields.
- if (values.length < 13) {
+ // Currently it always has 14 fields.
+ if (values.length < 14) {
return null;
}
@@ -79,14 +80,15 @@
profile.server = values[2];
profile.username = values[3];
profile.password = values[4];
- profile.domains = values[5];
- profile.routes = values[6];
- profile.mppe = Boolean.valueOf(values[7]);
- profile.l2tpSecret = values[8];
- profile.ipsecIdentifier = values[9];
- profile.ipsecSecret = values[10];
- profile.ipsecUserCert = values[11];
- profile.ipsecCaCert = values[12];
+ profile.dnsServers = values[5];
+ profile.searchDomains = values[6];
+ profile.routes = values[7];
+ profile.mppe = Boolean.valueOf(values[8]);
+ profile.l2tpSecret = values[9];
+ profile.ipsecIdentifier = values[10];
+ profile.ipsecSecret = values[11];
+ profile.ipsecUserCert = values[12];
+ profile.ipsecCaCert = values[13];
profile.saveLogin = !profile.username.isEmpty() || !profile.password.isEmpty();
return profile;
@@ -102,7 +104,8 @@
builder.append('\0').append(server);
builder.append('\0').append(saveLogin ? username : "");
builder.append('\0').append(saveLogin ? password : "");
- builder.append('\0').append(domains);
+ builder.append('\0').append(dnsServers);
+ builder.append('\0').append(searchDomains);
builder.append('\0').append(routes);
builder.append('\0').append(mppe);
builder.append('\0').append(l2tpSecret);