Package org.mozilla.geckoview
Class ContentBlockingController
Object
org.mozilla.geckoview.ContentBlockingController
ContentBlockingController is used to manage and modify the content blocking exception list. This
list is shared across all sessions.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classContent blocking event constants and data.static classAn entry in the content blocking log for a site.static classAn entry from the content blocking aggregate database. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionRemove all entries from the content blocking database.getLog(GeckoSession session) Get a log of all content blocking information for the site currently loaded by the suppliedGeckoSession.Get the earliest recorded date in the content blocking database.getTrackingDbEventsByDateRange(long dateFrom, long dateTo) Get content blocking events aggregated by date and type for a given date range.Get the total count of all content blocking events ever recorded.
-
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 suppliedGeckoSession.- Parameters:
session- AGeckoSessionfor which you want the content blocking log.- Returns:
- A
GeckoResultthat 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
GeckoResultthat resolves to the list of tracking database events.
-
sumAllTrackingDbEvents
Get the total count of all content blocking events ever recorded.- Returns:
- A
GeckoResultthat resolves to the total event count.
-
getTrackingDbEarliestRecordedDate
Get the earliest recorded date in the content blocking database.- Returns:
- A
GeckoResultthat resolves to the earliest date as milliseconds since epoch, or 0 if no data exists.
-
clearTrackingDb
Remove all entries from the content blocking database.- Returns:
- A
GeckoResultthat completes when the database has been cleared.
-