[Bugfix] avoid deadlock caused by AppBatteryTracker.dump
AppBatteryTracker.dump -> BaseAppStatePolicy.shouldExemptUid -> getBackgroundRestrictionExemptionReason -> getPotentialSystemExemptionReason -> isProfileOwner
Getting mlock first in AppBatteryTracker.dump() and then getting AMS lock in isProfileOwner() is an inappropriate lock order in the above call chain. This is inconsistent with the method of getting AMS lock first and then mlock lock in most method calls, so it will cause deadlock and cause watchdog.
Similar bug cases include 366150181, 358274041
Bug:366150181
Test: Manual test
Change-Id: I8a1b509a1e95ad8570f3d4c248f9e0ed346962ad
Signed-off-by:
panhaihui <panhaihui@xiaomi.com>
Loading
Please register or sign in to comment