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

Commit ff65c6da authored by Jason Monk's avatar Jason Monk Committed by Android (Google) Code Review
Browse files

Merge "Fix PacManager to not unbind when no connection" into klp-dev

parents e8c01ddb bc018d89
Loading
Loading
Loading
Loading
+10 −5
Original line number Diff line number Diff line
@@ -252,7 +252,7 @@ public class PacManager {
        Intent intent = new Intent();
        intent.setClassName(PAC_PACKAGE, PAC_SERVICE);
        // Already bound no need to bind again.
        if (mProxyConnection != null) {
        if ((mProxyConnection != null) && (mConnection != null)) {
            if (mLastPort != -1) {
                sendPacBroadcast(new ProxyProperties(mPacUrl, mLastPort));
            } else {
@@ -332,11 +332,16 @@ public class PacManager {
    }

    private void unbind() {
        if (mConnection != null) {
            mContext.unbindService(mConnection);
        mContext.unbindService(mProxyConnection);
            mConnection = null;
        }
        if (mProxyConnection != null) {
            mContext.unbindService(mProxyConnection);
            mProxyConnection = null;
        }
        mProxyService = null;
    }

    private void sendPacBroadcast(ProxyProperties proxy) {
        Intent intent = new Intent(Proxy.PROXY_CHANGE_ACTION);