Refactor FeatureFactory

Not use reflection, sets the FeatureFactoryImpl in SettingsApplication
instead.

Bug: 286764889
Test: m Settings
Test: m SettingsSpaUnitTests
Test: m RunSettingsRoboTests
Change-Id: I881bf1009a94222fc89578d14a6792a6e1507be2
This commit is contained in:
Chaohui Wang
2023-06-12 12:19:46 +08:00
parent a09fd45249
commit 63eddc12dd
10 changed files with 451 additions and 716 deletions

View File

@@ -95,8 +95,9 @@ public class FakeFeatureFactory extends FeatureFactory {
* Call this in {@code @Before} method of the test class to use fake factory.
*/
public static FakeFeatureFactory setupForTest() {
sFactory = new FakeFeatureFactory();
return (FakeFeatureFactory) sFactory;
FakeFeatureFactory factory = new FakeFeatureFactory();
setFactory(getAppContext(), factory);
return factory;
}
/**