summaryrefslogtreecommitdiffstats
path: root/core/java/android/app
diff options
context:
space:
mode:
authorJason Monk <jmonk@google.com>2013-07-03 17:04:33 -0400
committerJason Monk <jmonk@google.com>2013-08-07 21:01:39 -0400
commit602b232a06ede86999aa362a12eb28cbc782dc1d (patch)
tree07a2168ba91425f81bd7ac9c9311adb78114cc13 /core/java/android/app
parent55db1e1218971105e68ba9d451b2e0b1e9e5f9fb (diff)
downloadframeworks_base-602b232a06ede86999aa362a12eb28cbc782dc1d.zip
frameworks_base-602b232a06ede86999aa362a12eb28cbc782dc1d.tar.gz
frameworks_base-602b232a06ede86999aa362a12eb28cbc782dc1d.tar.bz2
Add PAC File support for proxy configuration
PAC (Proxy auto-config) files contain a single javascript function, FindProxyForURL(url, host). It gets called to determine what proxy should be used for a specific request. This adds PAC support to the system. The ProxyProperties has been modified to hold the PAC file when one is present. The Proxy method setHttpProxySystemProperty has been modified to insert a PacProxySelector as the default ProxySelector when it is required. This new ProxySelector makes calls to the ConnectivityService to parse the PAC file. The ConnectivityService and the WifiConfigStore have been modified to support saving the extra PAC file data. The ConnectivityService now has a class attached (PacProxyNative) that interfaces to the native calls for PAC files. The parsing of the PAC file is handled by libpac (which is being added to external/) which utilizes libv8 to parse the javascript. As a fallback to applications that don't use the java ProxySelector, the proxy is setup to point to a local proxy server that will handle the pac parsing. bug:10182711 Change-Id: I5eb8df893c632fd3e1b732385cb7720ad646f401
Diffstat (limited to 'core/java/android/app')
-rw-r--r--core/java/android/app/ActivityThread.java4
-rw-r--r--core/java/android/app/ApplicationThreadNative.java7
-rw-r--r--core/java/android/app/IApplicationThread.java3
3 files changed, 9 insertions, 5 deletions
diff --git a/core/java/android/app/ActivityThread.java b/core/java/android/app/ActivityThread.java
index d9f9d61..5300eca 100644
--- a/core/java/android/app/ActivityThread.java
+++ b/core/java/android/app/ActivityThread.java
@@ -793,8 +793,8 @@ public final class ActivityThread {
InetAddress.clearDnsCache();
}
- public void setHttpProxy(String host, String port, String exclList) {
- Proxy.setHttpProxySystemProperty(host, port, exclList);
+ public void setHttpProxy(String host, String port, String exclList, String pacFileUrl) {
+ Proxy.setHttpProxySystemProperty(host, port, exclList, pacFileUrl);
}
public void processInBackground() {
diff --git a/core/java/android/app/ApplicationThreadNative.java b/core/java/android/app/ApplicationThreadNative.java
index 6f18e84..1465de2 100644
--- a/core/java/android/app/ApplicationThreadNative.java
+++ b/core/java/android/app/ApplicationThreadNative.java
@@ -338,7 +338,8 @@ public abstract class ApplicationThreadNative extends Binder
final String proxy = data.readString();
final String port = data.readString();
final String exclList = data.readString();
- setHttpProxy(proxy, port, exclList);
+ final String pacFileUrl = data.readString();
+ setHttpProxy(proxy, port, exclList, pacFileUrl);
return true;
}
@@ -1001,12 +1002,14 @@ class ApplicationThreadProxy implements IApplicationThread {
data.recycle();
}
- public void setHttpProxy(String proxy, String port, String exclList) throws RemoteException {
+ public void setHttpProxy(String proxy, String port, String exclList,
+ String pacFileUrl) throws RemoteException {
Parcel data = Parcel.obtain();
data.writeInterfaceToken(IApplicationThread.descriptor);
data.writeString(proxy);
data.writeString(port);
data.writeString(exclList);
+ data.writeString(pacFileUrl);
mRemote.transact(SET_HTTP_PROXY_TRANSACTION, data, null, IBinder.FLAG_ONEWAY);
data.recycle();
}
diff --git a/core/java/android/app/IApplicationThread.java b/core/java/android/app/IApplicationThread.java
index 8e882df..61c499a 100644
--- a/core/java/android/app/IApplicationThread.java
+++ b/core/java/android/app/IApplicationThread.java
@@ -101,7 +101,8 @@ public interface IApplicationThread extends IInterface {
void scheduleConfigurationChanged(Configuration config) throws RemoteException;
void updateTimeZone() throws RemoteException;
void clearDnsCache() throws RemoteException;
- void setHttpProxy(String proxy, String port, String exclList) throws RemoteException;
+ void setHttpProxy(String proxy, String port, String exclList,
+ String pacFileUrl) throws RemoteException;
void processInBackground() throws RemoteException;
void dumpService(FileDescriptor fd, IBinder servicetoken, String[] args)
throws RemoteException;