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
This commit is contained in:
Tyler Gunn
2021-04-06 11:40:57 -07:00
parent 4aebcb6a74
commit c7e07b99a5

View File

@@ -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;
}
}