Add null check for ims call during conference call updates

Add null check before accessing imscall object.
For conference call updates are forced by
using a null object for imscall
argument.
This enables UI update for conference calls

Bug: 17321414

Change-Id: I5667bf136af37e425040edc34dacad46de084ec4
diff --git a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
old mode 100644
new mode 100755
index 5b63b76..ef5edde
--- a/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
+++ b/src/java/com/android/internal/telephony/imsphone/ImsPhoneConnection.java
@@ -618,50 +618,51 @@
 
         changed = mParent.update(this, imsCall, state);
 
-        // Check for a change in the video capabilities for the call and update the
-        // {@link ImsPhoneConnection} with this information.
-        try {
-            // Get the current local VT capabilities (i.e. even if currentCallType above is
-            // audio-only, the local capability could support bi-directional video).
-            ImsCallProfile localCallProfile = imsCall.getLocalCallProfile();
-            if (localCallProfile != null) {
-                int localCallTypeCapability = localCallProfile.mCallType;
-                boolean newLocalVideoCapable = localCallTypeCapability
-                        == ImsCallProfile.CALL_TYPE_VT;
+        if (imsCall != null) {
+            // Check for a change in the video capabilities for the call and update the
+            // {@link ImsPhoneConnection} with this information.
+            try {
+                // Get the current local VT capabilities (i.e. even if currentCallType above is
+                // audio-only, the local capability could support bi-directional video).
+                ImsCallProfile localCallProfile = imsCall.getLocalCallProfile();
+                if (localCallProfile != null) {
+                    int localCallTypeCapability = localCallProfile.mCallType;
+                    boolean newLocalVideoCapable = localCallTypeCapability
+                            == ImsCallProfile.CALL_TYPE_VT;
 
-                if (isLocalVideoCapable() != newLocalVideoCapable) {
-                    setLocalVideoCapable(newLocalVideoCapable);
+                    if (isLocalVideoCapable() != newLocalVideoCapable) {
+                        setLocalVideoCapable(newLocalVideoCapable);
+                        changed = true;
+                    }
+                }
+            } catch (ImsException e) {
+                // No session in place -- no change
+            }
+
+            // Check for a change in the call type / video state, or audio quality of the
+            // {@link ImsCall} and update the {@link ImsPhoneConnection} with this information.
+            ImsCallProfile callProfile = imsCall.getCallProfile();
+            if (callProfile != null) {
+                int oldVideoState = getVideoState();
+                int newVideoState = ImsCallProfile.getVideoStateFromCallType(callProfile.mCallType);
+
+                if (oldVideoState != newVideoState) {
+                    setVideoState(newVideoState);
                     changed = true;
                 }
-            }
-        } catch (ImsException e) {
-            // No session in place -- no change
-        }
 
-        // Check for a change in the call type / video state, or audio quality of the
-        // {@link ImsCall} and update the {@link ImsPhoneConnection} with this information.
-        ImsCallProfile callProfile = imsCall.getCallProfile();
-        if (callProfile != null) {
-            int oldVideoState = getVideoState();
-            int newVideoState = ImsCallProfile.getVideoStateFromCallType(callProfile.mCallType);
+                ImsStreamMediaProfile mediaProfile = callProfile.mMediaProfile;
+                if (mediaProfile != null) {
+                    int oldAudioQuality = getAudioQuality();
+                    int newAudioQuality = getAudioQualityFromMediaProfile(mediaProfile);
 
-            if (oldVideoState != newVideoState) {
-                setVideoState(newVideoState);
-                changed = true;
-            }
-
-            ImsStreamMediaProfile mediaProfile = callProfile.mMediaProfile;
-            if (mediaProfile != null) {
-                int oldAudioQuality = getAudioQuality();
-                int newAudioQuality = getAudioQualityFromMediaProfile(mediaProfile);
-
-                if (oldAudioQuality != newAudioQuality) {
-                    setAudioQuality(newAudioQuality);
-                    changed = true;
+                    if (oldAudioQuality != newAudioQuality) {
+                        setAudioQuality(newAudioQuality);
+                        changed = true;
+                    }
                 }
             }
         }
-
         return changed;
     }