OMS: reduce number of OVERLAY_CHANGED broadcasts
As part of "I63df58510:OMS: add transactional API", the OMS changed how
to broadcast OVERLAY_CHANGED. The intent used to be sent <once> when an
overlay changed state. This was modified to <once per package affected>
when an overlay changed state.
While this makes it easier for applications to detect if they have been
forced to reload their resources, the change drastically increased the
number of OVERLAY_CHANGED intents, especially when the target package is
"android" which affects all packages. To make matters worse, the package
manager responds to an OVERLAY_CHANGED intent by broadcasting
PACKAGE_CHANGED.
Ultimately the flood of intents caused lock contentions in the activity
manager.
Revert the OMS strategy for how to broadcast OVERLAY_CHANGED to the old
behaviour.
Bug: 177065099
Test: atest FrameworksServicesTests:com.android.server.om OverlayDeviceTests OverlayHostTests CtsAppSecurityHostTestCases:OverlayHostTest
Test: manual: adb exec-out cmd activity dump # check for OVERLAY_CHANGED in "Historical broadcasts"
Change-Id: I33358ce4dc1d72e6e695c70cf02ab72526592b17
1 file changed