diff options
author | Hung-ying Tyan <tyanh@google.com> | 2010-11-02 15:15:43 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2010-11-02 15:17:50 +0800 |
commit | 262cdfca7a0940735d3a08779e2d01bfdf639294 (patch) | |
tree | 4ac91625d7926695a1e4d520da2c29885ef0d58a /voip | |
parent | 70a2c15ecfd4e8cd8581699d5df8a219c7d5cdb1 (diff) | |
download | frameworks_base-262cdfca7a0940735d3a08779e2d01bfdf639294.zip frameworks_base-262cdfca7a0940735d3a08779e2d01bfdf639294.tar.gz frameworks_base-262cdfca7a0940735d3a08779e2d01bfdf639294.tar.bz2 |
Correct SipService.isOpened() implementation.
Make it return true for all existing accounts.
Rename mOpened to mOpenedToReceiveCalls to make it less confusing.
Bug: 3155849
Change-Id: I327f411bf76afd73434ad1fa2ffef3db1e35d778
Diffstat (limited to 'voip')
-rw-r--r-- | voip/java/com/android/server/sip/SipService.java | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/voip/java/com/android/server/sip/SipService.java b/voip/java/com/android/server/sip/SipService.java index f480fec..3af6e78 100644 --- a/voip/java/com/android/server/sip/SipService.java +++ b/voip/java/com/android/server/sip/SipService.java @@ -135,7 +135,7 @@ public final class SipService extends ISipService.Stub { switch (state) { case WifiManager.WIFI_STATE_ENABLED: mWifiEnabled = true; - if (anyOpened()) grabWifiLock(); + if (anyOpenedToReceiveCalls()) grabWifiLock(); break; case WifiManager.WIFI_STATE_DISABLED: mWifiEnabled = false; @@ -231,7 +231,7 @@ public final class SipService extends ISipService.Stub { notifyProfileRemoved(group.getLocalProfile()); group.close(); - if (!anyOpened()) { + if (!anyOpenedToReceiveCalls()) { releaseWifiLock(); mMyWakeLock.reset(); // in case there's leak } @@ -243,7 +243,7 @@ public final class SipService extends ISipService.Stub { SipSessionGroupExt group = mSipGroups.get(localProfileUri); if (group == null) return false; if (isCallerCreatorOrRadio(group)) { - return group.isOpened(); + return true; } else { Log.w(TAG, "only creator or radio can query on the profile"); return false; @@ -358,9 +358,9 @@ public final class SipService extends ISipService.Stub { mContext.sendBroadcast(intent); } - private boolean anyOpened() { + private boolean anyOpenedToReceiveCalls() { for (SipSessionGroupExt group : mSipGroups.values()) { - if (group.isOpened()) return true; + if (group.isOpenedToReceiveCalls()) return true; } return false; } @@ -479,7 +479,7 @@ public final class SipService extends ISipService.Stub { private class SipSessionGroupExt extends SipSessionAdapter { private SipSessionGroup mSipGroup; private PendingIntent mIncomingCallPendingIntent; - private boolean mOpened; + private boolean mOpenedToReceiveCalls; private AutoRegistrationProcess mAutoRegistration = new AutoRegistrationProcess(); @@ -541,7 +541,7 @@ public final class SipService extends ISipService.Stub { } public void openToReceiveCalls() throws SipException { - mOpened = true; + mOpenedToReceiveCalls = true; if (mConnected) { mSipGroup.openToReceiveCalls(this); mAutoRegistration.start(mSipGroup); @@ -555,9 +555,9 @@ public final class SipService extends ISipService.Stub { mSipGroup.onConnectivityChanged(); if (connected) { resetGroup(mLocalIp); - if (mOpened) openToReceiveCalls(); + if (mOpenedToReceiveCalls) openToReceiveCalls(); } else { - // close mSipGroup but remember mOpened + // close mSipGroup but remember mOpenedToReceiveCalls if (DEBUG) Log.d(TAG, " close auto reg temporarily: " + getUri() + ": " + mIncomingCallPendingIntent); mSipGroup.close(); @@ -582,7 +582,7 @@ public final class SipService extends ISipService.Stub { } public void close() { - mOpened = false; + mOpenedToReceiveCalls = false; mSipGroup.close(); mAutoRegistration.stop(); if (DEBUG) Log.d(TAG, " close: " + getUri() + ": " @@ -629,8 +629,8 @@ public final class SipService extends ISipService.Stub { + SipErrorCode.toString(errorCode) + ": " + message); } - public boolean isOpened() { - return mOpened; + public boolean isOpenedToReceiveCalls() { + return mOpenedToReceiveCalls; } public boolean isRegistered() { |