Skip to content

Commit

Permalink
Ensure the entire exception list is rebuilt when inserting new except…
Browse files Browse the repository at this point in the history
…ion (#3118)

Fixes #3103
  • Loading branch information
bluemarvin committed Apr 7, 2020
1 parent 633529f commit c2fa4f7
Showing 1 changed file with 9 additions and 3 deletions.
Expand Up @@ -105,18 +105,24 @@ public void onInserted(int position, int count) {
return;
}

final List<ContentBlockingException> exceptionsList = new ArrayList<>();
mContentBlockingController.clearExceptionList();
for (int i=0; i<count; i++) {
SitePermission permission = mSitePermissions.get(position + i);
ContentBlockingException exception = toContentBlockingException(permission);
if (exception != null) {
exceptionsList.add(exception);
mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange(
UrlUtils.getHost(exception.uri),
true));
}
}

final List<ContentBlockingException> exceptionsList = new ArrayList<>();
mContentBlockingController.clearExceptionList();
for (SitePermission permission: mSitePermissions) {
ContentBlockingException exception = toContentBlockingException(permission);
if (exception != null) {
exceptionsList.add(exception);
}
}
mContentBlockingController.restoreExceptionList(exceptionsList);
}

Expand Down

0 comments on commit c2fa4f7

Please sign in to comment.