зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1231549 - Set default profile endpoint server URI for Firefox Accounts not created via the web flow. r=nalexander
This commit is contained in:
Родитель
62a6c6000f
Коммит
0bc8179166
|
@ -293,18 +293,29 @@ public class AndroidFxAccount {
|
|||
}
|
||||
|
||||
public String getProfileServerURI() {
|
||||
return accountManager.getUserData(account, ACCOUNT_KEY_PROFILE_SERVER);
|
||||
String profileURI = accountManager.getUserData(account, ACCOUNT_KEY_PROFILE_SERVER);
|
||||
if (profileURI == null) {
|
||||
if (isStaging()) {
|
||||
return FxAccountConstants.STAGE_PROFILE_SERVER_ENDPOINT;
|
||||
}
|
||||
return FxAccountConstants.DEFAULT_PROFILE_SERVER_ENDPOINT;
|
||||
}
|
||||
return profileURI;
|
||||
}
|
||||
|
||||
public String getOAuthServerURI() {
|
||||
// Allow testing against stage.
|
||||
if (FxAccountConstants.STAGE_AUTH_SERVER_ENDPOINT.equals(getAccountServerURI())) {
|
||||
if (isStaging()) {
|
||||
return FxAccountConstants.STAGE_OAUTH_SERVER_ENDPOINT;
|
||||
} else {
|
||||
return FxAccountConstants.DEFAULT_OAUTH_SERVER_ENDPOINT;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isStaging() {
|
||||
return FxAccountConstants.STAGE_AUTH_SERVER_ENDPOINT.equals(getAccountServerURI());
|
||||
}
|
||||
|
||||
private String constructPrefsPath(String product, long version, String extra) throws GeneralSecurityException, UnsupportedEncodingException {
|
||||
String profile = getProfile();
|
||||
String username = account.name;
|
||||
|
|
Загрузка…
Ссылка в новой задаче