AppCompatOverridesService: Remove finalizer and unregistration logic
This has no hope of currently working in production, because DeviceConfig holds a strong reference to the listener, so the finalizer never gets called - besides, this is a singleton service in system_process that shouldn't ever get collected. During testing, the finalizer is unnecessary for the same reason. The only way the class can be finalized is if the Context and the DeviceConfig both are unreachable, but then there's really no need to unregister anymore. However, during AppCompatOverridesServiceTest the finalizer invokes DeviceConfig methods on the finalizer thread concurrently with non-thread-safe stubbing in TestableDeviceConfig, causing occasional test flakes (that, due to the combined effect of the bugs at b/399645852 cause every subsequent test in the class to fail). Bug: 397997489 Test: atest AppCompatOverridesServiceTest Flag: TEST_ONLY Change-Id: Ic5ed380286df6cd41c9b1a504e237d320c37080c
Loading
Please register or sign in to comment