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

Commit 44e27b5c authored by Chia-chi Yeh's avatar Chia-chi Yeh
Browse files

VPN: remove the old VpnService.

Now VPN is (kind of) integrated into ConnectivityService.

Change-Id: If98e456e779f8e97f562d99c57d909b1f5d9db55
parent 0c6bb273
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -190,7 +190,6 @@ LOCAL_SRC_FILES += \
	telephony/java/com/android/internal/telephony/IWapPushManager.aidl \
	wifi/java/android/net/wifi/IWifiManager.aidl \
	telephony/java/com/android/internal/telephony/IExtendedNetworkService.aidl \
	vpn/java/android/net/vpn/IVpnService.aidl \
	voip/java/android/net/sip/ISipSession.aidl \
	voip/java/android/net/sip/ISipSessionListener.aidl \
	voip/java/android/net/sip/ISipService.aidl
@@ -280,7 +279,6 @@ aidl_files := \
	frameworks/base/telephony/java/android/telephony/ServiceState.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/IPhoneSubInfo.aidl \
	frameworks/base/telephony/java/com/android/internal/telephony/ITelephony.aidl \
	frameworks/base/vpn/java/android/net/vpn/IVpnService.aidl \

gen := $(TARGET_OUT_COMMON_INTERMEDIATES)/framework.aidl
$(gen): PRIVATE_SRC_FILES := $(aidl_files)
+0 −12
Original line number Diff line number Diff line
@@ -2799,11 +2799,6 @@
    <!-- Do Not Translate: Alternate eri.xml -->
    <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>

    <!-- The title of the notification when VPN is active. -->
    <string name="vpn_title">VPN is activated.</string>
    <!-- The title of the notification when VPN is active with an application name. -->
@@ -2931,13 +2926,6 @@
    <!-- Dialog action for when there are too many deletes that would take place and we want user confirmation, and the user wants to do nothing for now -->
    <string name="sync_do_nothing">Do nothing for now.</string>

    <!-- Title of the VPN service notification: VPN connected [CHAR LIMIT=NONE] -->
    <string name="vpn_notification_title_connected"><xliff:g id="profilename" example="Home PPTP">%s</xliff:g> VPN connected</string>
    <!-- Title of the VPN service notification: VPN disconnected [CHAR LIMIT=NONE] -->
    <string name="vpn_notification_title_disconnected"><xliff:g id="profilename" example="Home PPTP">%s</xliff:g> VPN disconnected</string>
    <!-- Message of the VPN service notification: Hint to reconnect VPN [CHAR LIMIT=NONE] -->
    <string name="vpn_notification_hint_disconnected">Touch to reconnect to a VPN.</string>

    <!-- Choose Account Activity label -->
    <string name="choose_account_label">Select an account</string>

+0 −4
Original line number Diff line number Diff line
@@ -44,7 +44,6 @@ import android.net.NetworkUtils;
import android.net.Proxy;
import android.net.ProxyProperties;
import android.net.RouteInfo;
import android.net.vpn.VpnManager;
import android.net.wifi.WifiStateTracker;
import android.os.Binder;
import android.os.FileUtils;
@@ -496,11 +495,8 @@ public class ConnectivityService extends IConnectivityManager.Stub {
        mSettingsObserver.observe(mContext);

        loadGlobalProxy();

        VpnManager.startVpnService(context);
    }


    /**
     * Sets the preferred network.
     * @param preference the new preference
+0 −50
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.vpn;

import android.net.vpn.VpnProfile;

/**
 * Interface to access a VPN service.
 * {@hide}
 */
interface IVpnService {
    /**
     * Sets up a VPN connection.
     * @param profile the profile object
     * @param username the username for authentication
     * @param password the corresponding password for authentication
     * @return true if VPN is successfully connected
     */
    boolean connect(in VpnProfile profile, String username, String password);

    /**
     * Tears down the VPN connection.
     */
    void disconnect();

    /**
     * Gets the the current connection state.
     */
    String getState(in VpnProfile profile);

    /**
     * Returns the idle state.
     * @return true if the system is not connecting/connected to a VPN
     */
    boolean isIdle();
}
+0 −65
Original line number Diff line number Diff line
/*
 * Copyright (C) 2009, The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package android.net.vpn;

import android.os.Parcel;

/**
 * The profile for certificate-based L2TP-over-IPSec type of VPN.
 * {@hide}
 */
public class L2tpIpsecProfile extends L2tpProfile {
    private static final long serialVersionUID = 1L;

    private String mUserCertificate;
    private String mCaCertificate;

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

    public void setCaCertificate(String name) {
        mCaCertificate = name;
    }

    public String getCaCertificate() {
        return mCaCertificate;
    }

    public void setUserCertificate(String name) {
        mUserCertificate = name;
    }

    public String getUserCertificate() {
        return mUserCertificate;
    }

    @Override
    protected void readFromParcel(Parcel in) {
        super.readFromParcel(in);
        mCaCertificate = in.readString();
        mUserCertificate = in.readString();
    }

    @Override
    public void writeToParcel(Parcel parcel, int flags) {
        super.writeToParcel(parcel, flags);
        parcel.writeString(mCaCertificate);
        parcel.writeString(mUserCertificate);
    }
}
Loading