Bug 958889 - Part 2.5: Add old Sync upgrade URL method to services and strings. r=nalexander

This commit is contained in:
Michael Comella 2014-05-14 08:56:23 -07:00
Родитель 219e6bff01
Коммит 438512e8d6
4 изменённых файлов: 16 добавлений и 5 удалений

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

@ -6,8 +6,11 @@ package org.mozilla.gecko.fxa;
import java.io.File;
import java.util.EnumSet;
import java.util.Locale;
import java.util.concurrent.CountDownLatch;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.R;
import org.mozilla.gecko.background.common.log.Logger;
import org.mozilla.gecko.fxa.authenticator.AccountPickler;
import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
@ -20,6 +23,7 @@ import android.accounts.Account;
import android.accounts.AccountManager;
import android.content.ContentResolver;
import android.content.Context;
import android.content.res.Resources;
import android.os.Bundle;
/**
@ -264,4 +268,11 @@ public class FirefoxAccounts {
// stopObserving null-checks its argument.
FxAccountSyncStatusHelper.getInstance().stopObserving(syncStatusListener);
}
public static String getOldSyncUpgradeURL(final Resources res, final Locale locale) {
final String VERSION = AppConstants.MOZ_APP_VERSION;
final String OS = AppConstants.OS_TARGET;
final String LOCALE = Utils.getLanguageTag(locale);
return res.getString(R.string.fxaccount_link_old_firefox, VERSION, OS, LOCALE);
}
}

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

@ -109,11 +109,7 @@ public class FxAccountGetStartedActivity extends AccountAuthenticatorActivity {
protected void linkifyOldFirefoxLink() {
TextView oldFirefox = (TextView) findViewById(R.id.old_firefox);
String text = getResources().getString(R.string.fxaccount_getting_started_old_firefox);
String VERSION = AppConstants.MOZ_APP_VERSION;
String OS = AppConstants.OS_TARGET;
String LOCALE = Utils.getLanguageTag(Locale.getDefault());
String url = getResources().getString(R.string.fxaccount_link_old_firefox, VERSION, OS, LOCALE);
final String url = FirefoxAccounts.getOldSyncUpgradeURL(getResources(), Locale.getDefault());
FxAccountConstants.pii(LOG_TAG, "Old Firefox url is: " + url); // Don't want to leak locale in particular.
ActivityUtils.linkTextView(oldFirefox, text, url);
}

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

@ -107,6 +107,8 @@
<!-- Firefox Account strings. -->
<!ENTITY fxaccount_full_label 'Firefox Accounts'>
<!-- Localization note: these are shown in all screens that query the
user for an email address and password. Hide and show are button
labels. -->

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

@ -103,6 +103,8 @@
<!-- Firefox Account strings. -->
<string name="fxaccount_full_label">&fxaccount_full_label;</string>
<!-- Firefox Account links. -->
<!-- https://support.mozilla.org/1/mobile/%VERSION%/%OS%/%LOCALE%/old-sync -->
<string name="fxaccount_link_old_firefox">https://support.mozilla.org/1/mobile/&formatS1;/&formatS2;/&formatS3;/old-sync</string>