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

Skip to content
Commit f0f0e132 authored by TYM Tsai's avatar TYM Tsai
Browse files

Fix test failure not hold Object of PackageMonitor

PackageMonitorCallback holds a weak reference to PackageMonitor.
If no other holder, the PackageMonitor object will be recycled.
Currently, the object in SearchManagerService is held by a registered
broadcast receiver. But in PackageMonitor, registering a receiver
is not a must.  PackageMonitor refactor the structure to only
register receivers if the client is interested in a package restart
query. Otherwise, they will not register any receiver. That will
cause the object of PackageMonitor to have no any holder. After the
object is recycled, there will not be any package events that are
received and cause tests to fail.

Bug: 340410698
Test: atest CtsAppTestCases:android.app.cts.SearchManagerTest
Change-Id: I2005e257ed34523a2896bec3299a52700afab4d5
parent d24f7b2d
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment