Loading services/java/com/android/server/sip/SipService.java +23 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,23 @@ public final class SipService extends ISipService.Stub { b.get(ConnectivityManager.EXTRA_NETWORK_INFO); String type = netInfo.getTypeName(); NetworkInfo.State state = netInfo.getState(); NetworkInfo activeNetInfo = getActiveNetworkInfo(); if (activeNetInfo != null) { Log.v(TAG, "active network: " + activeNetInfo.getTypeName() + ((activeNetInfo.getState() == NetworkInfo.State.CONNECTED) ? " CONNECTED" : " DISCONNECTED")); } else { Log.v(TAG, "active network: null"); } if ((state == NetworkInfo.State.CONNECTED) && (activeNetInfo != null) && (activeNetInfo.getType() != netInfo.getType())) { Log.d(TAG, "ignore connect event: " + type + ", active: " + activeNetInfo.getTypeName()); return; } if (state == NetworkInfo.State.CONNECTED) { Log.v(TAG, "Connectivity alert: CONNECTED " + type); onChanged(type, true); Loading @@ -785,6 +802,12 @@ public final class SipService extends ISipService.Stub { } } private NetworkInfo getActiveNetworkInfo() { ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo(); } private void onChanged(String type, boolean connected) { synchronized (SipService.this) { // When turning on WIFI, it needs some time for network Loading voip/java/android/net/sip/SipAudioCallImpl.java +12 −11 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCalling(SipAudioCallImpl.this); listener.onCalling(this); } catch (Throwable t) { Log.e(TAG, "onCalling()", t); } Loading @@ -198,7 +198,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onRingingBack(SipAudioCallImpl.this); listener.onRingingBack(this); } catch (Throwable t) { Log.e(TAG, "onRingingBack()", t); } Loading Loading @@ -251,9 +251,9 @@ public class SipAudioCallImpl extends SipSessionAdapter if (listener != null) { try { if (mHold) { listener.onCallHeld(SipAudioCallImpl.this); listener.onCallHeld(this); } else { listener.onCallEstablished(SipAudioCallImpl.this); listener.onCallEstablished(this); } } catch (Throwable t) { Log.e(TAG, "onCallEstablished()", t); Loading @@ -268,7 +268,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCallEnded(SipAudioCallImpl.this); listener.onCallEnded(this); } catch (Throwable t) { Log.e(TAG, "onCallEnded()", t); } Loading @@ -282,7 +282,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCallBusy(SipAudioCallImpl.this); listener.onCallBusy(this); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -302,7 +302,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, mErrorCode, message); listener.onError(this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -310,9 +310,10 @@ public class SipAudioCallImpl extends SipSessionAdapter } @Override public void onError(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip session error: " + errorCode + ": " + message); mErrorCode = getErrorCode(errorCode); public void onError(ISipSession session, String errorCodeString, String message) { Log.d(TAG, "sip session error: " + errorCodeString + ": " + message); SipErrorCode errorCode = mErrorCode = getErrorCode(errorCodeString); mErrorMessage = message; synchronized (this) { if ((mErrorCode == SipErrorCode.DATA_CONNECTION_LOST) Loading @@ -323,7 +324,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, mErrorCode, message); listener.onError(this, errorCode, message); } catch (Throwable t) { Log.e(TAG, "onError()", t); } Loading Loading
services/java/com/android/server/sip/SipService.java +23 −0 Original line number Diff line number Diff line Loading @@ -771,6 +771,23 @@ public final class SipService extends ISipService.Stub { b.get(ConnectivityManager.EXTRA_NETWORK_INFO); String type = netInfo.getTypeName(); NetworkInfo.State state = netInfo.getState(); NetworkInfo activeNetInfo = getActiveNetworkInfo(); if (activeNetInfo != null) { Log.v(TAG, "active network: " + activeNetInfo.getTypeName() + ((activeNetInfo.getState() == NetworkInfo.State.CONNECTED) ? " CONNECTED" : " DISCONNECTED")); } else { Log.v(TAG, "active network: null"); } if ((state == NetworkInfo.State.CONNECTED) && (activeNetInfo != null) && (activeNetInfo.getType() != netInfo.getType())) { Log.d(TAG, "ignore connect event: " + type + ", active: " + activeNetInfo.getTypeName()); return; } if (state == NetworkInfo.State.CONNECTED) { Log.v(TAG, "Connectivity alert: CONNECTED " + type); onChanged(type, true); Loading @@ -785,6 +802,12 @@ public final class SipService extends ISipService.Stub { } } private NetworkInfo getActiveNetworkInfo() { ConnectivityManager cm = (ConnectivityManager) mContext.getSystemService(Context.CONNECTIVITY_SERVICE); return cm.getActiveNetworkInfo(); } private void onChanged(String type, boolean connected) { synchronized (SipService.this) { // When turning on WIFI, it needs some time for network Loading
voip/java/android/net/sip/SipAudioCallImpl.java +12 −11 Original line number Diff line number Diff line Loading @@ -184,7 +184,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCalling(SipAudioCallImpl.this); listener.onCalling(this); } catch (Throwable t) { Log.e(TAG, "onCalling()", t); } Loading @@ -198,7 +198,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onRingingBack(SipAudioCallImpl.this); listener.onRingingBack(this); } catch (Throwable t) { Log.e(TAG, "onRingingBack()", t); } Loading Loading @@ -251,9 +251,9 @@ public class SipAudioCallImpl extends SipSessionAdapter if (listener != null) { try { if (mHold) { listener.onCallHeld(SipAudioCallImpl.this); listener.onCallHeld(this); } else { listener.onCallEstablished(SipAudioCallImpl.this); listener.onCallEstablished(this); } } catch (Throwable t) { Log.e(TAG, "onCallEstablished()", t); Loading @@ -268,7 +268,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCallEnded(SipAudioCallImpl.this); listener.onCallEnded(this); } catch (Throwable t) { Log.e(TAG, "onCallEnded()", t); } Loading @@ -282,7 +282,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onCallBusy(SipAudioCallImpl.this); listener.onCallBusy(this); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -302,7 +302,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, mErrorCode, message); listener.onError(this, mErrorCode, message); } catch (Throwable t) { Log.e(TAG, "onCallBusy()", t); } Loading @@ -310,9 +310,10 @@ public class SipAudioCallImpl extends SipSessionAdapter } @Override public void onError(ISipSession session, String errorCode, String message) { Log.d(TAG, "sip session error: " + errorCode + ": " + message); mErrorCode = getErrorCode(errorCode); public void onError(ISipSession session, String errorCodeString, String message) { Log.d(TAG, "sip session error: " + errorCodeString + ": " + message); SipErrorCode errorCode = mErrorCode = getErrorCode(errorCodeString); mErrorMessage = message; synchronized (this) { if ((mErrorCode == SipErrorCode.DATA_CONNECTION_LOST) Loading @@ -323,7 +324,7 @@ public class SipAudioCallImpl extends SipSessionAdapter Listener listener = mListener; if (listener != null) { try { listener.onError(SipAudioCallImpl.this, mErrorCode, message); listener.onError(this, errorCode, message); } catch (Throwable t) { Log.e(TAG, "onError()", t); } Loading