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

This commit is contained in:
Jason Monk
2013-09-18 23:51:06 +00:00
committed by Android (Google) Code Review

View File

@@ -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) {