summaryrefslogtreecommitdiffstats
path: root/vpn
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2009-11-12 18:45:53 -0800
committerJean-Baptiste Queru <jbq@google.com>2009-11-13 13:53:39 -0800
commit9db3d07b9620b4269ab33f78604a36327e536ce1 (patch)
tree41e294f34b9695187af098cd42167489fb0c8fb0 /vpn
parent6c63ee4fc4acae4bbbbd2a49e0a68206221f0de0 (diff)
downloadframeworks_base-9db3d07b9620b4269ab33f78604a36327e536ce1.zip
frameworks_base-9db3d07b9620b4269ab33f78604a36327e536ce1.tar.gz
frameworks_base-9db3d07b9620b4269ab33f78604a36327e536ce1.tar.bz2
eclair snapshot
Diffstat (limited to 'vpn')
-rw-r--r--vpn/java/android/net/vpn/VpnManager.java21
-rw-r--r--vpn/java/android/net/vpn/VpnType.java20
2 files changed, 25 insertions, 16 deletions
diff --git a/vpn/java/android/net/vpn/VpnManager.java b/vpn/java/android/net/vpn/VpnManager.java
index f71bbea..6df612e 100644
--- a/vpn/java/android/net/vpn/VpnManager.java
+++ b/vpn/java/android/net/vpn/VpnManager.java
@@ -45,18 +45,25 @@ public class VpnManager {
/** Key to the error code of a connectivity broadcast event. */
public static final String BROADCAST_ERROR_CODE = "err";
/** Error code to indicate an error from authentication. */
- public static final int VPN_ERROR_AUTH = 1;
+ public static final int VPN_ERROR_AUTH = 51;
/** Error code to indicate the connection attempt failed. */
- public static final int VPN_ERROR_CONNECTION_FAILED = 2;
+ public static final int VPN_ERROR_CONNECTION_FAILED = 101;
/** Error code to indicate the server is not known. */
- public static final int VPN_ERROR_UNKNOWN_SERVER = 3;
+ public static final int VPN_ERROR_UNKNOWN_SERVER = 102;
/** Error code to indicate an error from challenge response. */
- public static final int VPN_ERROR_CHALLENGE = 4;
+ public static final int VPN_ERROR_CHALLENGE = 5;
/** Error code to indicate an error of remote server hanging up. */
- public static final int VPN_ERROR_REMOTE_HUNG_UP = 5;
+ public static final int VPN_ERROR_REMOTE_HUNG_UP = 7;
+ /** Error code to indicate an error of remote PPP server hanging up. */
+ public static final int VPN_ERROR_REMOTE_PPP_HUNG_UP = 48;
+ /** Error code to indicate a PPP negotiation error. */
+ public static final int VPN_ERROR_PPP_NEGOTIATION_FAILED = 42;
/** Error code to indicate an error of losing connectivity. */
- public static final int VPN_ERROR_CONNECTION_LOST = 6;
- private static final int VPN_ERROR_NO_ERROR = 0;
+ public static final int VPN_ERROR_CONNECTION_LOST = 103;
+ /** Largest error code used by VPN. */
+ public static final int VPN_ERROR_LARGEST = 200;
+ /** Error code to indicate a successful connection. */
+ public static final int VPN_ERROR_NO_ERROR = 0;
public static final String PROFILES_PATH = "/data/misc/vpn/profiles";
diff --git a/vpn/java/android/net/vpn/VpnType.java b/vpn/java/android/net/vpn/VpnType.java
index c7df943..356f8b1 100644
--- a/vpn/java/android/net/vpn/VpnType.java
+++ b/vpn/java/android/net/vpn/VpnType.java
@@ -16,26 +16,28 @@
package android.net.vpn;
+import com.android.internal.R;
+
/**
* Enumeration of all supported VPN types.
* {@hide}
*/
public enum VpnType {
- PPTP("PPTP", "", PptpProfile.class),
- L2TP("L2TP", "", L2tpProfile.class),
- L2TP_IPSEC_PSK("L2TP/IPSec PSK", "Pre-shared key based L2TP/IPSec VPN",
+ PPTP("PPTP", R.string.pptp_vpn_description, PptpProfile.class),
+ L2TP("L2TP", R.string.l2tp_vpn_description, L2tpProfile.class),
+ L2TP_IPSEC_PSK("L2TP/IPSec PSK", R.string.l2tp_ipsec_psk_vpn_description,
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);
private String mDisplayName;
- private String mDescription;
+ private int mDescriptionId;
private Class<? extends VpnProfile> mClass;
- VpnType(String displayName, String description,
+ VpnType(String displayName, int descriptionId,
Class<? extends VpnProfile> klass) {
mDisplayName = displayName;
- mDescription = description;
+ mDescriptionId = descriptionId;
mClass = klass;
}
@@ -43,8 +45,8 @@ public enum VpnType {
return mDisplayName;
}
- public String getDescription() {
- return mDescription;
+ public int getDescriptionId() {
+ return mDescriptionId;
}
public Class<? extends VpnProfile> getProfileClass() {