From c7e07b99a5c4151202123afffe677667b154201e Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Tue, 6 Apr 2021 11:40:57 -0700 Subject: [PATCH] Add unit test init method. When trying to write some connectionservice unit tests, it became clear that the mAreAccountsInitialized precondition adds a LOT of overhead and test scaffolding. It was easier to just be able to bypass that in the unit tests. Test: Added as part of unit test. Bug: 178649879 Change-Id: Ibed3e69215dad59b252193f701508c18f43b59a2 --- telecomm/java/android/telecom/ConnectionService.java | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index d8bd6a576fad5..c5fc4365df7ab 100755 --- a/telecomm/java/android/telecom/ConnectionService.java +++ b/telecomm/java/android/telecom/ConnectionService.java @@ -3448,4 +3448,13 @@ public abstract class ConnectionService extends Service { public Handler getHandler() { return mHandler; } + + /** + * Sets this {@link ConnectionService} ready for testing purposes. + * @hide + */ + @VisibleForTesting + public void setReadyForTest() { + mAreAccountsInitialized = true; + } }