Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c7e11564 authored by Umashankar Godachi's avatar Umashankar Godachi Committed by Gerrit - the friendly Code Review server
Browse files

Fix to handle ConcurrentModificationException

Phone account list was being accessed by multiple threads
for add/remove/query at the same time.
Fix: Changed the Phone account list to CopyOnWriteArrayList
to make it thread safe.

Change-Id: Ia213ea2465bd1fe306c2dfc8ff0d71ccab55d8a9
CRs-Fixed: 812089
parent c0e5a829
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -500,7 +500,7 @@ public final class PhoneAccountRegistrar {
                    packageName,
                    phoneAccount.getAccountHandle().getComponentName().getPackageName())) {
                Log.i(this, "Removing phone account " + phoneAccount.getLabel());
                it.remove();
                mState.accounts.remove(phoneAccount);
                accountsRemoved = true;
            }
        }
@@ -617,7 +617,7 @@ public final class PhoneAccountRegistrar {
        /**
         * The complete list of {@code PhoneAccount}s known to the Telecom subsystem.
         */
        public final List<PhoneAccount> accounts = new ArrayList<>();
        public final List<PhoneAccount> accounts = new CopyOnWriteArrayList<>();

        /**
         * The version number of the State data.