Merge "display the phone number from the correct subId" into qt-qpr1-dev am: 33a1dfcde4
am: 50e6c8bc37

Change-Id: I2e752d1eb4fa50ef22fa2f7d3b249b2d905fcf40
diff --git a/src/com/android/phone/NotificationMgr.java b/src/com/android/phone/NotificationMgr.java
index 3edf583..8c6d23c 100644
--- a/src/com/android/phone/NotificationMgr.java
+++ b/src/com/android/phone/NotificationMgr.java
@@ -661,8 +661,16 @@
         // Navigate to "Network Selection Settings" which list all subscriptions.
         PendingIntent contentIntent = PendingIntent.getActivity(mContext, 0,
                 new Intent(ACTION_MOBILE_NETWORK_LIST), 0);
-        String line1Num = mTelephonyManager.getLine1Number(subId);
-
+        // Display phone number from the other sub
+        String line1Num = null;
+        SubscriptionManager subMgr = (SubscriptionManager) mContext.getSystemService(
+            Context.TELEPHONY_SUBSCRIPTION_SERVICE);
+        List<SubscriptionInfo> subList = subMgr.getActiveSubscriptionInfoList(false);
+        for (SubscriptionInfo sub : subList) {
+            if (sub.getSubscriptionId() != subId) {
+                line1Num = mTelephonyManager.getLine1Number(sub.getSubscriptionId());
+            }
+        }
         final CharSequence contentText = TextUtils.isEmpty(line1Num) ?
             String.format(mContext.getText(
                 R.string.limited_sim_function_notification_message).toString(), carrierName) :