Merge "Updaing ShadowAccountManager to extending from official shadow library" into main

This commit is contained in:
Fan Wu
2024-01-24 03:52:17 +00:00
committed by Android (Google) Code Review
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);
}