forked from GrapheneOS/Vanadium
-
Notifications
You must be signed in to change notification settings - Fork 0
/
0040-remove-sync-preferences.patch
312 lines (290 loc) · 16.5 KB
/
0040-remove-sync-preferences.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
From 136dd99ab6953ed5a892362658b0cadd4e381bd3 Mon Sep 17 00:00:00 2001
From: Daniel Micay <[email protected]>
Date: Fri, 2 Aug 2019 21:12:28 -0400
Subject: [PATCH 40/48] remove sync preferences
---
.../res/xml/sync_and_services_preferences.xml | 58 ++++----
.../sync/SyncAndServicesPreferences.java | 136 +++++++++---------
.../java/strings/android_chrome_strings.grd | 24 ++--
3 files changed, 109 insertions(+), 109 deletions(-)
diff --git a/chrome/android/java/res/xml/sync_and_services_preferences.xml b/chrome/android/java/res/xml/sync_and_services_preferences.xml
index ec89aae1aa2d..052375395843 100644
--- a/chrome/android/java/res/xml/sync_and_services_preferences.xml
+++ b/chrome/android/java/res/xml/sync_and_services_preferences.xml
@@ -8,39 +8,39 @@
chrome/browser/unified_consent/unified_consent_service_factory.cc has to be
updated accordingly. -->
<android.support.v7.preference.PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
- <android.support.v7.preference.PreferenceCategory
- android:key="user_category"
- android:title="@string/user"/>
- <org.chromium.chrome.browser.preferences.sync.SignInPreference
- android:key="sign_in"
- android:title="@string/sign_in_to_chrome"/>
+ <!--<android.support.v7.preference.PreferenceCategory-->
+ <!--android:key="user_category"-->
+ <!--android:title="@string/user"/>-->
+ <!--<org.chromium.chrome.browser.preferences.sync.SignInPreference-->
+ <!--android:key="sign_in"-->
+ <!--android:title="@string/sign_in_to_chrome"/>-->
- <org.chromium.chrome.browser.preferences.ChromeBasePreferenceCompat
- android:key="manage_your_google_account"
- android:title="@string/manage_your_google_account"/>
+ <!--<org.chromium.chrome.browser.preferences.ChromeBasePreferenceCompat-->
+ <!--android:key="manage_your_google_account"-->
+ <!--android:title="@string/manage_your_google_account"/>-->
- <android.support.v7.preference.PreferenceCategory
- android:key="sync_category"
- android:title="@string/sync_category_title">
+ <!--<android.support.v7.preference.PreferenceCategory-->
+ <!--android:key="sync_category"-->
+ <!--android:title="@string/sync_category_title">-->
- <android.support.v7.preference.Preference
- android:key="sync_error_card"
- android:layout="@layout/account_management_account_row"
- android:title="@string/sync_error_card_title"/>
- <android.support.v7.preference.Preference
- android:key="sync_disabled_by_administrator"
- android:layout="@layout/account_management_account_row"
- android:title="@string/sync_is_disabled_by_administrator"/>
- <org.chromium.chrome.browser.preferences.ChromeSwitchPreferenceCompat
- android:key="sync_requested"
- android:title="@string/sync_switch_title"
- android:persistent="false"/>
+ <!--<android.support.v7.preference.Preference-->
+ <!--android:key="sync_error_card"-->
+ <!--android:layout="@layout/account_management_account_row"-->
+ <!--android:title="@string/sync_error_card_title"/>-->
+ <!--<android.support.v7.preference.Preference-->
+ <!--android:key="sync_disabled_by_administrator"-->
+ <!--android:layout="@layout/account_management_account_row"-->
+ <!--android:title="@string/sync_is_disabled_by_administrator"/>-->
+ <!--<org.chromium.chrome.browser.preferences.ChromeSwitchPreferenceCompat-->
+ <!--android:key="sync_requested"-->
+ <!--android:title="@string/sync_switch_title"-->
+ <!--android:persistent="false"/>-->
- <org.chromium.chrome.browser.preferences.ChromeBasePreferenceCompat
- android:key="manage_sync"
- android:title="@string/manage_sync_title"
- android:fragment="org.chromium.chrome.browser.preferences.sync.ManageSyncPreferences"/>
- </android.support.v7.preference.PreferenceCategory>
+ <!--<org.chromium.chrome.browser.preferences.ChromeBasePreferenceCompat-->
+ <!--android:key="manage_sync"-->
+ <!--android:title="@string/manage_sync_title"-->
+ <!--android:fragment="org.chromium.chrome.browser.preferences.sync.ManageSyncPreferences"/>-->
+ <!--</android.support.v7.preference.PreferenceCategory>-->
<android.support.v7.preference.PreferenceCategory
android:key="services_category"
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/preferences/sync/SyncAndServicesPreferences.java b/chrome/android/java/src/org/chromium/chrome/browser/preferences/sync/SyncAndServicesPreferences.java
index 7b20141292c0..99ac42964641 100644
--- a/chrome/android/java/src/org/chromium/chrome/browser/preferences/sync/SyncAndServicesPreferences.java
+++ b/chrome/android/java/src/org/chromium/chrome/browser/preferences/sync/SyncAndServicesPreferences.java
@@ -123,14 +123,14 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
private boolean mIsFromSigninScreen;
- private SignInPreference mSigninPreference;
- private Preference mManageYourGoogleAccount;
+ //private SignInPreference mSigninPreference;
+ //private Preference mManageYourGoogleAccount;
- private PreferenceCategory mSyncCategory;
- private Preference mSyncErrorCard;
- private Preference mSyncDisabledByAdministrator;
- private ChromeBasePreferenceCompat mManageSync;
- private ChromeSwitchPreferenceCompat mSyncRequested;
+ //private PreferenceCategory mSyncCategory;
+ //private Preference mSyncErrorCard;
+ //private Preference mSyncDisabledByAdministrator;
+ //private ChromeBasePreferenceCompat mManageSync;
+ //private ChromeSwitchPreferenceCompat mSyncRequested;
private ChromeSwitchPreferenceCompat mSearchSuggestions;
private ChromeSwitchPreferenceCompat mNavigationError;
@@ -172,27 +172,27 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
PreferenceUtils.addPreferencesFromResource(this, R.xml.sync_and_services_preferences);
- if (!ChromeFeatureList.isEnabled(ChromeFeatureList.IDENTITY_DISC)) {
- getPreferenceScreen().removePreference(findPreference(PREF_USER_CATEGORY));
- }
- mSigninPreference = (SignInPreference) findPreference(PREF_SIGNIN);
- mSigninPreference.setPersonalizedPromoEnabled(false);
- mManageYourGoogleAccount = findPreference(PREF_MANAGE_YOUR_GOOGLE_ACCOUNT);
- mManageYourGoogleAccount.setOnPreferenceClickListener(SyncPreferenceUtils.toOnClickListener(
- this, () -> SyncPreferenceUtils.openGoogleMyAccount(getActivity())));
-
- mSyncCategory = (PreferenceCategory) findPreference(PREF_SYNC_CATEGORY);
- mSyncErrorCard = findPreference(PREF_SYNC_ERROR_CARD);
- mSyncErrorCard.setIcon(UiUtils.getTintedDrawable(
- getActivity(), R.drawable.ic_sync_error_40dp, R.color.default_red));
- mSyncErrorCard.setOnPreferenceClickListener(
- SyncPreferenceUtils.toOnClickListener(this, this::onSyncErrorCardClicked));
- mSyncDisabledByAdministrator = findPreference(PREF_SYNC_DISABLED_BY_ADMINISTRATOR);
- mSyncDisabledByAdministrator.setIcon(
- ManagedPreferencesUtils.getManagedByEnterpriseIconId());
- mSyncRequested = (ChromeSwitchPreferenceCompat) findPreference(PREF_SYNC_REQUESTED);
- mSyncRequested.setOnPreferenceChangeListener(this);
- mManageSync = (ChromeBasePreferenceCompat) findPreference(PREF_MANAGE_SYNC);
+ //if (!ChromeFeatureList.isEnabled(ChromeFeatureList.IDENTITY_DISC)) {
+ //getPreferenceScreen().removePreference(findPreference(PREF_USER_CATEGORY));
+ //}
+ //mSigninPreference = (SignInPreference) findPreference(PREF_SIGNIN);
+ //mSigninPreference.setPersonalizedPromoEnabled(false);
+ //mManageYourGoogleAccount = findPreference(PREF_MANAGE_YOUR_GOOGLE_ACCOUNT);
+ //mManageYourGoogleAccount.setOnPreferenceClickListener(SyncPreferenceUtils.toOnClickListener(
+ //this, () -> SyncPreferenceUtils.openGoogleMyAccount(getActivity())));
+
+ //mSyncCategory = (PreferenceCategory) findPreference(PREF_SYNC_CATEGORY);
+ //mSyncErrorCard = findPreference(PREF_SYNC_ERROR_CARD);
+ //mSyncErrorCard.setIcon(UiUtils.getTintedDrawable(
+ //getActivity(), R.drawable.ic_sync_error_40dp, R.color.default_red));
+ //mSyncErrorCard.setOnPreferenceClickListener(
+ //SyncPreferenceUtils.toOnClickListener(this, this::onSyncErrorCardClicked));
+ //mSyncDisabledByAdministrator = findPreference(PREF_SYNC_DISABLED_BY_ADMINISTRATOR);
+ //mSyncDisabledByAdministrator.setIcon(
+ //ManagedPreferencesUtils.getManagedByEnterpriseIconId());
+ //mSyncRequested = (ChromeSwitchPreferenceCompat) findPreference(PREF_SYNC_REQUESTED);
+ //mSyncRequested.setOnPreferenceChangeListener(this);
+ //mManageSync = (ChromeBasePreferenceCompat) findPreference(PREF_MANAGE_SYNC);
mSearchSuggestions = (ChromeSwitchPreferenceCompat) findPreference(PREF_SEARCH_SUGGESTIONS);
mSearchSuggestions.setOnPreferenceChangeListener(this);
@@ -287,7 +287,7 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
public void onStart() {
super.onStart();
mProfileSyncService.addSyncStateChangedListener(this);
- mSigninPreference.registerForUpdates();
+ //mSigninPreference.registerForUpdates();
if (!mIsFromSigninScreen || ChromeSigninController.get().isSignedIn()) {
return;
@@ -310,7 +310,7 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
public void onStop() {
super.onStop();
- mSigninPreference.unregisterForUpdates();
+ //mSigninPreference.unregisterForUpdates();
mProfileSyncService.removeSyncStateChangedListener(this);
}
@@ -504,7 +504,7 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
}
private void updatePreferences() {
- updateSyncPreferences();
+ //updateSyncPreferences();
mSearchSuggestions.setChecked(mPrefServiceBridge.isSearchSuggestEnabled());
mNavigationError.setChecked(mPrefServiceBridge.isResolveNavigationErrorEnabled());
@@ -523,43 +523,43 @@ public class SyncAndServicesPreferences extends PreferenceFragmentCompat
}
}
- private void updateSyncPreferences() {
- if (!mProfileSyncService.isEngineInitialized()
- || !mProfileSyncService.isPassphraseRequiredForDecryption()) {
- closeDialogIfOpen(FRAGMENT_ENTER_PASSPHRASE);
- }
-
- if (!ChromeSigninController.get().isSignedIn()) {
- getPreferenceScreen().removePreference(mManageYourGoogleAccount);
- getPreferenceScreen().removePreference(mSyncCategory);
- return;
- }
-
- getPreferenceScreen().addPreference(mManageYourGoogleAccount);
- getPreferenceScreen().addPreference(mSyncCategory);
- if (ProfileSyncService.get().isSyncDisabledByEnterprisePolicy()) {
- mSyncCategory.addPreference(mSyncDisabledByAdministrator);
- mSyncCategory.removePreference(mSyncErrorCard);
- mSyncCategory.removePreference(mSyncRequested);
- mSyncCategory.removePreference(mManageSync);
- return;
- }
- mSyncCategory.removePreference(mSyncDisabledByAdministrator);
- mSyncCategory.addPreference(mSyncRequested);
- mSyncCategory.addPreference(mManageSync);
-
- mCurrentSyncError = getSyncError();
- if (mCurrentSyncError == SyncError.NO_ERROR) {
- mSyncCategory.removePreference(mSyncErrorCard);
- } else {
- String summary = getSyncErrorHint(mCurrentSyncError);
- mSyncErrorCard.setSummary(summary);
- mSyncCategory.addPreference(mSyncErrorCard);
- }
-
- mSyncRequested.setChecked(AndroidSyncSettings.get().isChromeSyncEnabled());
- mSyncRequested.setEnabled(canDisableSync());
- }
+ //private void updateSyncPreferences() {
+ //if (!mProfileSyncService.isEngineInitialized()
+ //|| !mProfileSyncService.isPassphraseRequiredForDecryption()) {
+ //closeDialogIfOpen(FRAGMENT_ENTER_PASSPHRASE);
+ //}
+
+ //if (!ChromeSigninController.get().isSignedIn()) {
+ //getPreferenceScreen().removePreference(mManageYourGoogleAccount);
+ //getPreferenceScreen().removePreference(mSyncCategory);
+ //return;
+ //}
+
+ //getPreferenceScreen().addPreference(mManageYourGoogleAccount);
+ //getPreferenceScreen().addPreference(mSyncCategory);
+ //if (ProfileSyncService.get().isSyncDisabledByEnterprisePolicy()) {
+ //mSyncCategory.addPreference(mSyncDisabledByAdministrator);
+ //mSyncCategory.removePreference(mSyncErrorCard);
+ //mSyncCategory.removePreference(mSyncRequested);
+ //mSyncCategory.removePreference(mManageSync);
+ //return;
+ //}
+ //mSyncCategory.removePreference(mSyncDisabledByAdministrator);
+ //mSyncCategory.addPreference(mSyncRequested);
+ //mSyncCategory.addPreference(mManageSync);
+
+ //mCurrentSyncError = getSyncError();
+ //if (mCurrentSyncError == SyncError.NO_ERROR) {
+ //mSyncCategory.removePreference(mSyncErrorCard);
+ //} else {
+ //String summary = getSyncErrorHint(mCurrentSyncError);
+ //mSyncErrorCard.setSummary(summary);
+ //mSyncCategory.addPreference(mSyncErrorCard);
+ //}
+
+ //mSyncRequested.setChecked(AndroidSyncSettings.get().isChromeSyncEnabled());
+ //mSyncRequested.setEnabled(canDisableSync());
+ //}
private ManagedPreferenceDelegateCompat createManagedPreferenceDelegate() {
return preference -> {
diff --git a/chrome/android/java/strings/android_chrome_strings.grd b/chrome/android/java/strings/android_chrome_strings.grd
index a849a9512258..2a310c0a2eea 100644
--- a/chrome/android/java/strings/android_chrome_strings.grd
+++ b/chrome/android/java/strings/android_chrome_strings.grd
@@ -257,9 +257,9 @@ CHAR-LIMIT guidelines:
<message name="IDS_SHOW" desc="Label for a show button. Used in multiple contexts. [CHAR-LIMIT=20]">
Show
</message>
- <message name="IDS_USER" desc="Generic label for UI elements with information about user.">
- User
- </message>
+ <!--<message name="IDS_USER" desc="Generic label for UI elements with information about user.">-->
+ <!--User-->
+ <!--</message>-->
<message name="IDS_MENU_ITEM_MOVE_UP" desc="Option in item menu. User can click the 'Move up' option to move the item up by one position in its list. [CHAR-LIMIT=24]">
Move up
</message>
@@ -373,15 +373,15 @@ CHAR-LIMIT guidelines:
<message name="IDS_SIGN_OUT_AND_TURN_OFF_SYNC" desc="The text for a preferences row that for signs out the user and turns off sync.">
Sign out and turn off sync
</message>
- <message name="IDS_MANAGE_YOUR_GOOGLE_ACCOUNT" desc="Title for link to Google Account Page to manage account settings.">
- Manage your Google Account
- </message>
- <message name="IDS_SYNC_CATEGORY_TITLE" desc="Title for the group of Sync-related entries in Settings. This group contains preferences for data tied to user's Google Account.">
- Sync
- </message>
- <message name="IDS_SYNC_SWITCH_TITLE" desc="Title for the switch preference that enables sync. Displayed in 'Sync and Google services' screen.">
- Sync your Vanadium data
- </message>
+ <!--<message name="IDS_MANAGE_YOUR_GOOGLE_ACCOUNT" desc="Title for link to Google Account Page to manage account settings.">-->
+ <!--Manage your Google Account-->
+ <!--</message>-->
+ <!--<message name="IDS_SYNC_CATEGORY_TITLE" desc="Title for the group of Sync-related entries in Settings. This group contains preferences for data tied to user's Google Account.">-->
+ <!--Sync-->
+ <!--</message>-->
+ <!--<message name="IDS_SYNC_SWITCH_TITLE" desc="Title for the switch preference that enables sync. Displayed in 'Sync and Google services' screen.">-->
+ <!--Sync your Vanadium data-->
+ <!--</message>-->
<message name="IDS_MANAGE_SYNC_TITLE" desc="Title for the preference row that opens the screen that allows configuring separate data types. Displayed in 'Sync and Google services' screen.">
Manage sync
</message>
--
2.23.0