Fix parentID for conference call support.

Bug:16844332
Bug:16449372
Change-Id: I815df3aa8c2cf9db5dd20d670a64e3fd59493f56
diff --git a/src/com/android/incallui/Call.java b/src/com/android/incallui/Call.java
index 01f2e8b..075ec98 100644
--- a/src/com/android/incallui/Call.java
+++ b/src/com/android/incallui/Call.java
@@ -169,7 +169,6 @@
     private final String mId;
     private int mState = State.INVALID;
     private int mDisconnectCause;
-    private String mParentCallId;
     private int mSessionModificationState;
     private final List<String> mChildCallIds = new ArrayList<>();
 
@@ -205,11 +204,6 @@
         setState(translateState(mTelecommCall.getState()));
         setDisconnectCause(mTelecommCall.getDetails().getDisconnectCauseCode());
 
-        if (mTelecommCall.getParent() != null) {
-            mParentCallId = CallList.getInstance().getCallByTelecommCall(
-                    mTelecommCall.getParent()).getId();
-        }
-
         if (mTelecommCall.getVideoCall() != null) {
             if (mVideoCallListener == null) {
                 mVideoCallListener = new InCallVideoCallListener(this);
@@ -264,7 +258,7 @@
     }
 
     public int getState() {
-        if (mParentCallId != null) {
+        if (mTelecommCall.getParent() != null) {
             return State.CONFERENCED;
         } else {
             return mState;
@@ -343,7 +337,11 @@
     }
 
     public String getParentId() {
-        return mParentCallId;
+        android.telecomm.Call parentCall = mTelecommCall.getParent();
+        if (parentCall != null) {
+            return CallList.getInstance().getCallByTelecommCall(parentCall).getId();
+        }
+        return null;
     }
 
     public int getVideoState() {
@@ -385,7 +383,7 @@
                 State.toString(mState),
                 PhoneCapabilities.toString(mTelecommCall.getDetails().getCallCapabilities()),
                 mChildCallIds,
-                mParentCallId,
+                getParentId(),
                 mTelecommCall.getDetails().getVideoState());
     }
 }