Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bf1d218 authored by Jason Monk's avatar Jason Monk
Browse files

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
parent eb35fa56
Loading
Loading
Loading
Loading
+2 −7
Original line number Original line Diff line number Diff line
@@ -265,14 +265,9 @@ public class PacManager {
        }
        }
        Intent intent = new Intent();
        Intent intent = new Intent();
        intent.setClassName(PAC_PACKAGE, PAC_SERVICE);
        intent.setClassName(PAC_PACKAGE, PAC_SERVICE);
        // Already bound no need to bind again.
        if ((mProxyConnection != null) && (mConnection != null)) {
        if ((mProxyConnection != null) && (mConnection != null)) {
            if (mLastPort != -1) {
            // Already bound no need to bind again, just download the new file.
                sendPacBroadcast(new ProxyInfo(mPacUrl, mLastPort));
            IoThread.getHandler().post(mPacDownloader);
            } else {
                Log.e(TAG, "Received invalid port from Local Proxy,"
                        + " PAC will not be operational");
            }
            return;
            return;
        }
        }
        mConnection = new ServiceConnection() {
        mConnection = new ServiceConnection() {