Add ability to add sim-initiated MO call to UI (4/4)
Yorke Lee [Sat, 4 Oct 2014 00:37:40 +0000 (17:37 -0700)]
Pass in connection when calling notifyUnknownConnection

Bug: 16852844
Change-Id: I52a0eb7ab8bc767db34ccee4d55a2c7b6bd363f5

src/java/com/android/internal/telephony/gsm/GSMPhone.java
src/java/com/android/internal/telephony/gsm/GsmCallTracker.java

index c833548..211d397 100644 (file)
@@ -448,8 +448,8 @@ public class GSMPhone extends PhoneBase {
         mNotifier.notifyDisconnectCause(cn.getDisconnectCause(), cn.getPreciseDisconnectCause());
     }
 
-    void notifyUnknownConnection() {
-        mUnknownConnectionRegistrants.notifyResult(this);
+    void notifyUnknownConnection(Connection cn) {
+        mUnknownConnectionRegistrants.notifyResult(cn);
     }
 
     void notifySuppServiceFailed(SuppService code) {
index 66a7768..d4088f2 100755 (executable)
@@ -434,6 +434,7 @@ public final class GsmCallTracker extends CallTracker {
         }
 
         Connection newRinging = null; //or waiting
+        Connection newUnknown = null;
         boolean hasNonHangupStateChanged = false;   // Any change besides
                                                     // a dropped connection
         boolean hasAnyCallDisconnected = false;
@@ -518,6 +519,8 @@ public final class GsmCallTracker extends CallTracker {
                             }
                         }
 
+                        newUnknown = mConnections[i];
+
                         unknownConnectionAppeared = true;
                     }
                 }
@@ -632,7 +635,7 @@ public final class GsmCallTracker extends CallTracker {
         updatePhoneState();
 
         if (unknownConnectionAppeared) {
-            mPhone.notifyUnknownConnection();
+            mPhone.notifyUnknownConnection(newUnknown);
         }
 
         if (hasNonHangupStateChanged || newRinging != null || hasAnyCallDisconnected) {