shadows/framework/src/main/java/org/robolectric/shadows/ShadowPackageManager.java
public void addOrUpdateProvider(ProviderInfo providerInfo) {
    addComponent(
        providerFilters,
        p -> p.providers,
        (p, a) -> p.providers = a,
        new ProviderInfo(providerInfo),
        true);
  }
public void addOrUpdateProvider(ProviderInfo providerInfo) {
    addComponent(
        providerFilters,
        p -> p.providers,
        (p, a) -> p.providers = a,
        new ProviderInfo(providerInfo),
        true);
  }
Adds or updates given content provider in the system.

If content provider with the same {@link ComponentInfo#name} and {@code
ComponentInfo#packageName} exists it will be updated. Its {@link ComponentInfo#applicationInfo}
is always set to {@link ApplicationInfo} already existing in the system, but if no
application exists a new one will be created using {@link ComponentInfo#applicationInfo} in
this component.