Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +27 −0 Original line number Diff line number Diff line Loading @@ -212,9 +212,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { private static final int EVENT_DATA_ENABLED_CHANGED = 23; private static final int EVENT_GET_IMS_SERVICE = 24; private static final int EVENT_CHECK_FOR_WIFI_HANDOVER = 25; private static final int EVENT_CLEAR_DISCONNECTING_CONN = 26; private static final int TIMEOUT_HANGUP_PENDINGMO = 500; // The number of milliseconds the CallTracker will wait before manually disconnecting the // connection due to the modem not responding. private static final int TIMEOUT_CLEAR_DISCONNECTING_CONN = 5000; // The number of times we will try to connect to the ImsService before giving up. private static final int NUM_IMS_SERVICE_RETRIES = 10; // The number of milliseconds in between each try. Loading Loading @@ -1079,6 +1084,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } ImsCall imsCall = call.getImsCall(); // Get first connection that is associated with imsCall. ImsPhoneConnection imsPhoneConnection = call.getFirstConnection(); boolean rejectCall = false; if (call == mRingingCall) { Loading @@ -1105,6 +1112,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } call.onHangupLocal(); // Schedule a cleaning event for the ImsPhoneCall. If the modem has not responded in // TIMEOUT_CLEAR_DISCONNECTING_CONN milliseconds, manually disconnect the connection. if (!hasMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection)) { sendMessageDelayed(obtainMessage(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection), TIMEOUT_CLEAR_DISCONNECTING_CONN); } try { if (imsCall != null) { Loading Loading @@ -2413,6 +2426,20 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } } break; case EVENT_CLEAR_DISCONNECTING_CONN: if (msg.obj instanceof ImsPhoneConnection) { ImsPhoneConnection imsPhoneConnection = (ImsPhoneConnection) msg.obj; removeMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection); // We have timed out waiting for the modem while disconnecting this connection. // Manually disconnect to avoid tracking an invalid call. if (imsPhoneConnection != null && imsPhoneConnection.isDisconnecting()) { Rlog.e(LOG_TAG, "No response from modem. Manually disconnecting: " + imsPhoneConnection); imsPhoneConnection.onDisconnect(); } } break; } } Loading src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +11 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class ImsPhoneConnection extends Connection implements private Bundle mExtras = new Bundle(); private boolean mDisconnected; private boolean mDisconnecting = false; /* int mIndex; // index in ImsPhoneCallTracker.connections[], -1 if unassigned Loading Loading @@ -388,9 +389,18 @@ public class ImsPhoneConnection extends Connection implements */ void onHangupLocal() { mDisconnecting = true; mCause = DisconnectCause.LOCAL; } /** * Return whether or not this connection is DISCONNECTING and waiting for a signal from the * modem to disconnect. */ boolean isDisconnecting() { return mDisconnecting; } /** Called when the connection has been disconnected */ @Override public boolean onDisconnect(int cause) { Loading @@ -409,6 +419,7 @@ public class ImsPhoneConnection extends Connection implements mDisconnectTime = System.currentTimeMillis(); mDuration = SystemClock.elapsedRealtime() - mConnectTimeReal; mDisconnecting = false; mDisconnected = true; mOwner.mPhone.notifyDisconnect(this); Loading Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneCallTracker.java +27 −0 Original line number Diff line number Diff line Loading @@ -212,9 +212,14 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { private static final int EVENT_DATA_ENABLED_CHANGED = 23; private static final int EVENT_GET_IMS_SERVICE = 24; private static final int EVENT_CHECK_FOR_WIFI_HANDOVER = 25; private static final int EVENT_CLEAR_DISCONNECTING_CONN = 26; private static final int TIMEOUT_HANGUP_PENDINGMO = 500; // The number of milliseconds the CallTracker will wait before manually disconnecting the // connection due to the modem not responding. private static final int TIMEOUT_CLEAR_DISCONNECTING_CONN = 5000; // The number of times we will try to connect to the ImsService before giving up. private static final int NUM_IMS_SERVICE_RETRIES = 10; // The number of milliseconds in between each try. Loading Loading @@ -1079,6 +1084,8 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } ImsCall imsCall = call.getImsCall(); // Get first connection that is associated with imsCall. ImsPhoneConnection imsPhoneConnection = call.getFirstConnection(); boolean rejectCall = false; if (call == mRingingCall) { Loading @@ -1105,6 +1112,12 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } call.onHangupLocal(); // Schedule a cleaning event for the ImsPhoneCall. If the modem has not responded in // TIMEOUT_CLEAR_DISCONNECTING_CONN milliseconds, manually disconnect the connection. if (!hasMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection)) { sendMessageDelayed(obtainMessage(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection), TIMEOUT_CLEAR_DISCONNECTING_CONN); } try { if (imsCall != null) { Loading Loading @@ -2413,6 +2426,20 @@ public class ImsPhoneCallTracker extends CallTracker implements ImsPullCall { } } break; case EVENT_CLEAR_DISCONNECTING_CONN: if (msg.obj instanceof ImsPhoneConnection) { ImsPhoneConnection imsPhoneConnection = (ImsPhoneConnection) msg.obj; removeMessages(EVENT_CLEAR_DISCONNECTING_CONN, imsPhoneConnection); // We have timed out waiting for the modem while disconnecting this connection. // Manually disconnect to avoid tracking an invalid call. if (imsPhoneConnection != null && imsPhoneConnection.isDisconnecting()) { Rlog.e(LOG_TAG, "No response from modem. Manually disconnecting: " + imsPhoneConnection); imsPhoneConnection.onDisconnect(); } } break; } } Loading
src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java +11 −0 Original line number Diff line number Diff line Loading @@ -66,6 +66,7 @@ public class ImsPhoneConnection extends Connection implements private Bundle mExtras = new Bundle(); private boolean mDisconnected; private boolean mDisconnecting = false; /* int mIndex; // index in ImsPhoneCallTracker.connections[], -1 if unassigned Loading Loading @@ -388,9 +389,18 @@ public class ImsPhoneConnection extends Connection implements */ void onHangupLocal() { mDisconnecting = true; mCause = DisconnectCause.LOCAL; } /** * Return whether or not this connection is DISCONNECTING and waiting for a signal from the * modem to disconnect. */ boolean isDisconnecting() { return mDisconnecting; } /** Called when the connection has been disconnected */ @Override public boolean onDisconnect(int cause) { Loading @@ -409,6 +419,7 @@ public class ImsPhoneConnection extends Connection implements mDisconnectTime = System.currentTimeMillis(); mDuration = SystemClock.elapsedRealtime() - mConnectTimeReal; mDisconnecting = false; mDisconnected = true; mOwner.mPhone.notifyDisconnect(this); Loading