Fix for crash due to ConcurrentModificationException in PrintRecommendationService
We observed a crash on the DPS application's printer list screen, triggered by the Recommendations service. Steps to Reproduce: On the printer panel, change a few printers to a different network, making them unavailable on the current network. On the DPS printer list screen, wait for a considerable amount of time (approximately 40 seconds). As checked, a ConcurrentModificationException was observed in adb logs. The exception is coming from the printerRemoved function in the ServiceListener class of the PrintRecommendationService. This function is invoked via onServiceLost from the NsdManager discovery callbacks. We provided a small fix to handle this by creating a copy of the key set to avoid modifying the original mVendorHashMap. Bug: 419032342 Flag: EXEMPT bugfix Test: Go to Settings->Connected devices->Connection preferences-> Printing->Default Print Service and once the printers get listed, remove a few printers from the network. Signed-off-by:Saurabh Chauhan <mopriadevteam@gmail.com> (cherry picked from https://android-review.googlesource.com/q/commit:be6bf0fad89f7f9eb21773d737ab7fcb354fb599) Merged-In: Id34300d580de58c6096fdce126a8db7521668428 Change-Id: Id34300d580de58c6096fdce126a8db7521668428
Loading
Please register or sign in to comment