Modifies IMS capability APIs to better support MSIM

Modifies Telephony AIDL to support IMS capability APIs
and adds support for querying MMTEL IMS registration
technology.

Bug: 35128252
Test: Telephony unit tests
Merged-In: Id6c2fc66edfe1c92f69f71c1b0db4b8e05594b6f
Change-Id: Id6c2fc66edfe1c92f69f71c1b0db4b8e05594b6f
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 253c5f9..58e2ad6 100644
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -74,6 +74,7 @@
 import android.telephony.ims.aidl.IImsMmTelFeature;
 import android.telephony.ims.aidl.IImsRcsFeature;
 import android.telephony.ims.aidl.IImsRegistration;
+import android.telephony.ims.stub.ImsRegistrationImplBase;
 import android.text.TextUtils;
 import android.util.ArraySet;
 import android.util.Log;
@@ -3286,22 +3287,13 @@
         }
     }
 
-    /*
-     * {@hide}
-     * Returns the IMS Registration Status
-     */
-    @Override
-    public boolean isImsRegistered() {
-        return mPhone.isImsRegistered();
-    }
-
     /**
      * {@hide}
      * Returns the IMS Registration Status on a particular subid
      *
      * @param subId
      */
-    public boolean isImsRegisteredForSubscriber(int subId) {
+    public boolean isImsRegistered(int subId) {
         Phone phone = getPhone(subId);
         if (phone != null) {
             return phone.isImsRegistered();
@@ -3315,27 +3307,53 @@
         return PhoneUtils.getSubIdForPhoneAccount(phoneAccount);
     }
 
-    /*
-     * {@hide}
-     * Returns the IMS Registration Status
+    /**
+     * @return the VoWiFi calling availability.
      */
-    public boolean isWifiCallingAvailable() {
-        return mPhone.isWifiCallingEnabled();
+    public boolean isWifiCallingAvailable(int subId) {
+        Phone phone = getPhone(subId);
+        if (phone != null) {
+            return phone.isWifiCallingEnabled();
+        } else {
+            return false;
+        }
     }
 
-    /*
-     * {@hide}
-     * Returns the IMS Registration Status
+    /**
+     * @return the VoLTE availability.
      */
-    public boolean isVolteAvailable() {
-        return mPhone.isVolteEnabled();
+    public boolean isVolteAvailable(int subId) {
+        Phone phone = getPhone(subId);
+        if (phone != null) {
+            return phone.isVolteEnabled();
+        } else {
+            return false;
+        }
     }
 
-    /*
-     * {@hide} Returns the IMS Registration Status
+    /**
+     * @return the VT calling availability.
      */
-    public boolean isVideoTelephonyAvailable() {
-        return mPhone.isVideoEnabled();
+    public boolean isVideoTelephonyAvailable(int subId) {
+        Phone phone = getPhone(subId);
+        if (phone != null) {
+            return phone.isVideoEnabled();
+        } else {
+            return false;
+        }
+    }
+
+    /**
+     * @return the IMS registration technology for the MMTEL feature. Valid return values are
+     * defined in {@link ImsRegistrationImplBase}.
+     */
+    public @ImsRegistrationImplBase.ImsRegistrationTech int getImsRegTechnologyForMmTel(int subId) {
+        Phone phone = getPhone(subId);
+        if (phone != null) {
+            return phone.getImsRegistrationTech();
+        } else {
+            return ImsRegistrationImplBase.REGISTRATION_TECH_NONE;
+        }
     }
 
     private boolean canReadPhoneState(String callingPackage, String message) {