Loading src/com/android/server/telecom/Call.java +5 −2 Original line number Diff line number Diff line Loading @@ -875,15 +875,17 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, * (see {@link CallState}), in practice those expectations break down when cellular systems * misbehave and they do this very often. The result is that we do not enforce state transitions * and instead keep the code resilient to unexpected state changes. * @return true indicates if setState succeeded in setting the state to newState, * else it is failed, and the call is still in its original state. */ public void setState(int newState, String tag) { public boolean setState(int newState, String tag) { if (mState != newState) { Log.v(this, "setState %s -> %s", mState, newState); if (newState == CallState.DISCONNECTED && shouldContinueProcessingAfterDisconnect()) { Log.w(this, "continuing processing disconnected call with another service"); mCreateConnectionProcessor.continueProcessingIfPossible(this, mDisconnectCause); return; return false; } updateVideoHistoryViaState(mState, newState); Loading Loading @@ -962,6 +964,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, StatsLog.write(StatsLog.CALL_STATE_CHANGED, newState, statsdDisconnectCause, isSelfManaged(), isExternalCall()); } return true; } void setRingbackRequested(boolean ringbackRequested) { Loading src/com/android/server/telecom/CallsManager.java +22 −18 Original line number Diff line number Diff line Loading @@ -2525,7 +2525,7 @@ public class CallsManager extends Call.ListenerBase // into a well-defined state machine. // TODO: Define expected state transitions here, and log when an // unexpected transition occurs. call.setState(newState, tag); if (call.setState(newState, tag)) { maybeShowErrorDialogOnDisconnect(call); Trace.beginSection("onCallStateChanged"); Loading @@ -2537,7 +2537,8 @@ public class CallsManager extends Call.ListenerBase updateCanAddCall(); for (CallsManagerListener listener : mListeners) { if (LogUtils.SYSTRACE_DEBUG) { Trace.beginSection(listener.getClass().toString() + " onCallStateChanged"); Trace.beginSection(listener.getClass().toString() + " onCallStateChanged"); } listener.onCallStateChanged(call, oldState, newState); if (LogUtils.SYSTRACE_DEBUG) { Loading @@ -2546,6 +2547,9 @@ public class CallsManager extends Call.ListenerBase } } Trace.endSection(); } else { Log.i(this, "failed in setting the state to new state"); } } } Loading Loading
src/com/android/server/telecom/Call.java +5 −2 Original line number Diff line number Diff line Loading @@ -875,15 +875,17 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, * (see {@link CallState}), in practice those expectations break down when cellular systems * misbehave and they do this very often. The result is that we do not enforce state transitions * and instead keep the code resilient to unexpected state changes. * @return true indicates if setState succeeded in setting the state to newState, * else it is failed, and the call is still in its original state. */ public void setState(int newState, String tag) { public boolean setState(int newState, String tag) { if (mState != newState) { Log.v(this, "setState %s -> %s", mState, newState); if (newState == CallState.DISCONNECTED && shouldContinueProcessingAfterDisconnect()) { Log.w(this, "continuing processing disconnected call with another service"); mCreateConnectionProcessor.continueProcessingIfPossible(this, mDisconnectCause); return; return false; } updateVideoHistoryViaState(mState, newState); Loading Loading @@ -962,6 +964,7 @@ public class Call implements CreateConnectionResponse, EventManager.Loggable, StatsLog.write(StatsLog.CALL_STATE_CHANGED, newState, statsdDisconnectCause, isSelfManaged(), isExternalCall()); } return true; } void setRingbackRequested(boolean ringbackRequested) { Loading
src/com/android/server/telecom/CallsManager.java +22 −18 Original line number Diff line number Diff line Loading @@ -2525,7 +2525,7 @@ public class CallsManager extends Call.ListenerBase // into a well-defined state machine. // TODO: Define expected state transitions here, and log when an // unexpected transition occurs. call.setState(newState, tag); if (call.setState(newState, tag)) { maybeShowErrorDialogOnDisconnect(call); Trace.beginSection("onCallStateChanged"); Loading @@ -2537,7 +2537,8 @@ public class CallsManager extends Call.ListenerBase updateCanAddCall(); for (CallsManagerListener listener : mListeners) { if (LogUtils.SYSTRACE_DEBUG) { Trace.beginSection(listener.getClass().toString() + " onCallStateChanged"); Trace.beginSection(listener.getClass().toString() + " onCallStateChanged"); } listener.onCallStateChanged(call, oldState, newState); if (LogUtils.SYSTRACE_DEBUG) { Loading @@ -2546,6 +2547,9 @@ public class CallsManager extends Call.ListenerBase } } Trace.endSection(); } else { Log.i(this, "failed in setting the state to new state"); } } } Loading