+ // Set the `firstPartyCookiesPreference` icon.
+ if (firstPartyCookiesEnabledBoolean) {
+ firstPartyCookiesPreference.setIcon(R.drawable.cookies_enabled);
+ } else {
+ firstPartyCookiesPreference.setIcon(R.drawable.cookies_disabled);
+ }
+
+ // Set the `thirdPartyCookiesPreference` icon.
+ if (firstPartyCookiesEnabledBoolean && Build.VERSION.SDK_INT >= 21) {
+ if (thirdPartyCookiesEnabledBoolean) {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_warning);
+ } else {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_disabled);
+ }
+ } else {
+ thirdPartyCookiesPreference.setIcon(R.drawable.cookies_ghosted);
+ }
+
+ // Set the `domStoragePreference` icon.
+ if (javaScriptEnabledBoolean) {
+ if (savedPreferences.getBoolean("dom_storage_enabled", false)) {
+ domStoragePreference.setIcon(R.drawable.dom_storage_enabled);
+ } else {
+ domStoragePreference.setIcon(R.drawable.dom_storage_disabled);
+ }
+ } else {
+ domStoragePreference.setIcon(R.drawable.dom_storage_ghosted);
+ }
+
+ // Set the `saveFormDataPreference` icon.
+ if (savedPreferences.getBoolean("save_form_data_enabled", false)) {
+ saveFormDataPreference.setIcon(R.drawable.form_data_enabled);
+ } else {
+ saveFormDataPreference.setIcon(R.drawable.form_data_disabled);
+ }
+
+ // Set the `customUserAgentPreference` icon.
+ if (customUserAgentPreference.isEnabled()) {
+ customUserAgentPreference.setIcon(R.drawable.user_agent_enabled);
+ } else {
+ customUserAgentPreference.setIcon(R.drawable.user_agent_ghosted);
+ }
+
+ // Set the `doNotTrackPreference` icon.
+ if (savedPreferences.getBoolean("do_not_track", false)) {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_enabled);
+ } else {
+ doNotTrackPreference.setIcon(R.drawable.do_not_track_disabled);
+ }