Fix crash when cookies preference is default

This commit is contained in:
Carmelo Messina 2021-12-13 17:41:33 +01:00
parent 685105abc9
commit c76c21026c
No known key found for this signature in database
GPG key ID: 968894BE688289FD

View file

@ -3,6 +3,7 @@ Date: Sat, 28 Dec 2019 10:23:04 +0100
Subject: Show site settings for cookies, javascript and ads
Avoid displaying info about intrusive ads
Fix crash when cookies preference is default
---
.../site_settings/SingleWebsiteSettings.java | 52 +++++++++----------
.../browser_ui/site_settings/Website.java | 14 +++--
@ -66,7 +67,7 @@ diff --git a/components/browser_ui/site_settings/android/java/src/org/chromium/c
+ Integer currentValue =
+ mSite.getContentSetting(browserContextHandle, ContentSettingsType.COOKIES);
+ // Always show the cookies permission
+ if (currentValue == null) {
+ if (currentValue == null || currentValue == ContentSettingValues.DEFAULT) {
+ currentValue = WebsitePreferenceBridge.isCategoryEnabled(
+ browserContextHandle, ContentSettingsType.COOKIES)
+ ? ContentSettingValues.ALLOW