Package com.cefrium

Class CefriumInitProvider

java.lang.Object
android.content.ContentProvider
com.cefrium.CefriumInitProvider
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.ComponentCallbacks2

public final class CefriumInitProvider extends android.content.ContentProvider
Zero-config initializer for the Cefrium SDK.

Declared in the SDK manifest, the Android framework instantiates this ContentProvider automatically at app launch — before any Activity — in the browser (main) process. Its onCreate() runs the per-process Chromium plumbing and initializes the engine (Cefrium.initialize(android.content.Context)), at the same startup phase the manual Application.onCreate() pattern used to.

Initializing here (rather than lazily on first browser creation) is deliberate: CEF's context initialization completes asynchronously on the UI message loop, so a browser can only be created after the looper has spun past it. Doing init at app launch leaves the whole startup-to-first-Activity window for that to happen; initializing synchronously inside the first createWithSurface() would crash (no looper iteration between init and browser creation).

This is why a consumer needs no custom Application and no explicit Cefrium.initialize() call. Cefrium.initialize(android.content.Context) is a no-op in Chromium child processes, which self-initialize. The provider performs no data operations — every query method below is an inert stub.

  • Nested Class Summary

    Nested classes/interfaces inherited from class android.content.ContentProvider

    android.content.ContentProvider.CallingIdentity, android.content.ContentProvider.PipeDataWriter<T>
  • Field Summary

    Fields inherited from interface android.content.ComponentCallbacks2

    TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    delete(android.net.Uri uri, String selection, String[] selectionArgs)
     
    getType(android.net.Uri uri)
     
    android.net.Uri
    insert(android.net.Uri uri, android.content.ContentValues values)
     
    boolean
     
    android.database.Cursor
    query(android.net.Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
     
    int
    update(android.net.Uri uri, android.content.ContentValues values, String selection, String[] selectionArgs)
     

    Methods inherited from class android.content.ContentProvider

    applyBatch, applyBatch, attachInfo, bulkInsert, call, call, canonicalize, clearCallingIdentity, delete, dump, getCallingAttributionSource, getCallingAttributionTag, getCallingPackage, getCallingPackageUnchecked, getContext, getPathPermissions, getReadPermission, getStreamTypes, getTypeAnonymous, getWritePermission, insert, isTemporary, onCallingPackageChanged, onConfigurationChanged, onLowMemory, onTrimMemory, openAssetFile, openAssetFile, openFile, openFile, openFileHelper, openPipeHelper, openTypedAssetFile, openTypedAssetFile, query, query, refresh, requireContext, restoreCallingIdentity, setPathPermissions, setReadPermission, setWritePermission, shutdown, uncanonicalize, update

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CefriumInitProvider

      public CefriumInitProvider()
  • Method Details

    • onCreate

      public boolean onCreate()
      Specified by:
      onCreate in class android.content.ContentProvider
    • query

      public android.database.Cursor query(android.net.Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
      Specified by:
      query in class android.content.ContentProvider
    • getType

      public String getType(android.net.Uri uri)
      Specified by:
      getType in class android.content.ContentProvider
    • insert

      public android.net.Uri insert(android.net.Uri uri, android.content.ContentValues values)
      Specified by:
      insert in class android.content.ContentProvider
    • delete

      public int delete(android.net.Uri uri, String selection, String[] selectionArgs)
      Specified by:
      delete in class android.content.ContentProvider
    • update

      public int update(android.net.Uri uri, android.content.ContentValues values, String selection, String[] selectionArgs)
      Specified by:
      update in class android.content.ContentProvider