Updaing ShadowAccountManager to extending from official shadow library

Bug: 319052511

Test: atest SettingsRoboTests
Change-Id: I53ec4261351f49305bb90ff10a6c00549a31e428
This commit is contained in:
Fan Wu
2024-01-12 12:04:29 +08:00
parent a01eee9bd2
commit 79b289b71e
2 changed files with 19 additions and 11 deletions

View File

@@ -31,7 +31,7 @@ import java.util.List;
import java.util.Map;
@Implements(AccountManager.class)
public class ShadowAccountManager {
public class ShadowAccountManager extends org.robolectric.shadows.ShadowAccountManager {
private static final Map<String, AuthenticatorDescription> sAuthenticators = new HashMap<>();
private static final Map<Integer, List<Account>> sAccountsByUserId = new HashMap<>();
@@ -41,7 +41,8 @@ public class ShadowAccountManager {
return sAuthenticators.values().toArray(new AuthenticatorDescription[sAuthenticators.size()]);
}
public static void addAuthenticator(AuthenticatorDescription authenticator) {
@Override
public void addAuthenticator(AuthenticatorDescription authenticator) {
sAuthenticators.put(authenticator.type, authenticator);
}