Do not verify ImsService is connected for MMTEL user settings

Perform a partial revert of ag/14804216, which caused a RemoteException
to be thrown for the case where there is no ImsService up. This is a
regression in the API contract, so it must be partially reverted.

Instead, we will allow the user setting to be applied and the ImsService
will pick up the change when it comes back up.

Fixes: 192930411
Test: atest CtsTelephonyTestCases
Change-Id: I3aa06588af8391f61155663c6c6818d1bed4b89f
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 3e8cf42..47b496b 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -4092,7 +4092,7 @@
         final long token = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isEnhanced4gLteModeSettingEnabledByUser();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4108,7 +4108,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setEnhanced4gLteModeSetting(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4128,7 +4129,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isVtEnabledByUser();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4144,7 +4145,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setVtSetting(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4164,7 +4166,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isWfcEnabledByUser();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4180,7 +4182,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setWfcSetting(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4201,7 +4204,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isCrossSimCallingEnabledByUser();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4224,7 +4227,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setCrossSimCallingEnabled(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4245,7 +4249,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isWfcRoamingEnabledByUser();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4261,7 +4265,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setWfcRoamingSetting(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4277,7 +4282,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting will be ignored if the ImsService isn't up.
             ImsManager.getInstance(mApp, slotId).setWfcNonPersistent(isCapable, mode);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4297,7 +4302,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).getWfcMode(false /*isRoaming*/);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4313,7 +4318,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setWfcMode(mode, false /*isRoaming*/);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4328,7 +4334,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).getWfcMode(true /*isRoaming*/);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4344,7 +4350,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setWfcMode(mode, true /*isRoaming*/);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4360,7 +4367,8 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify. The
+            // new setting will be picked up when the ImsService comes up next if it isn't up.
             ImsManager.getInstance(mApp, slotId).setRttEnabled(isEnabled);
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());
@@ -4380,7 +4388,7 @@
         final long identity = Binder.clearCallingIdentity();
         try {
             int slotId = getSlotIndexOrException(subId);
-            verifyImsMmTelConfiguredOrThrow(slotId);
+            // This setting doesn't require an active ImsService connection, so do not verify.
             return ImsManager.getInstance(mApp, slotId).isTtyOnVoLteCapable();
         } catch (ImsException e) {
             throw new ServiceSpecificException(e.getCode());