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

Commit 275d1adf authored by Jason Monk's avatar Jason Monk Committed by Android Git Automerger
Browse files

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

* commit 'ff65c6da':
  Fix PacManager to not unbind when no connection
parents 2f9fd33f ff65c6da
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);