Remove fxAccountsEnabled()

This commit is contained in:
wolfbeast 2018-11-30 11:15:22 +01:00 committed by Roy Tam
commit 486cc48e33
4 changed files with 7 additions and 45 deletions

View file

@ -92,29 +92,6 @@ WeaveService.prototype = {
return deferred.promise;
},
/**
* Whether Firefox Accounts is enabled.
*
* @return bool
*
* This function is currently always returning false because we don't support
* the use of FxA/Sync-1.5 but do want to keep the code "just in case".
*/
get fxAccountsEnabled() {
// Early exit: FxA not supported.
return false;
/* -- commented out to prevent unreachable code warning --
try {
// Old sync guarantees '@' will never appear in the username while FxA
// uses the FxA email address - so '@' is the flag we use.
let username = Services.prefs.getCharPref(SYNC_PREFS_BRANCH + "username");
return !username || username.includes('@');
} catch (_) {
return true; // No username == only allow FxA to be configured.
}
*/
},
/**
* Whether Sync appears to be enabled.
*

View file

@ -43,8 +43,7 @@ SyncScheduler.prototype = {
.getService(Ci.nsISupports)
.wrappedJSObject;
let part = service.fxAccountsEnabled ? "fxa" : "sync11";
let prefSDInterval = "scheduler." + part + ".singleDeviceInterval";
let prefSDInterval = "scheduler.sync11.singleDeviceInterval";
this.singleDeviceInterval = Svc.Prefs.get(prefSDInterval) * 1000;
this.idleInterval = Svc.Prefs.get("scheduler.idleInterval") * 1000;

View file

@ -28,7 +28,7 @@ this.Status = {
let service = Components.classes["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
let idClass = service.fxAccountsEnabled ? BrowserIDManager : IdentityManager;
let idClass = IdentityManager;
this.__authManager = new idClass();
// .initialize returns a promise, so we need to spin until it resolves.
let cb = Async.makeSpinningCallback();

View file

@ -114,7 +114,6 @@ var TPS = {
let service = Cc["@mozilla.org/weave/service;1"]
.getService(Components.interfaces.nsISupports)
.wrappedJSObject;
this.fxaccounts_enabled = service.fxAccountsEnabled;
this.delayAutoSync();
@ -123,12 +122,7 @@ var TPS = {
}, this);
// Import the appropriate authentication module
if (this.fxaccounts_enabled) {
Cu.import("resource://tps/auth/fxaccounts.jsm", module);
}
else {
Cu.import("resource://tps/auth/sync.jsm", module);
}
Cu.import("resource://tps/auth/sync.jsm", module);
},
DumpError: function TPS__DumpError(msg) {
@ -640,7 +634,6 @@ var TPS = {
Logger.logInfo("Sync version: " + WEAVE_VERSION);
Logger.logInfo("Firefox buildid: " + Services.appinfo.appBuildID);
Logger.logInfo("Firefox version: " + Services.appinfo.version);
Logger.logInfo('Firefox Accounts enabled: ' + this.fxaccounts_enabled);
// do some sync housekeeping
if (Weave.Service.isLoggedIn) {
@ -729,15 +722,9 @@ var TPS = {
// Store account details as prefs so they're accessible to the Mozmill
// framework.
if (this.fxaccounts_enabled) {
prefs.setCharPref('tps.account.username', this.config.fx_account.username);
prefs.setCharPref('tps.account.password', this.config.fx_account.password);
}
else {
prefs.setCharPref('tps.account.username', this.config.sync_account.username);
prefs.setCharPref('tps.account.password', this.config.sync_account.password);
prefs.setCharPref('tps.account.passphrase', this.config.sync_account.passphrase);
}
prefs.setCharPref('tps.account.username', this.config.sync_account.username);
prefs.setCharPref('tps.account.password', this.config.sync_account.password);
prefs.setCharPref('tps.account.passphrase', this.config.sync_account.passphrase);
// start processing the test actions
this._currentAction = 0;
@ -862,8 +849,7 @@ var TPS = {
}
Logger.logInfo("Setting client credentials and login.");
let account = this.fxaccounts_enabled ? this.config.fx_account
: this.config.sync_account;
let account = this.config.sync_account;
Authentication.signIn(account);
this.waitForSetupComplete();
Logger.AssertEqual(Weave.Status.service, Weave.STATUS_OK, "Weave status OK");