6868 */
6969public final class SipService extends ISipService .Stub {
7070 static final String TAG = "SipService" ;
71- static final boolean DEBUGV = false ;
72- static final boolean DEBUG = true ;
71+ static final boolean DEBUG = false ;
7372 private static final int EXPIRY_TIME = 3600 ;
7473 private static final int SHORT_EXPIRY_TIME = 10 ;
7574 private static final int MIN_EXPIRY_TIME = 60 ;
@@ -581,7 +580,7 @@ public ISipSession createSession(ISipSessionListener listener) {
581580 @ Override
582581 public void onRinging (ISipSession s , SipProfile caller ,
583582 String sessionDescription ) {
584- if (DEBUGV ) Log .d (TAG , "<<<<< onRinging()" );
583+ if (DEBUG ) Log .d (TAG , "<<<<< onRinging()" );
585584 SipSessionGroup .SipSessionImpl session =
586585 (SipSessionGroup .SipSessionImpl ) s ;
587586 synchronized (SipService .this ) {
@@ -778,7 +777,6 @@ public void run() {
778777 private void restartLater () {
779778 synchronized (SipService .this ) {
780779 int interval = NAT_MEASUREMENT_RETRY_INTERVAL ;
781- Log .d (TAG , "Retry measurement " + interval + "s later." );
782780 mTimer .cancel (this );
783781 mTimer .set (interval * 1000 , this );
784782 }
@@ -788,7 +786,7 @@ private void restartLater() {
788786 private class AutoRegistrationProcess extends SipSessionAdapter
789787 implements Runnable , SipSessionGroup .KeepAliveProcessCallback {
790788 private static final int MIN_KEEPALIVE_SUCCESS_COUNT = 10 ;
791- private String TAG = "SipAudoReg " ;
789+ private String TAG = "SipAutoReg " ;
792790
793791 private SipSessionGroup .SipSessionImpl mSession ;
794792 private SipSessionGroup .SipSessionImpl mKeepAliveSession ;
@@ -820,13 +818,12 @@ public void start(SipSessionGroup group) {
820818 // in registration to avoid adding duplicate entries to server
821819 mMyWakeLock .acquire (mSession );
822820 mSession .unregister ();
823- if (DEBUG ) TAG = mSession .getLocalProfile ().getUriString ();
824- if (DEBUG ) Log .d (TAG , "start AutoRegistrationProcess" );
821+ TAG = "SipAutoReg:" + mSession .getLocalProfile ().getUriString ();
825822 }
826823 }
827824
828825 private void startKeepAliveProcess (int interval ) {
829- Log .d (TAG , "start keepalive w interval=" + interval );
826+ if ( DEBUG ) Log .d (TAG , "start keepalive w interval=" + interval );
830827 if (mKeepAliveSession == null ) {
831828 mKeepAliveSession = mSession .duplicate ();
832829 } else {
@@ -864,9 +861,11 @@ public void onResponse(boolean portChanged) {
864861 mKeepAliveSuccessCount = 0 ;
865862 }
866863 } else {
867- Log .i (TAG , "keep keepalive going with interval "
868- + interval + ", past success count="
869- + mKeepAliveSuccessCount );
864+ if (DEBUG ) {
865+ Log .i (TAG , "keep keepalive going with interval "
866+ + interval + ", past success count="
867+ + mKeepAliveSuccessCount );
868+ }
870869 mKeepAliveSuccessCount /= 2 ;
871870 }
872871 } else {
@@ -894,7 +893,9 @@ public void onResponse(boolean portChanged) {
894893 // SipSessionGroup.KeepAliveProcessCallback
895894 @ Override
896895 public void onError (int errorCode , String description ) {
897- Log .e (TAG , "keepalive error: " + description );
896+ if (DEBUG ) {
897+ Log .e (TAG , "keepalive error: " + description );
898+ }
898899 onResponse (true ); // re-register immediately
899900 }
900901
@@ -917,7 +918,7 @@ public void stop() {
917918 public void onKeepAliveIntervalChanged () {
918919 if (mKeepAliveSession != null ) {
919920 int newInterval = getKeepAliveInterval ();
920- if (DEBUGV ) {
921+ if (DEBUG ) {
921922 Log .v (TAG , "restart keepalive w interval=" + newInterval );
922923 }
923924 mKeepAliveSuccessCount = 0 ;
@@ -987,7 +988,7 @@ public void run() {
987988 }
988989
989990 private void restart (int duration ) {
990- if ( DEBUG ) Log .d (TAG , "Refresh registration " + duration + "s later." );
991+ Log .d (TAG , "Refresh registration " + duration + "s later." );
991992 mTimer .cancel (this );
992993 mTimer .set (duration * 1000 , this );
993994 }
0 commit comments