Bug 1139946 - Generalize audience across SyncAdapter instances. r=rnewman

This commit is contained in:
Nick Alexander 2015-03-05 08:59:02 -08:00
Родитель ff6c28cc47
Коммит 7eac0a2e1d
2 изменённых файлов: 1 добавлений и 6 удалений

Просмотреть файл

@ -270,10 +270,6 @@ public class AndroidFxAccount {
return accountManager.getUserData(account, ACCOUNT_KEY_IDP_SERVER);
}
public String getAudience() {
return accountManager.getUserData(account, ACCOUNT_KEY_AUDIENCE);
}
public String getTokenServerURI() {
return accountManager.getUserData(account, ACCOUNT_KEY_TOKEN_SERVER);
}
@ -402,7 +398,6 @@ public class AndroidFxAccount {
userdata.putString(ACCOUNT_KEY_ACCOUNT_VERSION, "" + CURRENT_ACCOUNT_VERSION);
userdata.putString(ACCOUNT_KEY_IDP_SERVER, idpServerURI);
userdata.putString(ACCOUNT_KEY_TOKEN_SERVER, tokenServerURI);
userdata.putString(ACCOUNT_KEY_AUDIENCE, FxAccountUtils.getAudienceForURL(tokenServerURI));
userdata.putString(ACCOUNT_KEY_PROFILE, profile);
if (bundle == null) {

Просмотреть файл

@ -456,10 +456,10 @@ public class FxAccountSyncAdapter extends AbstractThreadedSyncAdapter {
// and extend the background delay even further into the future.
schedulePolicy.configureBackoffMillisBeforeSyncing(rateLimitBackoffHandler, backgroundBackoffHandler);
final String audience = fxAccount.getAudience();
final String authServerEndpoint = fxAccount.getAccountServerURI();
final String tokenServerEndpoint = fxAccount.getTokenServerURI();
final URI tokenServerEndpointURI = new URI(tokenServerEndpoint);
final String audience = FxAccountUtils.getAudienceForURL(tokenServerEndpoint);
// TODO: why doesn't the loginPolicy extract the audience from the account?
final FxAccountClient client = new FxAccountClient20(authServerEndpoint, executor);