Add test API to retrieve service connections for test verification.

This will allow tests to verify the current AMS state without having to
resort to parsing dumpsys output.

Bug: 424003130
Flag: TEST_ONLY
Test: atest android.app.cts.service.ServiceTest
Change-Id: I2dde02e0aba3667c7b1e209106ca0a989d87921f
7 files changed