From 4bf1d218576fa5721bab589cd5945dbe49f0d117 Mon Sep 17 00:00:00 2001 From: Jason Monk Date: Thu, 25 Sep 2014 13:16:32 -0400 Subject: Download PAC when set after a diff PAC URL Fix bug where rather than downloading new PAC file, the system would just send out broadcast saying proxy has changed. Now trigger a download of the file, and let the broadcast be sent when the download is complete. It is safe to pull out this port check as it is also performed at the time of trying to send the broadcast, and when the port is received. Removing it takes out a chance of any weird race conditions about setting the PAC and changing it before the callback completes. Bug: 17654639 Change-Id: Ic166d8f42bc388998a5aade147579d3ae1355c77 --- .../core/java/com/android/server/connectivity/PacManager.java | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/services/core/java/com/android/server/connectivity/PacManager.java b/services/core/java/com/android/server/connectivity/PacManager.java index 07fe7ba79582..7d1da01b8ca6 100644 --- a/services/core/java/com/android/server/connectivity/PacManager.java +++ b/services/core/java/com/android/server/connectivity/PacManager.java @@ -265,14 +265,9 @@ public class PacManager { } Intent intent = new Intent(); intent.setClassName(PAC_PACKAGE, PAC_SERVICE); - // Already bound no need to bind again. if ((mProxyConnection != null) && (mConnection != null)) { - if (mLastPort != -1) { - sendPacBroadcast(new ProxyInfo(mPacUrl, mLastPort)); - } else { - Log.e(TAG, "Received invalid port from Local Proxy," - + " PAC will not be operational"); - } + // Already bound no need to bind again, just download the new file. + IoThread.getHandler().post(mPacDownloader); return; } mConnection = new ServiceConnection() { -- cgit v1.2.3-59-g8ed1b