diff options
author | Tyler Gunn <tgunn@google.com> | 2021-04-06 11:40:57 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2021-04-06 12:15:04 -0700 |
commit | c7e07b99a5c4151202123afffe677667b154201e (patch) | |
tree | f88b5f5dfa4363fee0f20afa96744e8da6f687a7 | |
parent | 4aebcb6a74e9663819de1e626ac1ddf609c35705 (diff) |
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
-rwxr-xr-x | telecomm/java/android/telecom/ConnectionService.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/telecomm/java/android/telecom/ConnectionService.java b/telecomm/java/android/telecom/ConnectionService.java index d8bd6a576fad..c5fc4365df7a 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; + } } |