From 0adafe3d201163cd28d6decd24150ab9f54dff04 Mon Sep 17 00:00:00 2001 From: Manuel Martin Date: Mon, 4 May 2020 20:27:19 +0200 Subject: [PATCH] Save list just once when deleting to avoid glitches (#3322) --- .../browser/content/TrackingProtectionStore.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java b/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java index 713631c6a..b305fa110 100644 --- a/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java +++ b/app/src/common/shared/org/mozilla/vrbrowser/browser/content/TrackingProtectionStore.java @@ -178,7 +178,17 @@ public void remove(@NonNull SitePermission permission) { public void removeAll() { // We can't use clearExceptionList as that clears also the private browsing exceptions - mSitePermissions.forEach(this::remove); + mSitePermissions.forEach(permission -> { + ContentBlockingException exception = toContentBlockingException(permission); + if (exception != null) { + mContentBlockingController.removeException(exception); + } + mListeners.forEach(listener -> listener.onExcludedTrackingProtectionChange( + permission.url, + false, + false)); + }); + saveExceptions(); } private void saveExceptions() {