Methods Summary |
---|
public void | addLegacyAddresses(java.lang.String addressesStr)
if (addressesStr.trim().equals("")) {
return;
}
String[] addresses = addressesStr.trim().split(" ");
for (String address : addresses) {
//each address is ip/prefix
LinkAddress addr = new LinkAddress(address);
this.addresses.add(addr);
updateAllowedFamilies(addr.getAddress());
}
|
public void | addLegacyRoutes(java.lang.String routesStr)
if (routesStr.trim().equals("")) {
return;
}
String[] routes = routesStr.trim().split(" ");
for (String route : routes) {
//each route is ip/prefix
RouteInfo info = new RouteInfo(new IpPrefix(route), null);
this.routes.add(info);
updateAllowedFamilies(info.getDestination().getAddress());
}
|
public int | describeContents()
return 0;
|
public static android.content.Intent | getIntentForConfirmation()
Intent intent = new Intent();
ComponentName componentName = ComponentName.unflattenFromString(
Resources.getSystem().getString(
com.android.internal.R.string.config_customVpnConfirmDialogComponent));
intent.setClassName(componentName.getPackageName(), componentName.getClassName());
return intent;
|
public static android.app.PendingIntent | getIntentForStatusPanel(android.content.Context context)NOTE: This should only be used for legacy VPN.
Intent intent = new Intent();
intent.setClassName(DIALOGS_PACKAGE, DIALOGS_PACKAGE + ".ManageDialog");
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_NO_HISTORY |
Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS);
return PendingIntent.getActivityAsUser(context, 0, intent, 0, null, UserHandle.CURRENT);
|
public static java.lang.CharSequence | getVpnLabel(android.content.Context context, java.lang.String packageName)
PackageManager pm = context.getPackageManager();
Intent intent = new Intent(SERVICE_INTERFACE);
intent.setPackage(packageName);
List<ResolveInfo> services = pm.queryIntentServices(intent, 0 /* flags */);
if (services != null && services.size() == 1) {
// This app contains exactly one VPN service. Call loadLabel, which will attempt to
// load the service's label, and fall back to the app label if none is present.
return services.get(0).loadLabel(pm);
} else {
return pm.getApplicationInfo(packageName, 0).loadLabel(pm);
}
|
public void | updateAllowedFamilies(java.net.InetAddress address)
if (address instanceof Inet4Address) {
allowIPv4 = true;
} else {
allowIPv6 = true;
}
|
public void | writeToParcel(android.os.Parcel out, int flags)
out.writeString(user);
out.writeString(interfaze);
out.writeString(session);
out.writeInt(mtu);
out.writeTypedList(addresses);
out.writeTypedList(routes);
out.writeStringList(dnsServers);
out.writeStringList(searchDomains);
out.writeStringList(allowedApplications);
out.writeStringList(disallowedApplications);
out.writeParcelable(configureIntent, flags);
out.writeLong(startTime);
out.writeInt(legacy ? 1 : 0);
out.writeInt(blocking ? 1 : 0);
out.writeInt(allowBypass ? 1 : 0);
out.writeInt(allowIPv4 ? 1 : 0);
out.writeInt(allowIPv6 ? 1 : 0);
out.writeTypedArray(underlyingNetworks, flags);
|