Class ContentBlockingController

Object
org.mozilla.geckoview.ContentBlockingController

@AnyThread public class ContentBlockingController extends Object
ContentBlockingController is used to manage and modify the content blocking exception list. This list is shared across all sessions.
  • Constructor Details

    • ContentBlockingController

      public ContentBlockingController()
  • Method Details

    • getLog

      @UiThread @NonNull public GeckoResult<List<ContentBlockingController.LogEntry>> getLog(@NonNull GeckoSession session)
      Get a log of all content blocking information for the site currently loaded by the supplied GeckoSession.
      Parameters:
      session - A GeckoSession for which you want the content blocking log.
      Returns:
      A GeckoResult that resolves to the list of content blocking log entries.
    • getTrackingDbEventsByDateRange

      @HandlerThread @NonNull public GeckoResult<List<ContentBlockingController.TrackingDbEvent>> getTrackingDbEventsByDateRange(long dateFrom, long dateTo)
      Get content blocking events aggregated by date and type for a given date range.
      Parameters:
      dateFrom - Start of the date range, in milliseconds since epoch.
      dateTo - End of the date range, in milliseconds since epoch.
      Returns:
      A GeckoResult that resolves to the list of tracking database events.
    • sumAllTrackingDbEvents

      @HandlerThread @NonNull public GeckoResult<Integer> sumAllTrackingDbEvents()
      Get the total count of all content blocking events ever recorded.
      Returns:
      A GeckoResult that resolves to the total event count.
    • getTrackingDbEarliestRecordedDate

      @HandlerThread @NonNull public GeckoResult<Long> getTrackingDbEarliestRecordedDate()
      Get the earliest recorded date in the content blocking database.
      Returns:
      A GeckoResult that resolves to the earliest date as milliseconds since epoch, or 0 if no data exists.
    • clearTrackingDb

      @HandlerThread @NonNull public GeckoResult<Void> clearTrackingDb()
      Remove all entries from the content blocking database.
      Returns:
      A GeckoResult that completes when the database has been cleared.