Repoint Ims.IsAvailability from tele-cache to ImsService
There was a race case that occurs when an ImsService changes its capability status
and with a call against IsAvailable(capability) within the telephony component which
checks a cache. This change moves the call in ImsPhoneCallTracker from its internal
cache to instead check the capability status directly within the ImsService.
Bug: 149780842
Test: android.telephony.ims.cts.ImsServiceTest
Change-Id: I802b6917d85ef40d1234f02c4c7c3032750b4303
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index d882ab2..87c3b4d 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3424,6 +3424,9 @@
Phone phone = getPhone(subId);
if (phone == null) return false;
return phone.isImsCapabilityAvailable(capability, regTech);
+ } catch (com.android.ims.ImsException e) {
+ Log.w(LOG_TAG, "IMS isAvailable - service unavailable: " + e.getMessage());
+ return false;
} finally {
Binder.restoreCallingIdentity(token);
}