make vpn type strings i18n ready.

This commit is contained in:
Hung-ying Tyan
2009-09-30 16:02:17 +08:00
parent 4ca8c837d3
commit f2bd901738
2 changed files with 19 additions and 8 deletions

View File

@@ -2088,4 +2088,9 @@
<!-- Do Not Translate: Alternate eri.xml --> <!-- Do Not Translate: Alternate eri.xml -->
<string name="alternate_eri_file">/data/eri.xml</string> <string name="alternate_eri_file">/data/eri.xml</string>
<string name="pptp_vpn_description">Point-to-Point Tunneling Protocol</string>
<string name="l2tp_vpn_description">Layer 2 Tunneling Protocol</string>
<string name="l2tp_ipsec_psk_vpn_description">Pre-shared key based L2TP/IPSec VPN</string>
<string name="l2tp_ipsec_crt_vpn_description">Certificate based L2TP/IPSec VPN</string>
</resources> </resources>

View File

@@ -16,26 +16,28 @@
package android.net.vpn; package android.net.vpn;
import com.android.internal.R;
/** /**
* Enumeration of all supported VPN types. * Enumeration of all supported VPN types.
* {@hide} * {@hide}
*/ */
public enum VpnType { public enum VpnType {
PPTP("PPTP", "", PptpProfile.class), PPTP("PPTP", R.string.pptp_vpn_description, PptpProfile.class),
L2TP("L2TP", "", L2tpProfile.class), L2TP("L2TP", R.string.l2tp_vpn_description, L2tpProfile.class),
L2TP_IPSEC_PSK("L2TP/IPSec PSK", "Pre-shared key based L2TP/IPSec VPN", L2TP_IPSEC_PSK("L2TP/IPSec PSK", R.string.l2tp_ipsec_psk_vpn_description,
L2tpIpsecPskProfile.class), L2tpIpsecPskProfile.class),
L2TP_IPSEC("L2TP/IPSec CRT", "Certificate based L2TP/IPSec VPN", L2TP_IPSEC("L2TP/IPSec CRT", R.string.l2tp_ipsec_crt_vpn_description,
L2tpIpsecProfile.class); L2tpIpsecProfile.class);
private String mDisplayName; private String mDisplayName;
private String mDescription; private int mDescriptionId;
private Class<? extends VpnProfile> mClass; private Class<? extends VpnProfile> mClass;
VpnType(String displayName, String description, VpnType(String displayName, int descriptionId,
Class<? extends VpnProfile> klass) { Class<? extends VpnProfile> klass) {
mDisplayName = displayName; mDisplayName = displayName;
mDescription = description; mDescriptionId = descriptionId;
mClass = klass; mClass = klass;
} }
@@ -43,8 +45,12 @@ public enum VpnType {
return mDisplayName; return mDisplayName;
} }
public int getDescriptionId() {
return mDescriptionId;
}
public String getDescription() { public String getDescription() {
return mDescription; return "";
} }
public Class<? extends VpnProfile> getProfileClass() { public Class<? extends VpnProfile> getProfileClass() {