am ff65c6da: Merge "Fix PacManager to not unbind when no connection" into klp-dev
* commit 'ff65c6daab5268c28b3663cd02c1b3dfa6f1c90a': Fix PacManager to not unbind when no connection
This commit is contained in:
@@ -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,10 +332,15 @@ public class PacManager {
|
||||
}
|
||||
|
||||
private void unbind() {
|
||||
mContext.unbindService(mConnection);
|
||||
mContext.unbindService(mProxyConnection);
|
||||
mConnection = null;
|
||||
mProxyConnection = null;
|
||||
if (mConnection != null) {
|
||||
mContext.unbindService(mConnection);
|
||||
mConnection = null;
|
||||
}
|
||||
if (mProxyConnection != null) {
|
||||
mContext.unbindService(mProxyConnection);
|
||||
mProxyConnection = null;
|
||||
}
|
||||
mProxyService = null;
|
||||
}
|
||||
|
||||
private void sendPacBroadcast(ProxyProperties proxy) {
|
||||
|
||||
Reference in New Issue
Block a user