Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0bd458b9 authored by Hung-ying Tyan's avatar Hung-ying Tyan
Browse files

Add state saving mechanism to support proc restart

Also...
+ stop daemons before getting server IP;
+ remove setForeground();
+ add the DBG flag for Log.d calls.

PatchSet 3:
+ add CHALLENGE_ERROR and REMOTE_HUNG_UP to VpnManager
+ broadcast new error codes in VpnService
+ check local IP change instead of dns change
+ move removeStates() to VpnService.onFinalCleanUp()

PatchSet 7:
+ add encryption flag to PptpProfile
+ PptpService and MtpdHelper are revised accordingly
parent bbdde829
Loading
Loading
Loading
Loading
+12 −0
Original line number Diff line number Diff line
@@ -22,9 +22,21 @@ package android.net.vpn;
 */
public class PptpProfile extends VpnProfile {
    private static final long serialVersionUID = 1L;
    private boolean mEncryption = true;

    @Override
    public VpnType getType() {
        return VpnType.PPTP;
    }

    /**
     * Enables/disables the encryption for PPTP tunnel.
     */
    public void setEncryptionEnabled(boolean enabled) {
        mEncryption = enabled;
    }

    public boolean isEncryptionEnabled() {
        return mEncryption;
    }
}
+4 −0
Original line number Diff line number Diff line
@@ -50,6 +50,10 @@ public class VpnManager {
    public static final int VPN_ERROR_CONNECTION_FAILED = 2;
    /** Error code to indicate the server is not known. */
    public static final int VPN_ERROR_UNKNOWN_SERVER = 3;
    /** Error code to indicate an error from challenge response. */
    public static final int VPN_ERROR_CHALLENGE = 4;
    /** Error code to indicate an error of remote server hanging up. */
    public static final int VPN_ERROR_REMOTE_HUNG_UP = 5;
    private static final int VPN_ERROR_NO_ERROR = 0;

    public static final String PROFILES_PATH = "/data/misc/vpn/profiles";