Merge "Make thread safe when accessing AccountEntry" am: 1329e4fb6b
am: 478899e1c9

Change-Id: I3e564e629e26c9a06cb076496ab1600c695255c9
diff --git a/src/com/android/services/telephony/TelecomAccountRegistry.java b/src/com/android/services/telephony/TelecomAccountRegistry.java
index 02cd2c4..bf927fc 100644
--- a/src/com/android/services/telephony/TelecomAccountRegistry.java
+++ b/src/com/android/services/telephony/TelecomAccountRegistry.java
@@ -621,9 +621,11 @@
      * @return {@code True} if merging IMS calls is supported.
      */
     boolean isMergeImsCallSupported(PhoneAccountHandle handle) {
-        for (AccountEntry entry : mAccounts) {
-            if (entry.getPhoneAccountHandle().equals(handle)) {
-                return entry.isMergeImsCallSupported();
+        synchronized (mAccountsLock) {
+            for (AccountEntry entry : mAccounts) {
+                if (entry.getPhoneAccountHandle().equals(handle)) {
+                    return entry.isMergeImsCallSupported();
+                }
             }
         }
         return false;