diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/java/android/net/ConnectivityManager.java | 41 | ||||
-rw-r--r-- | core/java/android/net/IConnectivityManager.aidl | 8 | ||||
-rwxr-xr-x | core/res/res/values/strings.xml | 9 |
3 files changed, 57 insertions, 1 deletions
diff --git a/core/java/android/net/ConnectivityManager.java b/core/java/android/net/ConnectivityManager.java index ea750da..3025462 100644 --- a/core/java/android/net/ConnectivityManager.java +++ b/core/java/android/net/ConnectivityManager.java @@ -19,6 +19,8 @@ package android.net; import android.annotation.SdkConstant; import android.annotation.SdkConstant.SdkConstantType; import android.os.Binder; +import android.os.Bundle; +import android.os.ParcelFileDescriptor; import android.os.RemoteException; import java.net.InetAddress; @@ -756,4 +758,43 @@ public class ConnectivityManager { } catch (RemoteException e) { } } + + /** + * Protect a socket from routing changes. This method is limited to VPN + * applications, and it is always hidden to avoid direct use. + * @hide + */ + public void protectVpn(ParcelFileDescriptor socket) { + try { + mService.protectVpn(socket); + } catch (RemoteException e) { + } + } + + /** + * Prepare for a VPN application. This method is limited to VpnDialogs, + * and it is always hidden to avoid direct use. + * @hide + */ + public String prepareVpn(String packageName) { + try { + return mService.prepareVpn(packageName); + } catch (RemoteException e) { + return null; + } + } + + /** + * Configure a TUN interface and return its file descriptor. Parameters + * are encoded and opaque to this class. This method is limited to VPN + * applications, and it is always hidden to avoid direct use. + * @hide + */ + public ParcelFileDescriptor establishVpn(Bundle config) { + try { + return mService.establishVpn(config); + } catch (RemoteException e) { + return null; + } + } } diff --git a/core/java/android/net/IConnectivityManager.aidl b/core/java/android/net/IConnectivityManager.aidl index 07f6cec..7f3775d 100644 --- a/core/java/android/net/IConnectivityManager.aidl +++ b/core/java/android/net/IConnectivityManager.aidl @@ -20,7 +20,9 @@ import android.net.LinkProperties; import android.net.NetworkInfo; import android.net.NetworkState; import android.net.ProxyProperties; +import android.os.Bundle; import android.os.IBinder; +import android.os.ParcelFileDescriptor; /** * Interface that answers queries about, and allows changing, the @@ -95,4 +97,10 @@ interface IConnectivityManager ProxyProperties getProxy(); void setDataDependency(int networkType, boolean met); + + void protectVpn(in ParcelFileDescriptor socket); + + String prepareVpn(String packageName); + + ParcelFileDescriptor establishVpn(in Bundle config); } diff --git a/core/res/res/values/strings.xml b/core/res/res/values/strings.xml index 65a1e44..87d5654 100755 --- a/core/res/res/values/strings.xml +++ b/core/res/res/values/strings.xml @@ -1330,7 +1330,7 @@ <string name="permlab_vpn">intercept and modify all network traffic</string> <!-- Description of an application permission, listed so the user can choose whether they want to allow the application to do this. --> <string name="permdesc_vpn">Allows an application to intercept and - inspect all network traffic, for example to establish a VPN connection. + inspect all network traffic to establish a VPN connection. Malicious applications may monitor, redirect, or modify network packets without your knowledge.</string> @@ -2725,6 +2725,13 @@ <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> + <!-- Ticker text to show when VPN is active. --> + <string name="vpn_ticker">Activating <xliff:g id="app">%s</xliff:g> VPN...</string> + <!-- The title of the notification when VPN is active. --> + <string name="vpn_title"><xliff:g id="app">%s</xliff:g> VPN is active</string> + <!-- The text of the notification when VPN is active. --> + <string name="vpn_text">VPN is connected to <xliff:g id="profile">%s</xliff:g>. Tap to manage the network.</string> + <!-- Localized strings for WebView --> <!-- Label for button in a WebView that will open a chooser to choose a file to upload --> <string name="upload_file">Choose file</string> |