Merge "Set VT relies on presence cap issue for devices supporting new UCE stack" into sc-dev am: 1cc906f05c

Original change: https://googleplex-android-review.googlesource.com/c/platform/packages/services/Telephony/+/15534913

Change-Id: I358ffaae613586fbb4183196e77b6d3b040671a1
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index 7252f94..1d749f4 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -588,11 +588,15 @@
         private boolean isCarrierVideoPresenceSupported() {
             PersistableBundle b =
                     PhoneGlobals.getInstance().getCarrierConfigForSubId(mPhone.getSubId());
-            boolean carrierConfigEnabled = b != null
-                    && (b.getBoolean(CarrierConfigManager.KEY_USE_RCS_PRESENCE_BOOL)
-                    || b.getBoolean(
-                    CarrierConfigManager.Ims.KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL));
-            return carrierConfigEnabled && isUserContactDiscoverySettingEnabled();
+            if (b == null) return false;
+
+            // If using the new RcsUceAdapter API, this should be true if
+            // KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL is set. If using the old
+            // KEY_USE_RCS_PRESENCE_BOOL key, we have to also check the user setting.
+            return b.getBoolean(
+                    CarrierConfigManager.Ims.KEY_ENABLE_PRESENCE_CAPABILITY_EXCHANGE_BOOL)
+                    || (b.getBoolean(CarrierConfigManager.KEY_USE_RCS_PRESENCE_BOOL)
+                    && isUserContactDiscoverySettingEnabled());
         }
 
         /**