diff options
author | Robert Greenwalt <rgreenwalt@google.com> | 2010-10-11 16:00:27 -0700 |
---|---|---|
committer | Robert Greenwalt <rgreenwalt@google.com> | 2010-11-19 10:24:30 -0800 |
commit | 434203a277cd2f237a71508a3d5a7d1602126cd5 (patch) | |
tree | 2981f403196d1df7f2ec322a89a4dac1342d86de /services/java/com/android/server/am | |
parent | 5af53d4363342b383fd1e4439b5a2c71a47c593d (diff) | |
download | frameworks_base-434203a277cd2f237a71508a3d5a7d1602126cd5.zip frameworks_base-434203a277cd2f237a71508a3d5a7d1602126cd5.tar.gz frameworks_base-434203a277cd2f237a71508a3d5a7d1602126cd5.tar.bz2 |
Notify all VMs when proxy changes.
bug:2700664
Change-Id: I74cc6e0bd6e66847bf18f524ce851e3e9d2c4e87
Diffstat (limited to 'services/java/com/android/server/am')
-rw-r--r-- | services/java/com/android/server/am/ActivityManagerService.java | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/services/java/com/android/server/am/ActivityManagerService.java b/services/java/com/android/server/am/ActivityManagerService.java index 1ec8a22..e815524 100644 --- a/services/java/com/android/server/am/ActivityManagerService.java +++ b/services/java/com/android/server/am/ActivityManagerService.java @@ -76,6 +76,8 @@ import android.content.pm.ServiceInfo; import android.content.pm.PackageManager.NameNotFoundException; import android.content.res.Configuration; import android.graphics.Bitmap; +import android.net.Proxy; +import android.net.ProxyProperties; import android.net.Uri; import android.os.Binder; import android.os.Build; @@ -127,6 +129,7 @@ import java.io.InputStreamReader; import java.io.PrintWriter; import java.lang.IllegalStateException; import java.lang.ref.WeakReference; +import java.net.InetSocketAddress; import java.util.ArrayList; import java.util.Collections; import java.util.Comparator; @@ -960,6 +963,7 @@ public final class ActivityManagerService extends ActivityManagerNative static final int SHOW_STRICT_MODE_VIOLATION_MSG = 26; static final int CHECK_EXCESSIVE_WAKE_LOCKS_MSG = 27; static final int CLEAR_DNS_CACHE = 28; + static final int UPDATE_HTTP_PROXY = 29; AlertDialog mUidAlert; @@ -1125,6 +1129,30 @@ public final class ActivityManagerService extends ActivityManagerNative } } } break; + case UPDATE_HTTP_PROXY: { + ProxyProperties proxy = (ProxyProperties)msg.obj; + String host = ""; + String port = ""; + String exclList = ""; + if (proxy != null) { + host = proxy.getHost(); + port = Integer.toString(proxy.getPort()); + exclList = proxy.getExclusionList(); + } + synchronized (ActivityManagerService.this) { + for (int i = mLruProcesses.size() - 1 ; i >= 0 ; i--) { + ProcessRecord r = mLruProcesses.get(i); + if (r.thread != null) { + try { + r.thread.setHttpProxy(host, port, exclList); + } catch (RemoteException ex) { + Slog.w(TAG, "Failed to update http proxy for: " + + r.info.processName); + } + } + } + } + } break; case SHOW_UID_ERROR_MSG: { // XXX This is a temporary dialog, no need to localize. AlertDialog d = new BaseErrorDialog(mContext); @@ -10402,6 +10430,11 @@ public final class ActivityManagerService extends ActivityManagerNative mHandler.sendEmptyMessage(CLEAR_DNS_CACHE); } + if (Proxy.PROXY_CHANGE_ACTION.equals(intent.getAction())) { + ProxyProperties proxy = intent.getParcelableExtra("proxy"); + mHandler.sendMessage(mHandler.obtainMessage(UPDATE_HTTP_PROXY, proxy)); + } + /* * Prevent non-system code (defined here to be non-persistent * processes) from sending protected broadcasts. |