Fixing where calls disconnected from conference manager are still shown.
Traced the source of this issue to the fact the calls disconnected
from the conference manager were not being recognized as disconnected
by Telecom. When a regular call is disconnected locally, the
"precise call state changed" message from the phone reports the new
disconnected status. However, the calls disconnected via the conference
manager were not reporting their disconnected status via the "precise call
state changed handler", and thus they were not recognized as disconnected.
To fix this, in TelephonyConnections, registered a disconnect handler
to listen to disconnections from the Phone. This fixed the problem.
Bug: 17785678
Change-Id: I8b0f94f3afd2d8a961d75f7e309c598934e405c3
diff --git a/src/com/android/services/telephony/TelephonyConnection.java b/src/com/android/services/telephony/TelephonyConnection.java
index 20df3e6..9e7589c 100644
--- a/src/com/android/services/telephony/TelephonyConnection.java
+++ b/src/com/android/services/telephony/TelephonyConnection.java
@@ -41,6 +41,7 @@
private static final int MSG_PRECISE_CALL_STATE_CHANGED = 1;
private static final int MSG_RINGBACK_TONE = 2;
private static final int MSG_HANDOVER_STATE_CHANGED = 3;
+ private static final int MSG_DISCONNECT = 4;
private final Handler mHandler = new Handler() {
@Override
@@ -68,6 +69,9 @@
}
setRingbackRequested((Boolean) ((AsyncResult) msg.obj).result);
break;
+ case MSG_DISCONNECT:
+ updateState();
+ break;
}
}
};
@@ -364,6 +368,7 @@
getPhone().unregisterForPreciseCallStateChanged(mHandler);
getPhone().unregisterForRingbackTone(mHandler);
getPhone().unregisterForHandoverStateChanged(mHandler);
+ getPhone().unregisterForDisconnect(mHandler);
}
mOriginalConnection = originalConnection;
getPhone().registerForPreciseCallStateChanged(
@@ -371,6 +376,7 @@
getPhone().registerForHandoverStateChanged(
mHandler, MSG_HANDOVER_STATE_CHANGED, null);
getPhone().registerForRingbackTone(mHandler, MSG_RINGBACK_TONE, null);
+ getPhone().registerForDisconnect(mHandler, MSG_DISCONNECT, null);
mOriginalConnection.addPostDialListener(mPostDialListener);
mOriginalConnection.addListener(mOriginalConnectionListener);