@@ -135,7 +135,7 @@ public void onReceive(Context context, Intent intent) {
135135 switch (state ) {
136136 case WifiManager .WIFI_STATE_ENABLED :
137137 mWifiEnabled = true ;
138- if (anyOpened ()) grabWifiLock ();
138+ if (anyOpenedToReceiveCalls ()) grabWifiLock ();
139139 break ;
140140 case WifiManager .WIFI_STATE_DISABLED :
141141 mWifiEnabled = false ;
@@ -231,7 +231,7 @@ public synchronized void close(String localProfileUri) {
231231 notifyProfileRemoved (group .getLocalProfile ());
232232 group .close ();
233233
234- if (!anyOpened ()) {
234+ if (!anyOpenedToReceiveCalls ()) {
235235 releaseWifiLock ();
236236 mMyWakeLock .reset (); // in case there's leak
237237 }
@@ -243,7 +243,7 @@ public synchronized boolean isOpened(String localProfileUri) {
243243 SipSessionGroupExt group = mSipGroups .get (localProfileUri );
244244 if (group == null ) return false ;
245245 if (isCallerCreatorOrRadio (group )) {
246- return group . isOpened () ;
246+ return true ;
247247 } else {
248248 Log .w (TAG , "only creator or radio can query on the profile" );
249249 return false ;
@@ -358,9 +358,9 @@ private void notifyProfileRemoved(SipProfile localProfile) {
358358 mContext .sendBroadcast (intent );
359359 }
360360
361- private boolean anyOpened () {
361+ private boolean anyOpenedToReceiveCalls () {
362362 for (SipSessionGroupExt group : mSipGroups .values ()) {
363- if (group .isOpened ()) return true ;
363+ if (group .isOpenedToReceiveCalls ()) return true ;
364364 }
365365 return false ;
366366 }
@@ -479,7 +479,7 @@ private synchronized boolean callingSelf(SipSessionGroupExt ringingGroup,
479479 private class SipSessionGroupExt extends SipSessionAdapter {
480480 private SipSessionGroup mSipGroup ;
481481 private PendingIntent mIncomingCallPendingIntent ;
482- private boolean mOpened ;
482+ private boolean mOpenedToReceiveCalls ;
483483
484484 private AutoRegistrationProcess mAutoRegistration =
485485 new AutoRegistrationProcess ();
@@ -541,7 +541,7 @@ public void setIncomingCallPendingIntent(PendingIntent pIntent) {
541541 }
542542
543543 public void openToReceiveCalls () throws SipException {
544- mOpened = true ;
544+ mOpenedToReceiveCalls = true ;
545545 if (mConnected ) {
546546 mSipGroup .openToReceiveCalls (this );
547547 mAutoRegistration .start (mSipGroup );
@@ -555,9 +555,9 @@ public void onConnectivityChanged(boolean connected)
555555 mSipGroup .onConnectivityChanged ();
556556 if (connected ) {
557557 resetGroup (mLocalIp );
558- if (mOpened ) openToReceiveCalls ();
558+ if (mOpenedToReceiveCalls ) openToReceiveCalls ();
559559 } else {
560- // close mSipGroup but remember mOpened
560+ // close mSipGroup but remember mOpenedToReceiveCalls
561561 if (DEBUG ) Log .d (TAG , " close auto reg temporarily: "
562562 + getUri () + ": " + mIncomingCallPendingIntent );
563563 mSipGroup .close ();
@@ -582,7 +582,7 @@ private void resetGroup(String localIp) throws SipException {
582582 }
583583
584584 public void close () {
585- mOpened = false ;
585+ mOpenedToReceiveCalls = false ;
586586 mSipGroup .close ();
587587 mAutoRegistration .stop ();
588588 if (DEBUG ) Log .d (TAG , " close: " + getUri () + ": "
@@ -629,8 +629,8 @@ public void onError(ISipSession session, int errorCode,
629629 + SipErrorCode .toString (errorCode ) + ": " + message );
630630 }
631631
632- public boolean isOpened () {
633- return mOpened ;
632+ public boolean isOpenedToReceiveCalls () {
633+ return mOpenedToReceiveCalls ;
634634 }
635635
636636 public boolean isRegistered () {
0 commit comments