Fix WMS instance leakage of WmTests
It may be common to register a non-static inner class object to DeviceConfig.addOnPropertiesChangedListener: WindowManagerConstants HighRefreshRateDenylist SplashScreenExceptionList WindowOrientationListener.OrientationSensorJudge That may hold reference chain to WindowManagerService. It may be annoying to add test-only code to dispose them once a new path is added, so hook the registration to make sure that all listeners can be released after a test method is finished. For test using FakeDeviceConfig, it only registers to the local fake instance, so it doesn't need to dispose. Bug: 219640050 Test: atest SystemServicesTestRuleTest Change-Id: Ic06d85978886caaea3a9eb123a7a59712b58bb92 Merged-In: Ic06d85978886caaea3a9eb123a7a59712b58bb92
Loading
Please register or sign in to comment