shadows/framework/src/main/java/org/robolectric/android/controller/ContentProviderController.java
public ContentProviderController<T> create(ProviderInfo providerInfo) {
    Context baseContext = RuntimeEnvironment.application.getBaseContext();
    // make sure the component is enabled
    ComponentName componentName =
        createRelative(baseContext.getPackageName(), contentProvider.getClass().getName());
    baseContext
        .getPackageManager()
        .setComponentEnabledSetting(
            componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0);
    contentProvider.attachInfo(baseContext, providerInfo);

    if (providerInfo != null) {
      ShadowContentResolver.registerProviderInternal(providerInfo.authority, contentProvider);
    }

    return this;
  }
public ContentProviderController<T> create(ProviderInfo providerInfo) {
    Context baseContext = RuntimeEnvironment.application.getBaseContext();
    // make sure the component is enabled
    ComponentName componentName =
        createRelative(baseContext.getPackageName(), contentProvider.getClass().getName());
    baseContext
        .getPackageManager()
        .setComponentEnabledSetting(
            componentName, PackageManager.COMPONENT_ENABLED_STATE_ENABLED, 0);
    contentProvider.attachInfo(baseContext, providerInfo);

    if (providerInfo != null) {
      ShadowContentResolver.registerProviderInternal(providerInfo.authority, contentProvider);
    }

    return this;
  }
public ContentProviderController < T > create ( ProviderInfo providerInfo ) { Context baseContext = RuntimeEnvironment . application . getBaseContext ( ) ; // make sure the component is enabled ComponentName componentName = createRelative ( baseContext . getPackageName ( ) , contentProvider . getClass ( ) . getName ( ) ) ; baseContext . getPackageManager ( ) . setComponentEnabledSetting ( componentName , PackageManager . COMPONENT_ENABLED_STATE_ENABLED , 0 ) ; contentProvider . attachInfo ( baseContext , providerInfo ) ; if ( providerInfo != null ) { ShadowContentResolver . registerProviderInternal ( providerInfo . authority , contentProvider ) ; } return this ; }
Create and register {@link ContentProvider} using the given {@link ProviderInfo}.

@param providerInfo the {@link ProviderInfo} to use
@return this {@link ContentProviderController}
Create and register { @link ContentProvider } using the given { @link ProviderInfo } .