diff options
author | Etan Cohen <etancohen@google.com> | 2020-04-23 09:44:18 -0700 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2020-04-23 17:38:19 +0000 |
commit | 60f54981717ff8d0a5ad02f7de487daf0b16e690 (patch) | |
tree | d157f8165369d369a72d1a027acec03cb01cbad5 /service | |
parent | a5e641328ea7995dd9177ecfbc20c45abbe513c7 (diff) |
HDM: Resolve concurrent access issue - defer execution
Bug: 154582017
Test: atest com.android.server.wifi
Test: Unable to repro crash with the shell command to repro the scenario.
Change-Id: Ibfa2b7a23e5eadd42fe5a455890f7446e772f5ac
Diffstat (limited to 'service')
-rw-r--r-- | service/java/com/android/server/wifi/HalDeviceManager.java | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/HalDeviceManager.java b/service/java/com/android/server/wifi/HalDeviceManager.java index e47a33efb..783c91adf 100644 --- a/service/java/com/android/server/wifi/HalDeviceManager.java +++ b/service/java/com/android/server/wifi/HalDeviceManager.java @@ -2087,15 +2087,20 @@ public class HalDeviceManager { private void dispatchAllDestroyedListeners() { if (VDBG) Log.d(TAG, "dispatchAllDestroyedListeners"); + List<InterfaceDestroyedListenerProxy> triggerList = new ArrayList<>(); synchronized (mLock) { for (InterfaceCacheEntry cacheEntry: mInterfaceInfoCache.values()) { for (InterfaceDestroyedListenerProxy listener : cacheEntry.destroyedListeners) { - listener.trigger(); + triggerList.add(listener); } cacheEntry.destroyedListeners.clear(); // for insurance } mInterfaceInfoCache.clear(); } + + for (InterfaceDestroyedListenerProxy listener : triggerList) { + listener.trigger(); + } } private abstract class ListenerProxy<LISTENER> { |