shadows/framework/src/main/java/org/robolectric/shadows/ShadowPackageManager.java
public void addOrUpdateActivity(ActivityInfo activityInfo) {
    addComponent(
        activityFilters,
        p -> p.activities,
        (p, a) -> p.activities = a,
        new ActivityInfo(activityInfo),
        true);
  }
public void addOrUpdateActivity(ActivityInfo activityInfo) {
    addComponent(
        activityFilters,
        p -> p.activities,
        (p, a) -> p.activities = a,
        new ActivityInfo(activityInfo),
        true);
  }
Adds or updates given activity in the system.

If activity 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.