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

Commit 5f9c6641 authored by Saurabh Chauhan's avatar Saurabh Chauhan Committed by Nathan Muggli
Browse files

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: default avatarSaurabh Chauhan <mopriadevteam@gmail.com>
(cherry picked from https://android-review.googlesource.com/q/commit:be6bf0fad89f7f9eb21773d737ab7fcb354fb599)
Merged-In: Id34300d580de58c6096fdce126a8db7521668428
Change-Id: Id34300d580de58c6096fdce126a8db7521668428
parent 17fd1190
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment