getSubId returns INVALID_SUB_ID if there are no subIds for a phone.

Bug: 17399710
Change-Id: Ice47ee47ecc516d9d1ebe7cada8d1a145803d6c7
diff --git a/src/java/com/android/internal/telephony/PhoneBase.java b/src/java/com/android/internal/telephony/PhoneBase.java
index 48c994f..358bf33 100644
--- a/src/java/com/android/internal/telephony/PhoneBase.java
+++ b/src/java/com/android/internal/telephony/PhoneBase.java
@@ -1880,8 +1880,15 @@
      * Returns the subscription id.
      */
     public long getSubId() {
-        long [] subId = SubscriptionController.getInstance().getSubId(mPhoneId);
-        return subId[0];
+        long subId;
+
+        long [] subIds = SubscriptionController.getInstance().getSubId(mPhoneId);
+        if (subIds == null) {
+            subId = SubscriptionManager.INVALID_SUB_ID;
+        } else {
+            subId = subIds[0];
+        }
+        return subId;
     }
 
     /**