Merge "Make thread safe when accessing AccountEntry"
am: 1329e4fb6b
Change-Id: Id188787eb006b2f861e08529de8df92fbc7d833a
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;