12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070 |
- From: csagan5 <32685696+csagan5@users.noreply.github.com>
- Date: Tue, 12 Jun 2018 14:23:07 +0200
- Subject: Remove signin and data saver integrations
- Prevents authorization prompt for Play services on reboot
- Remove recent tabs signin
- Disable data saver
- Never show the data saver promo snackbar
- Disable unused permissions from manifest
- Disable sync adaptive and invalidation services from manifest
- More permissions removal from manifest
- Fix building with debug symbols:
- ld.lld: error: undefined symbol: notifier::NotifierOptions::NotifierOptions()
- >>> referenced by invalidation_service_util.cc:17 (../../components/invalidation/impl/invalidation_service_util.cc:17)
- >>> impl/invalidation_service_util.o:(invalidation::ParseNotifierOptions(base::CommandLine const&)) in archive obj/components/invalidation/impl/libimpl.a
- ---
- chrome/android/BUILD.gn | 3 +-
- chrome/android/java/AndroidManifest.xml | 18 --
- .../android/java/res/xml/main_preferences.xml | 9 -
- .../chrome/browser/app/ChromeActivity.java | 34 ----
- .../DataReductionPreferenceFragment.java | 24 +--
- .../privacy/settings/PrivacySettings.java | 44 +----
- .../chrome/browser/settings/MainSettings.java | 166 +-----------------
- .../chrome/browser/signin/SigninManager.java | 78 +-------
- .../browser/sync/AndroidSyncSettings.java | 28 +--
- .../settings/SyncAndServicesSettings.java | 8 -
- .../android/signin/signin_manager_android.cc | 1 -
- .../strings/android_chrome_strings.grd | 18 --
- .../signin/SystemAccountManagerDelegate.java | 38 +---
- .../net/HttpNegotiateAuthenticator.java | 88 +---------
- .../chromoting/base/OAuthTokenFetcher.java | 2 -
- 15 files changed, 26 insertions(+), 533 deletions(-)
- diff --git a/chrome/android/BUILD.gn b/chrome/android/BUILD.gn
- --- a/chrome/android/BUILD.gn
- +++ b/chrome/android/BUILD.gn
- @@ -1504,8 +1504,7 @@ jinja_template_resources("chrome_public_apk_template_resources") {
- resources = [
- "java/res_template/xml/file_paths.xml",
- "java/res_template/xml/launchershortcuts.xml",
- - "java/res_template/xml/searchable.xml",
- - "java/res_template/xml/syncadapter.xml",
- + "java/res_template/xml/searchable.xml"
- ]
- res_dir = "java/res_template"
- variables = [ "manifest_package=$chrome_public_manifest_package" ]
- diff --git a/chrome/android/java/AndroidManifest.xml b/chrome/android/java/AndroidManifest.xml
- --- a/chrome/android/java/AndroidManifest.xml
- +++ b/chrome/android/java/AndroidManifest.xml
- @@ -48,24 +48,18 @@ by a child template that "extends" this file.
- {% if target_sdk_version|int > 27 or target_sdk_version == "Q" %}
- <uses-permission android:name="android.permission.FOREGROUND_SERVICE" />
- {% endif %}
- - <uses-permission android:name="android.permission.GET_ACCOUNTS"/>
- <uses-permission android:name="android.permission.INTERNET"/>
- - <uses-permission android:name="android.permission.MANAGE_ACCOUNTS"/>
- <uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS"/>
- <uses-permission android:name="android.permission.NFC"/>
- <uses-permission android:name="android.permission.QUERY_ALL_PACKAGES" />
- <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
- - <uses-permission android:name="android.permission.READ_SYNC_SETTINGS"/>
- - <uses-permission android:name="android.permission.READ_SYNC_STATS"/>
- <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
- <uses-permission android:name="android.permission.RECORD_AUDIO"/>
- - <uses-permission android:name="android.permission.USE_CREDENTIALS"/>
- <uses-permission-sdk-23 android:name="android.permission.USE_BIOMETRIC"/>
- <uses-permission-sdk-23 android:name="android.permission.USE_FINGERPRINT"/>
- <uses-permission android:name="android.permission.VIBRATE"/>
- <uses-permission android:name="android.permission.WAKE_LOCK"/>
- <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
- - <uses-permission android:name="android.permission.WRITE_SYNC_SETTINGS"/>
- {% set enable_vr = enable_vr|default(0) %}
- {% if enable_vr == "true" %}
- <!-- Indicates use of Android's VR-mode, available only on Android N+. -->
- @@ -107,8 +101,6 @@ by a child template that "extends" this file.
- <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
- <uses-permission android:name="com.android.launcher.permission.INSTALL_SHORTCUT"/>
-
- - <uses-permission android:name="com.google.android.apps.now.CURRENT_ACCOUNT_ACCESS" />
- -
- {% block extra_uses_permissions %}
- {% endblock %}
-
- @@ -898,16 +890,6 @@ by a child template that "extends" this file.
- android:resource="@xml/file_paths" />
- </provider>
-
- - <!-- Sync adapter for browser invalidation. -->
- - <service android:name="org.chromium.chrome.browser.invalidation.ChromeBrowserSyncAdapterService"
- - android:exported="false">
- - <intent-filter>
- - <action android:name="android.content.SyncAdapter" />
- - </intent-filter>
- - <meta-data android:name="android.content.SyncAdapter"
- - android:resource="@xml/syncadapter" />
- - </service>
- -
- <!-- Broadcast receiver that will be notified of account changes -->
- <receiver android:name="org.chromium.chrome.browser.services.AccountsChangedReceiver"
- android:exported="true">
- diff --git a/chrome/android/java/res/xml/main_preferences.xml b/chrome/android/java/res/xml/main_preferences.xml
- --- a/chrome/android/java/res/xml/main_preferences.xml
- +++ b/chrome/android/java/res/xml/main_preferences.xml
- @@ -20,10 +20,6 @@
- android:order="2"
- android:title="@string/prefs_section_account_and_google_services"
- app:isPreferenceVisible="false"/>
- - <org.chromium.chrome.browser.sync.settings.SignInPreference
- - android:key="sign_in"
- - android:order="3"
- - android:title="@string/sign_in_to_chrome"/>
- <org.chromium.components.browser_ui.settings.ChromeBasePreference
- android:key="manage_sync"
- android:order="5"
- @@ -108,11 +104,6 @@
- android:key="languages"
- android:order="20"
- android:title="@string/language_settings"/>
- - <org.chromium.components.browser_ui.settings.ChromeBasePreference
- - android:fragment="org.chromium.chrome.browser.datareduction.settings.DataReductionPreferenceFragment"
- - android:key="data_reduction"
- - android:order="21"
- - android:title="@string/data_reduction_title_lite_mode"/>
- <org.chromium.components.browser_ui.settings.ChromeBasePreference
- android:fragment="org.chromium.chrome.browser.download.settings.DownloadSettings"
- android:key="downloads"
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/app/ChromeActivity.java
- @@ -133,8 +133,6 @@ import org.chromium.chrome.browser.settings.SettingsLauncher;
- import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
- import org.chromium.chrome.browser.share.ShareDelegate;
- import org.chromium.chrome.browser.share.ShareDelegateImpl;
- -import org.chromium.chrome.browser.sync.ProfileSyncService;
- -import org.chromium.chrome.browser.sync.SyncController;
- import org.chromium.chrome.browser.tab.AccessibilityVisibilityHandler;
- import org.chromium.chrome.browser.tab.Tab;
- import org.chromium.chrome.browser.tab.TabHidingType;
- @@ -265,9 +263,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
- private boolean mRemoveWindowBackgroundDone;
- protected AccessibilityVisibilityHandler mAccessibilityVisibilityHandler;
-
- - // Observes when sync becomes ready to create the mContextReporter.
- - private ProfileSyncService.SyncStateChangedListener mSyncStateChangedListener;
- -
- // The PictureInPictureController is initialized lazily https://crbug.com/729738.
- private PictureInPictureController mPictureInPictureController;
-
- @@ -888,28 +883,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
- private void createContextReporterIfNeeded() {
- if (!mStarted) return; // Sync state reporting should work only in started state.
- if (mContextReporter != null || getActivityTab() == null) return;
- -
- - final SyncController syncController = SyncController.get();
- - final ProfileSyncService syncService = ProfileSyncService.get();
- -
- - if (syncController != null && syncController.isSyncingUrlsWithKeystorePassphrase()) {
- - assert syncService != null;
- - mContextReporter = AppHooks.get().createGsaHelper().getContextReporter(this);
- -
- - if (mSyncStateChangedListener != null) {
- - syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
- - mSyncStateChangedListener = null;
- - }
- -
- - return;
- - } else {
- - ContextReporter.reportSyncStatus(syncService);
- - }
- -
- - if (mSyncStateChangedListener == null && syncService != null) {
- - mSyncStateChangedListener = () -> createContextReporterIfNeeded();
- - syncService.addSyncStateChangedListener(mSyncStateChangedListener);
- - }
- }
-
- @Override
- @@ -971,13 +944,6 @@ public abstract class ChromeActivity<C extends ChromeActivityComponent>
- if (GSAState.getInstance(this).isGsaAvailable() && !SysUtils.isLowEndDevice()) {
- GSAAccountChangeListener.getInstance().disconnect();
- }
- - if (mSyncStateChangedListener != null) {
- - ProfileSyncService syncService = ProfileSyncService.get();
- - if (syncService != null) {
- - syncService.removeSyncStateChangedListener(mSyncStateChangedListener);
- - }
- - mSyncStateChangedListener = null;
- - }
- if (mContextReporter != null) mContextReporter.disable();
-
- super.onStopWithNative();
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java b/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/datareduction/settings/DataReductionPreferenceFragment.java
- @@ -56,10 +56,10 @@ public class DataReductionPreferenceFragment extends PreferenceFragmentCompat {
- public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
- SettingsUtils.addPreferencesFromResource(this, R.xml.data_reduction_preferences);
- getActivity().setTitle(R.string.data_reduction_title_lite_mode);
- - boolean isEnabled = DataReductionProxySettings.getInstance().isDataReductionProxyEnabled();
- - mIsEnabled = !isEnabled;
- - mWasEnabledAtCreation = isEnabled;
- - updatePreferences(isEnabled);
- +
- + mIsEnabled = false;
- + mWasEnabledAtCreation = false;
- + updatePreferences(false);
-
- setHasOptionsMenu(true);
-
- @@ -175,21 +175,7 @@ public class DataReductionPreferenceFragment extends PreferenceFragmentCompat {
- * Returns summary string.
- */
- public static String generateSummary(Resources resources) {
- - if (DataReductionProxySettings.getInstance().isDataReductionProxyEnabled()) {
- - ContentLengths length = DataReductionProxySettings.getInstance().getContentLengths();
- -
- - // If received is less than show chart threshold than don't show summary.
- - if (ConversionUtils.bytesToKilobytes(length.getReceived())
- - < DataReductionProxySettings.DATA_REDUCTION_SHOW_CHART_KB_THRESHOLD) {
- - return "";
- - }
- -
- - String percent = generatePercentSavings(length);
- - return resources.getString(
- - R.string.data_reduction_menu_item_summary_lite_mode, percent);
- - } else {
- - return (String) resources.getText(R.string.text_off);
- - }
- + return (String) resources.getText(R.string.text_off);
- }
-
- /**
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/privacy/settings/PrivacySettings.java
- @@ -27,9 +27,6 @@ import org.chromium.chrome.browser.settings.ChromeManagedPreferenceDelegate;
- import org.chromium.chrome.browser.settings.SettingsLauncher;
- import org.chromium.chrome.browser.settings.SettingsLauncherImpl;
- import org.chromium.chrome.browser.signin.IdentityServicesProvider;
- -import org.chromium.chrome.browser.sync.settings.GoogleServicesSettings;
- -import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
- -import org.chromium.chrome.browser.sync.settings.SyncAndServicesSettings;
- import org.chromium.components.browser_ui.settings.ChromeSwitchPreference;
- import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
- import org.chromium.components.browser_ui.settings.SettingsUtils;
- @@ -48,11 +45,10 @@ public class PrivacySettings
- private static final String PREF_NETWORK_PREDICTIONS = "preload_pages";
- private static final String PREF_SECURE_DNS = "secure_dns";
- private static final String PREF_DO_NOT_TRACK = "do_not_track";
- - private static final String PREF_SYNC_AND_SERVICES_LINK = "sync_and_services_link";
- private static final String PREF_CLEAR_BROWSING_DATA = "clear_browsing_data";
- private static final String[] NEW_PRIVACY_PREFERENCE_ORDER = {PREF_CLEAR_BROWSING_DATA,
- PREF_CAN_MAKE_PAYMENT, PREF_NETWORK_PREDICTIONS,
- - PREF_SECURE_DNS, PREF_DO_NOT_TRACK, PREF_SYNC_AND_SERVICES_LINK
- + PREF_SECURE_DNS, PREF_DO_NOT_TRACK
- };
-
- private ManagedPreferenceDelegate mManagedPreferenceDelegate;
- @@ -92,47 +88,9 @@ public class PrivacySettings
- Preference secureDnsPref = findPreference(PREF_SECURE_DNS);
- secureDnsPref.setVisible(SecureDnsSettings.isUiEnabled());
-
- - Preference syncAndServicesLink = findPreference(PREF_SYNC_AND_SERVICES_LINK);
- - syncAndServicesLink.setSummary(buildSyncAndServicesLink());
- -
- updateSummaries();
- }
-
- - private SpannableString buildSyncAndServicesLink() {
- - SettingsLauncher settingsLauncher = new SettingsLauncherImpl();
- - if (!ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
- - NoUnderlineClickableSpan syncAndServicesLink =
- - new NoUnderlineClickableSpan(getResources(), v -> {
- - settingsLauncher.launchSettingsActivity(getActivity(),
- - SyncAndServicesSettings.class,
- - SyncAndServicesSettings.createArguments(false));
- - });
- - return SpanApplier.applySpans(getString(R.string.privacy_sync_and_services_link_legacy),
- - new SpanApplier.SpanInfo("<link>", "</link>", syncAndServicesLink));
- - }
- -
- - NoUnderlineClickableSpan servicesLink = new NoUnderlineClickableSpan(getResources(), v -> {
- - settingsLauncher.launchSettingsActivity(getActivity(), GoogleServicesSettings.class);
- - });
- - if (IdentityServicesProvider.get()
- - .getIdentityManager(Profile.getLastUsedRegularProfile())
- - .getPrimaryAccountInfo(ConsentLevel.SYNC)
- - == null) {
- - // Sync is off, show the string with one link to "Google Services".
- - return SpanApplier.applySpans(
- - getString(R.string.privacy_sync_and_services_link_sync_off),
- - new SpanApplier.SpanInfo("<link>", "</link>", servicesLink));
- - }
- - // Otherwise, show the string with both links to "Sync" and "Google Services".
- - NoUnderlineClickableSpan syncLink = new NoUnderlineClickableSpan(getResources(), v -> {
- - settingsLauncher.launchSettingsActivity(getActivity(), ManageSyncSettings.class,
- - ManageSyncSettings.createArguments(false));
- - });
- - return SpanApplier.applySpans(getString(R.string.privacy_sync_and_services_link_sync_on),
- - new SpanApplier.SpanInfo("<link1>", "</link1>", syncLink),
- - new SpanApplier.SpanInfo("<link2>", "</link2>", servicesLink));
- - }
- -
- @Override
- public boolean onPreferenceChange(Preference preference, Object newValue) {
- String key = preference.getKey();
- 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
- --- a/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/settings/MainSettings.java
- @@ -19,10 +19,8 @@ import androidx.preference.PreferenceFragmentCompat;
-
- import org.chromium.base.ContextUtils;
- import org.chromium.chrome.R;
- -import org.chromium.chrome.browser.datareduction.settings.DataReductionPreferenceFragment;
- import org.chromium.chrome.browser.flags.ChromeFeatureList;
- import org.chromium.chrome.browser.homepage.HomepageManager;
- -import org.chromium.chrome.browser.net.spdyproxy.DataReductionProxySettings;
- import org.chromium.chrome.browser.night_mode.NightModeUtils;
- import org.chromium.chrome.browser.offlinepages.prefetch.PrefetchConfiguration;
- import org.chromium.chrome.browser.password_check.PasswordCheck;
- @@ -32,14 +30,7 @@ import org.chromium.chrome.browser.password_manager.PasswordManagerLauncher;
- import org.chromium.chrome.browser.profiles.Profile;
- import org.chromium.chrome.browser.safety_check.SafetyCheckSettingsFragment;
- import org.chromium.chrome.browser.search_engines.TemplateUrlServiceFactory;
- -import org.chromium.chrome.browser.signin.IdentityServicesProvider;
- import org.chromium.chrome.browser.signin.SigninActivityLauncherImpl;
- -import org.chromium.chrome.browser.signin.SigninManager;
- -import org.chromium.chrome.browser.sync.ProfileSyncService;
- -import org.chromium.chrome.browser.sync.settings.ManageSyncSettings;
- -import org.chromium.chrome.browser.sync.settings.SignInPreference;
- -import org.chromium.chrome.browser.sync.settings.SyncPromoPreference;
- -import org.chromium.chrome.browser.sync.settings.SyncSettingsUtils;
- import org.chromium.chrome.browser.tracing.settings.DeveloperSettings;
- import org.chromium.components.browser_ui.settings.ChromeBasePreference;
- import org.chromium.components.browser_ui.settings.ManagedPreferenceDelegate;
- @@ -57,23 +48,17 @@ import java.util.Map;
- * The main settings screen, shown when the user first opens Settings.
- */
- public class MainSettings extends PreferenceFragmentCompat
- - implements TemplateUrlService.LoadListener, ProfileSyncService.SyncStateChangedListener,
- - SigninManager.SignInStateObserver {
- - public static final String PREF_SYNC_PROMO = "sync_promo";
- + implements TemplateUrlService.LoadListener {
- public static final String PREF_ACCOUNT_SECTION = "account_section";
- public static final String PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION =
- "account_and_google_services_section";
- public static final String PREF_SIGN_IN = "sign_in";
- - public static final String PREF_SYNC_AND_SERVICES = "sync_and_services";
- - public static final String PREF_MANAGE_SYNC = "manage_sync";
- - public static final String PREF_GOOGLE_SERVICES = "google_services";
- public static final String PREF_SEARCH_ENGINE = "search_engine";
- public static final String PREF_PASSWORDS = "passwords";
- public static final String PREF_HOMEPAGE = "homepage";
- public static final String PREF_UI_THEME = "ui_theme";
- public static final String PREF_PRIVACY = "privacy";
- public static final String PREF_SAFETY_CHECK = "safety_check";
- - public static final String PREF_DATA_REDUCTION = "data_reduction";
- public static final String PREF_NOTIFICATIONS = "notifications";
- public static final String PREF_DOWNLOADS = "downloads";
- public static final String PREF_DEVELOPER = "developer";
- @@ -84,9 +69,6 @@ public class MainSettings extends PreferenceFragmentCompat
-
- private final ManagedPreferenceDelegate mManagedPreferenceDelegate;
- private final Map<String, Preference> mAllPreferences = new HashMap<>();
- - private SyncPromoPreference mSyncPromoPreference;
- - private SignInPreference mSignInPreference;
- - private ChromeBasePreference mManageSync;
- private @Nullable PasswordCheck mPasswordCheck;
-
- public MainSettings() {
- @@ -116,42 +98,12 @@ public class MainSettings extends PreferenceFragmentCompat
- @Override
- public void onDestroy() {
- super.onDestroy();
- - mSyncPromoPreference.onPreferenceFragmentDestroyed();
- - mSignInPreference.onPreferenceFragmentDestroyed();
- // The component should only be destroyed when the activity has been closed by the user
- // (e.g. by pressing on the back button) and not when the activity is temporarily destroyed
- // by the system.
- if (getActivity().isFinishing() && mPasswordCheck != null) PasswordCheckFactory.destroy();
- }
-
- - @Override
- - public void onStart() {
- - super.onStart();
- - SigninManager signinManager = IdentityServicesProvider.get().getSigninManager(
- - Profile.getLastUsedRegularProfile());
- - if (signinManager.isSigninSupported()) {
- - signinManager.addSignInStateObserver(this);
- - }
- - ProfileSyncService syncService = ProfileSyncService.get();
- - if (syncService != null) {
- - syncService.addSyncStateChangedListener(this);
- - }
- - }
- -
- - @Override
- - public void onStop() {
- - super.onStop();
- - SigninManager signinManager = IdentityServicesProvider.get().getSigninManager(
- - Profile.getLastUsedRegularProfile());
- - if (signinManager.isSigninSupported()) {
- - signinManager.removeSignInStateObserver(this);
- - }
- - ProfileSyncService syncService = ProfileSyncService.get();
- - if (syncService != null) {
- - syncService.removeSyncStateChangedListener(this);
- - }
- - }
- -
- @Override
- public void onResume() {
- super.onResume();
- @@ -170,12 +122,9 @@ public class MainSettings extends PreferenceFragmentCompat
-
- cachePreferences();
-
- - mSignInPreference.setOnStateChangedCallback(this::onSignInPreferenceStateChanged);
- -
- updatePasswordsPreference();
-
- setManagedPreferenceDelegateForPreference(PREF_SEARCH_ENGINE);
- - setManagedPreferenceDelegateForPreference(PREF_DATA_REDUCTION);
-
- if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
- // If we are on Android O+ the Notifications preference should lead to the Android
- @@ -214,17 +163,6 @@ public class MainSettings extends PreferenceFragmentCompat
- .setTitle(SafetyCheckSettingsFragment.getSafetyCheckSettingsElementTitle(
- getContext()));
- }
- -
- - // Replace the account section header, replace SyncAndServicesSettings with
- - // ManageSyncSettings and add GoogleServicesSettings row if this flag is enabled.
- - if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
- - getPreferenceScreen().removePreference(findPreference(PREF_ACCOUNT_SECTION));
- - getPreferenceScreen().removePreference(findPreference(PREF_SYNC_AND_SERVICES));
- -
- - findPreference(PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION).setVisible(true);
- - mManageSync.setVisible(true);
- - findPreference(PREF_GOOGLE_SERVICES).setVisible(true);
- - }
- }
-
- /**
- @@ -237,9 +175,6 @@ public class MainSettings extends PreferenceFragmentCompat
- Preference preference = getPreferenceScreen().getPreference(index);
- mAllPreferences.put(preference.getKey(), preference);
- }
- - mSyncPromoPreference = (SyncPromoPreference) mAllPreferences.get(PREF_SYNC_PROMO);
- - mSignInPreference = (SignInPreference) mAllPreferences.get(PREF_SIGN_IN);
- - mManageSync = (ChromeBasePreference) findPreference(PREF_MANAGE_SYNC);
- }
-
- private void setManagedPreferenceDelegateForPreference(String key) {
- @@ -248,15 +183,6 @@ public class MainSettings extends PreferenceFragmentCompat
- }
-
- private void updatePreferences() {
- - if (IdentityServicesProvider.get()
- - .getSigninManager(Profile.getLastUsedRegularProfile())
- - .isSigninSupported()) {
- - addPreferenceIfAbsent(PREF_SIGN_IN);
- - } else {
- - removePreferenceIfPresent(PREF_SIGN_IN);
- - }
- -
- - updateSyncPreference();
- updateSearchEnginePreference();
-
- Preference homepagePref = addPreferenceIfAbsent(PREF_HOMEPAGE);
- @@ -273,10 +199,6 @@ public class MainSettings extends PreferenceFragmentCompat
- } else {
- removePreferenceIfPresent(PREF_DEVELOPER);
- }
- -
- - ChromeBasePreference dataReduction =
- - (ChromeBasePreference) findPreference(PREF_DATA_REDUCTION);
- - dataReduction.setSummary(DataReductionPreferenceFragment.generateSummary(getResources()));
- }
-
- private Preference addPreferenceIfAbsent(String key) {
- @@ -290,55 +212,6 @@ public class MainSettings extends PreferenceFragmentCompat
- if (preference != null) getPreferenceScreen().removePreference(preference);
- }
-
- - private void updateSyncPreference() {
- - if (ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)) {
- - updateManageSyncPreference();
- - } else {
- - updateSyncAndServicesPreference();
- - }
- - }
- -
- - private void updateSyncAndServicesPreference() {
- - ChromeBasePreference preference = findPreference(PREF_SYNC_AND_SERVICES);
- - preference.setIcon(SyncSettingsUtils.getSyncStatusIcon(getActivity()));
- - preference.setSummary(SyncSettingsUtils.getSyncStatusSummary(getActivity()));
- - }
- -
- - private void updateManageSyncPreference() {
- - String primaryAccountName = CoreAccountInfo.getEmailFrom(
- - IdentityServicesProvider.get()
- - .getIdentityManager(Profile.getLastUsedRegularProfile())
- - .getPrimaryAccountInfo(ConsentLevel.NOT_REQUIRED));
- - boolean showManageSync =
- - ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
- - && primaryAccountName != null;
- - mManageSync.setVisible(showManageSync);
- - if (!showManageSync) {
- - return;
- - }
- -
- - boolean isSyncConsentAvailable =
- - IdentityServicesProvider.get()
- - .getIdentityManager(Profile.getLastUsedRegularProfile())
- - .getPrimaryAccountInfo(ConsentLevel.SYNC)
- - != null;
- - mManageSync.setIcon(SyncSettingsUtils.getSyncStatusIcon(getActivity()));
- - mManageSync.setSummary(SyncSettingsUtils.getSyncStatusSummary(getActivity()));
- - mManageSync.setOnPreferenceClickListener(pref -> {
- - Context context = getContext();
- - if (ProfileSyncService.get().isSyncDisabledByEnterprisePolicy()) {
- - SyncSettingsUtils.showSyncDisabledByAdministratorToast(context);
- - } else if (isSyncConsentAvailable) {
- - SettingsLauncher settingsLauncher = new SettingsLauncherImpl();
- - settingsLauncher.launchSettingsActivity(context, ManageSyncSettings.class);
- - } else {
- - SigninActivityLauncherImpl.get().launchActivityForPromoDefaultFlow(
- - context, SigninAccessPoint.SETTINGS, primaryAccountName);
- - }
- - return true;
- - });
- - }
- -
- private void updateSearchEnginePreference() {
- if (!TemplateUrlServiceFactory.get().isLoaded()) {
- ChromeBasePreference searchEnginePref =
- @@ -370,30 +243,6 @@ public class MainSettings extends PreferenceFragmentCompat
- pref.setSummary(isOn ? R.string.text_on : R.string.text_off);
- }
-
- - // SigninManager.SignInStateObserver implementation.
- - @Override
- - public void onSignedIn() {
- - // After signing in or out of a managed account, preferences may change or become enabled
- - // or disabled.
- - new Handler().post(() -> updatePreferences());
- - }
- -
- - @Override
- - public void onSignedOut() {
- - updatePreferences();
- - }
- -
- - private void onSignInPreferenceStateChanged() {
- - // Remove "Account" section header if the personalized sign-in promo is shown. Remove
- - // "You and Google" section header if the personalized sync promo is shown.
- - boolean isShowingPersonalizedPromo =
- - mSignInPreference.getState() == SignInPreference.State.PERSONALIZED_PROMO;
- - String prefName = ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
- - ? PREF_ACCOUNT_AND_GOOGLE_SERVICES_SECTION
- - : PREF_ACCOUNT_SECTION;
- - findPreference(prefName).setVisible(!isShowingPersonalizedPromo);
- - }
- -
- // TemplateUrlService.LoadListener implementation.
- @Override
- public void onTemplateUrlServiceLoaded() {
- @@ -401,11 +250,6 @@ public class MainSettings extends PreferenceFragmentCompat
- updateSearchEnginePreference();
- }
-
- - @Override
- - public void syncStateChanged() {
- - updateSyncPreference();
- - }
- -
- @VisibleForTesting
- public ManagedPreferenceDelegate getManagedPreferenceDelegateForTest() {
- return mManagedPreferenceDelegate;
- @@ -415,9 +259,6 @@ public class MainSettings extends PreferenceFragmentCompat
- return new ChromeManagedPreferenceDelegate() {
- @Override
- public boolean isPreferenceControlledByPolicy(Preference preference) {
- - if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
- - return DataReductionProxySettings.getInstance().isDataReductionProxyManaged();
- - }
- if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
- return TemplateUrlServiceFactory.get().isDefaultSearchManaged();
- }
- @@ -426,11 +267,6 @@ public class MainSettings extends PreferenceFragmentCompat
-
- @Override
- public boolean isPreferenceClickDisabledByPolicy(Preference preference) {
- - if (PREF_DATA_REDUCTION.equals(preference.getKey())) {
- - DataReductionProxySettings settings = DataReductionProxySettings.getInstance();
- - return settings.isDataReductionProxyManaged()
- - && !settings.isDataReductionProxyEnabled();
- - }
- if (PREF_SEARCH_ENGINE.equals(preference.getKey())) {
- return TemplateUrlServiceFactory.get().isDefaultSearchManaged();
- }
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/signin/SigninManager.java
- @@ -53,7 +53,7 @@ import java.util.List;
- * See chrome/browser/signin/signin_manager_android.h for more details.
- */
- public class SigninManager
- - implements AccountTrackerService.OnSystemAccountsSeededListener, IdentityManager.Observer {
- + implements IdentityManager.Observer {
- private static final String TAG = "SigninManager";
-
- /**
- @@ -205,7 +205,6 @@ public class SigninManager
- * This is not final, as destroy() updates this.
- */
- private long mNativeSigninManagerAndroid;
- - private final AccountTrackerService mAccountTrackerService;
- private final IdentityManager mIdentityManager;
- private final IdentityMutator mIdentityMutator;
- private final AndroidSyncSettings mAndroidSyncSettings;
- @@ -243,24 +242,22 @@ public class SigninManager
- */
- @CalledByNative
- private static SigninManager create(long nativeSigninManagerAndroid,
- - AccountTrackerService accountTrackerService, IdentityManager identityManager,
- + IdentityManager identityManager,
- IdentityMutator identityMutator) {
- assert nativeSigninManagerAndroid != 0;
- - assert accountTrackerService != null;
- assert identityManager != null;
- assert identityMutator != null;
- - return new SigninManager(nativeSigninManagerAndroid, accountTrackerService, identityManager,
- + return new SigninManager(nativeSigninManagerAndroid, identityManager,
- identityMutator, AndroidSyncSettings.get(), AppHooks.get().getExternalAuthUtils());
- }
-
- @VisibleForTesting
- - SigninManager(long nativeSigninManagerAndroid, AccountTrackerService accountTrackerService,
- + SigninManager(long nativeSigninManagerAndroid,
- IdentityManager identityManager, IdentityMutator identityMutator,
- AndroidSyncSettings androidSyncSettings, ExternalAuthUtils externalAuthUtils) {
- ThreadUtils.assertOnUiThread();
- assert androidSyncSettings != null;
- mNativeSigninManagerAndroid = nativeSigninManagerAndroid;
- - mAccountTrackerService = accountTrackerService;
- mIdentityManager = identityManager;
- mIdentityMutator = identityMutator;
- mAndroidSyncSettings = androidSyncSettings;
- @@ -269,7 +266,6 @@ public class SigninManager
- mSigninAllowedByPolicy =
- SigninManagerJni.get().isSigninAllowedByPolicy(mNativeSigninManagerAndroid);
-
- - mAccountTrackerService.addSystemAccountsSeededListener(this);
- mIdentityManager.addObserver(this);
-
- reloadAllAccountsFromSystem();
- @@ -303,7 +299,6 @@ public class SigninManager
- @CalledByNative
- public void destroy() {
- mIdentityManager.removeObserver(this);
- - mAccountTrackerService.removeSystemAccountsSeededListener(this);
- mNativeSigninManagerAndroid = 0;
- }
-
- @@ -342,9 +337,7 @@ public class SigninManager
- * Returns true if signin can be started now.
- */
- public boolean isSignInAllowed() {
- - return !mFirstRunCheckIsPending && mSignInState == null && mSigninAllowedByPolicy
- - && mIdentityManager.getPrimaryAccountInfo(ConsentLevel.SYNC) == null
- - && isSigninSupported();
- + return false;
- }
-
- /**
- @@ -399,17 +392,6 @@ public class SigninManager
- });
- }
-
- - /**
- - * Continue pending sign in after system accounts have been seeded into AccountTrackerService.
- - */
- - @Override
- - public void onSystemAccountsSeedingComplete() {
- - if (mSignInState != null && mSignInState.mBlockedOnAccountSeeding) {
- - mSignInState.mBlockedOnAccountSeeding = false;
- - progressSignInFlowCheckPolicy();
- - }
- - }
- -
- /**
- * Starts the sign-in flow, and executes the callback when finished.
- *
- @@ -499,11 +481,8 @@ public class SigninManager
- mSignInState = signinState;
- notifySignInAllowedChanged();
-
- - if (mAccountTrackerService.checkAndSeedSystemAccounts()) {
- - progressSignInFlowCheckPolicy();
- - } else {
- - mSignInState.mBlockedOnAccountSeeding = true;
- - }
- + abortSignIn();
- + //mSignInState.mBlockedOnAccountSeeding = true;
- }
-
- /**
- @@ -550,44 +529,6 @@ public class SigninManager
- mIdentityMutator.reloadAllAccountsFromSystemWithPrimaryAccount(
- mSignInState.mCoreAccountInfo.getId());
-
- - @ConsentLevel
- - int consentLevel =
- - mSignInState.shouldTurnSyncOn() ? ConsentLevel.SYNC : ConsentLevel.NOT_REQUIRED;
- - if (!mIdentityMutator.setPrimaryAccount(
- - mSignInState.mCoreAccountInfo.getId(), consentLevel)) {
- - Log.w(TAG, "Failed to set the PrimaryAccount in IdentityManager, aborting signin");
- - abortSignIn();
- - return;
- - }
- -
- - if (mSignInState.shouldTurnSyncOn()) {
- - // TODO(https://crbug.com/1091858): Remove this after migrating the legacy code that
- - // uses the sync account before the native is loaded.
- - SigninPreferencesManager.getInstance().setLegacySyncAccountEmail(
- - mSignInState.mCoreAccountInfo.getEmail());
- -
- - // Cache the signed-in account name. This must be done after the native call, otherwise
- - // sync tries to start without being signed in the native code and crashes.
- - mAndroidSyncSettings.updateAccount(
- - AccountUtils.createAccountFromName(mSignInState.mCoreAccountInfo.getEmail()));
- - boolean atLeastOneDataTypeSynced =
- - !ProfileSyncService.get().getChosenDataTypes().isEmpty();
- - if (!ChromeFeatureList.isEnabled(ChromeFeatureList.MOBILE_IDENTITY_CONSISTENCY)
- - || atLeastOneDataTypeSynced) {
- - // Turn on sync only when user has at least one data type to sync, this is
- - // consistent with {@link ManageSyncSettings#updataSyncStateFromSelectedModelTypes},
- - // in which we turn off sync we stop sync service when the user toggles off all the
- - // sync types.
- - mAndroidSyncSettings.enableChromeSync();
- - }
- -
- - RecordUserAction.record("Signin_Signin_Succeed");
- - RecordHistogram.recordEnumeratedHistogram("Signin.SigninCompletedAccessPoint",
- - mSignInState.getAccessPoint(), SigninAccessPoint.MAX);
- - RecordHistogram.recordEnumeratedHistogram(
- - "Signin.SigninReason", SigninReason.SIGNIN_PRIMARY_ACCOUNT, SigninReason.MAX);
- - }
- -
- if (mSignInState.mCallback != null) {
- mSignInState.mCallback.onSignInComplete();
- }
- @@ -732,13 +673,8 @@ public class SigninManager
-
- Log.d(TAG, "On native signout, wipe user data: " + mSignOutState.mShouldWipeUserData);
-
- - // TODO(https://crbug.com/1091858): Remove this after migrating the legacy code that uses
- - // the sync account before the native is loaded.
- - SigninPreferencesManager.getInstance().setLegacySyncAccountEmail(null);
- -
- if (mSignOutState.mSignOutCallback != null) mSignOutState.mSignOutCallback.preWipeData();
- disableSyncAndWipeData(mSignOutState.mShouldWipeUserData, this::finishSignOut);
- - mAccountTrackerService.invalidateAccountSeedStatus(true);
- }
-
- void finishSignOut() {
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/AndroidSyncSettings.java
- @@ -223,10 +223,8 @@ public class AndroidSyncSettings {
-
- private void setChromeSyncEnabled(boolean value) {
- updateSyncability();
- - if (value == mChromeSyncEnabled || mAccount == null) return;
- + if (value == mChromeSyncEnabled) return;
- mChromeSyncEnabled = value;
- -
- - mSyncContentResolverDelegate.setSyncAutomatically(mAccount, mContractAuthority, value);
- notifyObservers();
- }
-
- @@ -275,27 +273,9 @@ public class AndroidSyncSettings {
- boolean oldChromeSyncEnabled = mChromeSyncEnabled;
- boolean oldMasterSyncEnabled = mMasterSyncEnabled;
-
- - if (mAccount != null) {
- - mIsSyncable =
- - mSyncContentResolverDelegate.getIsSyncable(mAccount, mContractAuthority) > 0;
- - mChromeSyncEnabled =
- - mSyncContentResolverDelegate.getSyncAutomatically(mAccount, mContractAuthority);
- - } else {
- - mIsSyncable = false;
- - mChromeSyncEnabled = false;
- - }
- - mMasterSyncEnabled = mSyncContentResolverDelegate.getMasterSyncAutomatically();
- -
- - if (mAccount != null && ProfileSyncService.get() != null
- - && ChromeFeatureList.isEnabled(
- - ChromeFeatureList.DECOUPLE_SYNC_FROM_ANDROID_MASTER_SYNC)
- - && mMasterSyncEnabled && !mShouldDecoupleSyncFromMasterSync) {
- - // Re-enabling master sync at least once should cause Sync to no longer care whether
- - // the former is enabled or not. This fact should be persisted via ProfileSyncService
- - // so it's known on the next startup.
- - mShouldDecoupleSyncFromMasterSync = true;
- - ProfileSyncService.get().setDecoupledFromAndroidMasterSync();
- - }
- + mIsSyncable = false;
- + mChromeSyncEnabled = false;
- + mMasterSyncEnabled = false;
-
- return oldChromeSyncEnabled != mChromeSyncEnabled
- || oldMasterSyncEnabled != mMasterSyncEnabled;
- diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
- --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
- +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/settings/SyncAndServicesSettings.java
- @@ -172,15 +172,7 @@ public class SyncAndServicesSettings extends PreferenceFragmentCompat
-
- mPrivacyPrefManager.migrateNetworkPredictionPreferences();
-
- - getActivity().setTitle(R.string.prefs_sync_and_services);
- setHasOptionsMenu(true);
- - if (mIsFromSigninScreen) {
- - ActionBar actionBar = ((AppCompatActivity) getActivity()).getSupportActionBar();
- - assert actionBar != null;
- - actionBar.setHomeActionContentDescription(
- - R.string.prefs_sync_and_services_content_description);
- - RecordUserAction.record("Signin_Signin_ShowAdvancedSyncSettings");
- - }
-
- SettingsUtils.addPreferencesFromResource(this, R.xml.sync_and_services_preferences);
-
- diff --git a/chrome/browser/android/signin/signin_manager_android.cc b/chrome/browser/android/signin/signin_manager_android.cc
- --- a/chrome/browser/android/signin/signin_manager_android.cc
- +++ b/chrome/browser/android/signin/signin_manager_android.cc
- @@ -141,7 +141,6 @@ SigninManagerAndroid::SigninManagerAndroid(
-
- java_signin_manager_ = Java_SigninManager_create(
- base::android::AttachCurrentThread(), reinterpret_cast<intptr_t>(this),
- - identity_manager_->LegacyGetAccountTrackerServiceJavaObject(),
- identity_manager_->GetJavaObject(),
- identity_manager_->GetIdentityMutatorJavaObject());
- }
- diff --git a/chrome/browser/ui/android/strings/android_chrome_strings.grd b/chrome/browser/ui/android/strings/android_chrome_strings.grd
- --- a/chrome/browser/ui/android/strings/android_chrome_strings.grd
- +++ b/chrome/browser/ui/android/strings/android_chrome_strings.grd
- @@ -269,21 +269,12 @@ CHAR-LIMIT guidelines:
- <message name="IDS_SIGN_IN_TO_CHROME" desc="Title for the button to sign in to Chrome using one's Google account. [CHAR-LIMIT=27]">
- Sign in to Chrome
- </message>
- - <message name="IDS_PREFS_SYNC_AND_SERVICES" desc="Title for Settings section to manage data collection for Sync and Google services. [CHAR-LIMIT=40]">
- - Sync and Google services
- - </message>
- - <message name="IDS_PREFS_SYNC_AND_SERVICES_CONTENT_DESCRIPTION" desc="The accessibility text to read when the 'Sync and Google services' Settings page is opened from the sign-in page. This text is attached to the 'Navigate Up' button shown at the top of the screen. The first two sentences describe the screen that is currently shown to the user, while 'Navigate up' is a description for the button this text is attached to. 'Navigate up' should match TC ID 6794660482873516081.">
- - You are currently customizing your Sync and Google service settings. To finish turning on sync, tap the Confirm button near the bottom of the screen. Navigate up
- - </message>
- <message name="IDS_SIGNIN_PREF_DISALLOWED_TITLE" desc="Title for the signin entry in Settings when signin is disallowed.">
- Not signed in
- </message>
- <message name="IDS_SIGNIN_PREF_SUMMARY" desc="Summary for the entry in Settings to sign in to Chrome, explaining benefits of signing in.">
- Sync and personalize across devices
- </message>
- - <message name="IDS_SYNC_AND_SERVICES_SUMMARY_SYNC_ON" desc="Summary for 'Sync and Google services' preference row when sync is enabled.">
- - Sync is on
- - </message>
- <message name="IDS_SIGN_IN_TO_CHROME_DISABLED_SUMMARY" desc="A descriptive line of text that appears under the 'Sign in to Chrome' option, in Chrome Settings on Android. The text explains why 'Sign in to Chrome' is disabled. 'Administrator' refers to the IT administrator of the company/organization that owns the user’s device.">
- Disabled by the administrator of this device
- </message>
- @@ -345,15 +336,6 @@ CHAR-LIMIT guidelines:
- <message name="IDS_URL_KEYED_ANONYMIZED_DATA_SUMMARY" desc="Summary for a checkbox in Settings that controls non-personalized URL collection and informs the user about the data shared by this feature.">
- Sends URLs of pages you visit to Google
- </message>
- - <message name="IDS_PRIVACY_SYNC_AND_SERVICES_LINK_LEGACY" desc="The text for Privacy preferences that is shown after all preference rows.">
- - For more settings that relate to privacy, security, and data collection, see <ph name="BEGIN_LINK"><link></ph>Sync and Google services<ph name="END_LINK"></link></ph>
- - </message>
- - <message name="IDS_PRIVACY_SYNC_AND_SERVICES_LINK_SYNC_ON" desc="The text for Privacy preferences that is shown after all preference rows. This version of the text is shown if Sync has been turned on.">
- - For more settings that relate to privacy, security, and data collection, see <ph name="BEGIN_LINK1"><link1></ph>Sync<ph name="END_LINK1"></link1></ph> and <ph name="BEGIN_LINK2"><link2></ph>Google services<ph name="END_LINK2"></link2></ph>
- - </message>
- - <message name="IDS_PRIVACY_SYNC_AND_SERVICES_LINK_SYNC_OFF" desc="The text for Privacy preferences that is shown after all preference rows. This version of the text is shown if Sync hasn't been turned on.">
- - For more settings that relate to privacy, security, and data collection, see <ph name="BEGIN_LINK"><link></ph>Google services<ph name="END_LINK"></link></ph>
- - </message>
- <message name="IDS_CANCEL_SYNC_DIALOG_TITLE" desc="The title of a dialog that is shown when users tries closing 'Sync and Google services' preferences without confirming the changes.">
- Cancel sync?
- </message>
- diff --git a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
- --- a/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
- +++ b/components/signin/core/browser/android/java/src/org/chromium/components/signin/SystemAccountManagerDelegate.java
- @@ -172,16 +172,6 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
-
- @Override
- public boolean hasFeatures(Account account, String[] features) {
- - if (!hasGetAccountsPermission()) {
- - return false;
- - }
- - try {
- - return mAccountManager.hasFeatures(account, features, null, null).getResult();
- - } catch (AuthenticatorException | IOException e) {
- - Log.e(TAG, "Error while checking features: ", e);
- - } catch (OperationCanceledException e) {
- - Log.e(TAG, "Checking features was cancelled. This should not happen.");
- - }
- return false;
- }
-
- @@ -221,32 +211,10 @@ public class SystemAccountManagerDelegate implements AccountManagerDelegate {
- public void updateCredentials(
- Account account, Activity activity, final Callback<Boolean> callback) {
- ThreadUtils.assertOnUiThread();
- - if (!hasManageAccountsPermission()) {
- - if (callback != null) {
- - ThreadUtils.postOnUiThread(callback.bind(false));
- - }
- - return;
- + if (callback != null) {
- + ThreadUtils.postOnUiThread(callback.bind(false));
- }
- -
- - AccountManagerCallback<Bundle> realCallback = future -> {
- - Bundle bundle = null;
- - try {
- - bundle = future.getResult();
- - } catch (AuthenticatorException | IOException e) {
- - Log.e(TAG, "Error while update credentials: ", e);
- - } catch (OperationCanceledException e) {
- - Log.w(TAG, "Updating credentials was cancelled.");
- - }
- - boolean success =
- - bundle != null && bundle.getString(AccountManager.KEY_ACCOUNT_TYPE) != null;
- - if (callback != null) {
- - callback.onResult(success);
- - }
- - };
- - // Android 4.4 throws NullPointerException if null is passed
- - Bundle emptyOptions = new Bundle();
- - mAccountManager.updateCredentials(
- - account, "android", emptyOptions, activity, realCallback, null);
- + return;
- }
-
- @Nullable
- diff --git a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
- --- a/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
- +++ b/net/android/java/src/org/chromium/net/HttpNegotiateAuthenticator.java
- @@ -98,54 +98,8 @@ public class HttpNegotiateAuthenticator {
-
- @Override
- public void run(AccountManagerFuture<Account[]> future) {
- - Account[] accounts;
- - try {
- - accounts = future.getResult();
- - } catch (OperationCanceledException | AuthenticatorException | IOException e) {
- - Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to retrieve accounts.", e);
- - HttpNegotiateAuthenticatorJni.get().setResult(mRequestData.nativeResultObject,
- - HttpNegotiateAuthenticator.this, NetError.ERR_UNEXPECTED, null);
- - return;
- - }
- -
- - if (accounts.length == 0) {
- - Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: No account provided for the kerberos "
- - + "authentication. Please verify the configuration policies and "
- - + "that the CONTACTS runtime permission is granted. ");
- - HttpNegotiateAuthenticatorJni.get().setResult(mRequestData.nativeResultObject,
- - HttpNegotiateAuthenticator.this, NetError.ERR_MISSING_AUTH_CREDENTIALS,
- - null);
- - return;
- - }
- -
- - if (accounts.length > 1) {
- - Log.w(TAG, "ERR_MISSING_AUTH_CREDENTIALS: Found %d accounts eligible for the "
- - + "kerberos authentication. Please fix the configuration by "
- - + "providing a single account.",
- - accounts.length);
- - HttpNegotiateAuthenticatorJni.get().setResult(mRequestData.nativeResultObject,
- - HttpNegotiateAuthenticator.this, NetError.ERR_MISSING_AUTH_CREDENTIALS,
- - null);
- - return;
- - }
- -
- - if (lacksPermission(ContextUtils.getApplicationContext(),
- - "android.permission.USE_CREDENTIALS", true)) {
- - // Protecting the AccountManager#getAuthToken call.
- - // API < 23 Requires the USE_CREDENTIALS permission or throws an exception.
- - // API >= 23 USE_CREDENTIALS permission is removed
- - Log.e(TAG, "ERR_MISCONFIGURED_AUTH_ENVIRONMENT: USE_CREDENTIALS permission not "
- - + "granted. Aborting authentication.");
- - HttpNegotiateAuthenticatorJni.get().setResult(mRequestData.nativeResultObject,
- - HttpNegotiateAuthenticator.this,
- - NetError.ERR_MISCONFIGURED_AUTH_ENVIRONMENT, null);
- - return;
- - }
- - mRequestData.account = accounts[0];
- - mRequestData.accountManager.getAuthToken(mRequestData.account,
- - mRequestData.authTokenType, mRequestData.options, true /* notifyAuthFailure */,
- - new GetTokenCallback(mRequestData),
- - new Handler(ThreadUtils.getUiThreadLooper()));
- + // account-based authentication removed for privacy-violations concerns
- + return;
- }
- }
-
- @@ -158,42 +112,8 @@ public class HttpNegotiateAuthenticator {
-
- @Override
- public void run(AccountManagerFuture<Bundle> future) {
- - Bundle result;
- - try {
- - result = future.getResult();
- - } catch (OperationCanceledException | AuthenticatorException | IOException e) {
- - Log.w(TAG, "ERR_UNEXPECTED: Error while attempting to obtain a token.", e);
- - HttpNegotiateAuthenticatorJni.get().setResult(mRequestData.nativeResultObject,
- - HttpNegotiateAuthenticator.this, NetError.ERR_UNEXPECTED, null);
- - return;
- - }
- -
- - if (result.containsKey(AccountManager.KEY_INTENT)) {
- - final Context appContext = ContextUtils.getApplicationContext();
- -
- - // We wait for a broadcast that should be sent once the user is done interacting
- - // with the notification
- - // TODO(dgn) We currently hang around if the notification is swiped away, until
- - // a LOGIN_ACCOUNTS_CHANGED_ACTION filter is received. It might be for something
- - // unrelated then we would wait again here. Maybe we should limit the number of
- - // retries in some way?
- - BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {
- -
- - @Override
- - public void onReceive(Context context, Intent intent) {
- - appContext.unregisterReceiver(this);
- - mRequestData.accountManager.getAuthToken(mRequestData.account,
- - mRequestData.authTokenType, mRequestData.options,
- - true /* notifyAuthFailure */, new GetTokenCallback(mRequestData),
- - null);
- - }
- -
- - };
- - appContext.registerReceiver(broadcastReceiver,
- - new IntentFilter(AccountManager.LOGIN_ACCOUNTS_CHANGED_ACTION));
- - } else {
- - processResult(result, mRequestData);
- - }
- + // account-based authentication removed for privacy-violations concerns
- + return;
- }
- }
-
- diff --git a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
- --- a/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
- +++ b/remoting/android/java/src/org/chromium/chromoting/base/OAuthTokenFetcher.java
- @@ -93,7 +93,6 @@ public class OAuthTokenFetcher {
-
- /** Begins fetching a token. Should be called on the main thread. */
- public void fetch() {
- - fetchImpl(null);
- }
-
- /**
- @@ -102,7 +101,6 @@ public class OAuthTokenFetcher {
- * @param expiredToken A previously-fetched token which has expired.
- */
- public void clearAndFetch(String expiredToken) {
- - fetchImpl(expiredToken);
- }
-
- private void fetchImpl(final String expiredToken) {
- --
- 2.17.1
|