[mobile] wrap the get-or-create block in a `synchronized`
The bug: while the subIdRepositoryCache is using ConcurrentHashMap, the `get` (which returns null the first time) does not synchronize with the call to `createRepositoryForSubId`. This means that if multiple getters happen at the same time, we can end up creating multiple repositories. The fix: synchronize both functions around the map. Test: MobileConnectionsRepositoryTest Test: manually logging creations of the mobile connection repositories Bug: 405396564 Flag: EXEMPT bugfix Change-Id: Ibcb6d0aa9b2732d175280910326cfea181001d83
Loading
Please register or sign in to comment