Fix[DLC system_server]: cleanup resources when no longer in use
Corrects an issue where connectors were not properly closed when no longer used, for example, after the associated user has been removed. Additionally, the handler thread on the connector will be safely quit when the connector is no longer required.
Bug: 427208905
Flag: EXEMPT fixing a bug
Test: atest DeviceLockUnitTests
Test: atest DeviceLockControllerGoogleInstrumentationTests
Test: manually run `adb shell ps -eT $(adb shell pidof system_server) | grep DeviceLockContr` after adding, switching, and removing secondary users. The thread count should not exceed the number of users created.
Change-Id: I82fe34b73427a17584650392e47be2a6016d5ff1
4 files changed