Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 549708b1 authored by Mohammed Althaf T's avatar Mohammed Althaf T 😊
Browse files

Remove options properly

parent ca626f72
Loading
Loading
Loading
Loading
Loading
+97 −13
Original line number Diff line number Diff line
From e9efa24945b062aac79acc7a10ef77300c9476bc Mon Sep 17 00:00:00 2001
From b4c6143fa33d9842a18276796b7ab808255045f8 Mon Sep 17 00:00:00 2001
From: fgei <fgei@gmail.com>
Date: Fri, 15 Oct 2021 13:49:33 +0000
Subject: [PATCH 3/3] Browser: Remove some preferences from UI

---
 chrome/android/java/res/xml/privacy_preferences.xml         | 5 -----
 chrome/android/java/res/xml/privacy_preferences_v2.xml      | 5 -----
 .../chrome/browser/privacy/settings/PrivacySettings.java    | 6 ++++++
 .../org/chromium/chrome/browser/settings/MainSettings.java  | 3 +++
 .../options/RadioButtonGroupThirdPartyPreference.java       | 2 +-
 5 files changed, 10 insertions(+), 11 deletions(-)
 .../android/java/res/xml/main_preferences.xml   | 10 ----------
 .../java/res/xml/privacy_preferences.xml        |  5 -----
 .../java/res/xml/privacy_preferences_v2.xml     |  5 -----
 .../privacy/settings/PrivacySettings.java       |  6 ++++++
 .../chrome/browser/settings/MainSettings.java   | 17 -----------------
 ...adio_button_group_third_party_preference.xml |  2 +-
 .../RadioButtonGroupThirdPartyPreference.java   |  2 +-
 7 files changed, 8 insertions(+), 39 deletions(-)

diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
index d5625671095b6..e8cd2d4ab7393 100644
--- a/chrome/android/java/res/xml/main_preferences.xml
+++ b/chrome/android/java/res/xml/main_preferences.xml
@@ -33,11 +33,6 @@ found in the LICENSE file.
         android:key="autofill_addresses"
         android:order="9"
         android:title="@string/autofill_addresses_settings_title"/>
-    <org.chromium.components.browser_ui.settings.ChromeBasePreference
-        android:fragment="org.chromium.chrome.browser.autofill.options.AutofillOptionsFragment"
-        android:key="autofill_options"
-        android:order="10"
-        android:title="@string/autofill_options_title" />
     <Preference
         android:fragment="org.chromium.chrome.browser.privacy.settings.PrivacySettings"
         android:key="privacy"
@@ -102,11 +97,6 @@ found in the LICENSE file.
         android:key="downloads"
         android:order="21"
         android:title="@string/menu_downloads"/>
-    <Preference
-        android:fragment="org.chromium.chrome.browser.tracing.settings.DeveloperSettings"
-        android:key="developer"
-        android:order="22"
-        android:title="Developer options"/>
     <Preference
         android:fragment="org.chromium.chrome.browser.about_settings.AboutChromeSettings"
         android:key="about_chrome"
diff --git a/chrome/android/java/res/xml/privacy_preferences.xml b/chrome/android/java/res/xml/privacy_preferences.xml
index 77aedc4c61273..9bdbe90b3cb64 100644
--- a/chrome/android/java/res/xml/privacy_preferences.xml
@@ -75,19 +105,73 @@ index 89f109da09734..50b76bde55038 100644
         List<TimeFrequencySpinnerOption> options = new ArrayList<>();
         options.add(new TimeFrequencySpinnerOption(0,
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
index ee4bd26f4fc5a..59e785ae11ecc 100644
index ee4bd26f4fc5a..021def8fc5994 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
@@ -266,6 +266,9 @@ public class MainSettings extends PreferenceFragmentCompat
@@ -40,7 +40,6 @@ import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
 import org.chromium.chrome.browser.sync.settings.SyncSettingsUtils;
 import org.chromium.chrome.browser.toolbar.adaptive.AdaptiveToolbarFeatures;
 import org.chromium.chrome.browser.toolbar.adaptive.AdaptiveToolbarStatePredictor;
-import org.chromium.chrome.browser.tracing.settings.DeveloperSettings;
 import org.chromium.components.browser_ui.settings.ChromeBasePreference;
 import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
 import org.chromium.components.browser_ui.settings.SettingsLauncher;
@@ -78,8 +77,6 @@ public class MainSettings extends PreferenceFragmentCompat
     public static final String PREF_SAFETY_CHECK = "safety_check";
     public static final String PREF_NOTIFICATIONS = "notifications";
     public static final String PREF_DOWNLOADS = "downloads";
-    public static final String PREF_DEVELOPER = "developer";
-    public static final String PREF_AUTOFILL_OPTIONS = "autofill_options";
 
     private final ManagedPreferenceDelegate mManagedPreferenceDelegate;
     private final Map<String, Preference> mAllPreferences = new HashMap<>();
@@ -237,14 +234,6 @@ public class MainSettings extends PreferenceFragmentCompat
             removePreferenceIfPresent(PREF_SIGN_IN);
         }
 
-        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O
-                && ChromeFeatureList.isEnabled(
-                        ChromeFeatureList.AUTOFILL_VIRTUAL_VIEW_STRUCTURE_ANDROID)) {
-            addPreferenceIfAbsent(PREF_AUTOFILL_OPTIONS);
-        } else {
-            removePreferenceIfPresent(PREF_AUTOFILL_OPTIONS);
-        }
-
         updateManageSyncPreference();
         updateSearchEnginePreference();
         updatePasswordsPreference();
@@ -260,12 +249,6 @@ public class MainSettings extends PreferenceFragmentCompat
         } else {
             removePreferenceIfPresent(PREF_DEVELOPER);
             removePreferenceIfPresent(PREF_UI_THEME);
         }
+
+        removePreferenceIfPresent(PREF_AUTOFILL_OPTIONS);
+        removePreferenceIfPresent(PREF_DEVELOPER);
-
-        if (DeveloperSettings.shouldShowDeveloperSettings()) {
-            addPreferenceIfAbsent(PREF_DEVELOPER);
-        } else {
-            removePreferenceIfPresent(PREF_DEVELOPER);
-        }
     }
 
     private Preference addPreferenceIfAbsent(String key) {
diff --git a/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml b/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml
index 54b5038f206fe..a370ac244d259 100644
--- a/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml
+++ b/chrome/browser/autofill/android/java/res/layout/radio_button_group_third_party_preference.xml
@@ -19,13 +19,13 @@ found in the LICENSE file.
           android:id="@+id/autofill_third_party_filling_default"
           android:layout_width="match_parent"
           android:layout_height="wrap_content"
-          android:checked="true"
           app:primaryText="@string/autofill_third_party_filling_default"
           app:descriptionText="@string/autofill_third_party_filling_default_description"/>
 
         <org.chromium.components.browser_ui.widget.RadioButtonWithDescription
           android:id="@+id/autofill_third_party_filling_opt_in"
           android:layout_width="match_parent"
+          android:checked="true"
           android:layout_height="wrap_content"
           app:primaryText="@string/autofill_third_party_filling_opt_in"
           app:descriptionText="@string/autofill_third_party_filling_opt_in_description"/>
diff --git a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java b/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java
index 99b0e21ea331b..55d54506560a8 100644
--- a/chrome/browser/autofill/android/java/src/org/chromium/chrome/browser/autofill/options/RadioButtonGroupThirdPartyPreference.java