Commit f6f48d63 authored by Tanmoy Mollik's avatar Tanmoy Mollik Committed by Commit Bot

[Android] Add description string for the new sync error cards

This cl adds description strings for the sync error cards that will be
used in ManageSyncSettings page.

Bug: 1107420
Change-Id: I16c68378e6bc2fb4f8f35e4d1bdcaceb38c2f2eb
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2332446Reviewed-by: default avatarMarc Treib <treib@chromium.org>
Reviewed-by: default avatarAlice Wang <aliceywang@chromium.org>
Commit-Queue: Tanmoy Mollik <triploblastic@chromium.org>
Cr-Commit-Position: refs/heads/master@{#795932}
parent 9d8d3b3b
......@@ -55,7 +55,8 @@ public class SyncSettingsUtils {
private static final String TAG = "SyncSettingsUtils";
@IntDef({SyncError.NO_ERROR, SyncError.ANDROID_SYNC_DISABLED, SyncError.AUTH_ERROR,
SyncError.PASSPHRASE_REQUIRED, SyncError.CLIENT_OUT_OF_DATE,
SyncError.PASSPHRASE_REQUIRED, SyncError.TRUSTED_VAULT_KEY_REQUIRED_FOR_EVERYTHING,
SyncError.TRUSTED_VAULT_KEY_REQUIRED_FOR_PASSWORDS, SyncError.CLIENT_OUT_OF_DATE,
SyncError.SYNC_SETUP_INCOMPLETE, SyncError.OTHER_ERRORS})
@Retention(RetentionPolicy.SOURCE)
public @interface SyncError {
......@@ -149,6 +150,30 @@ public class SyncSettingsUtils {
}
}
public static @Nullable String getSyncErrorCardButtonLabel(
Context context, @SyncError int error) {
switch (error) {
case SyncError.ANDROID_SYNC_DISABLED:
return context.getString(R.string.android_sync_disabled_error_card_button);
case SyncError.AUTH_ERROR:
return context.getString(R.string.auth_error_card_button);
case SyncError.CLIENT_OUT_OF_DATE:
return context.getString(R.string.client_out_of_date_error_card_button,
BuildInfo.getInstance().hostPackageLabel);
case SyncError.PASSPHRASE_REQUIRED:
return context.getString(R.string.passphrase_required_error_card_button);
case SyncError.TRUSTED_VAULT_KEY_REQUIRED_FOR_EVERYTHING:
case SyncError.TRUSTED_VAULT_KEY_REQUIRED_FOR_PASSWORDS:
return context.getString(R.string.trusted_vault_error_card_button);
case SyncError.SYNC_SETUP_INCOMPLETE:
return context.getString(R.string.sync_setup_incomplete_error_card_confirm_button);
case SyncError.OTHER_ERRORS:
case SyncError.NO_ERROR:
default:
return null;
}
}
/**
* Gets the corresponding message id of a given {@link GoogleServiceAuthError.State}.
*/
......
......@@ -1683,6 +1683,26 @@ To change this setting, <ph name="BEGIN_LINK">&lt;resetlink&gt;</ph>reset sync<p
Update <ph name="PRODUCT_NAME">%1$s<ex>Chrome</ex></ph> to start sync
</message>
<!-- Sync error card button strings -->
<message name="IDS_ANDROID_SYNC_DISABLED_ERROR_CARD_BUTTON" desc="Button text for android sync disabled error in sync error cards.">
Enable Android system sync
</message>
<message name="IDS_CLIENT_OUT_OF_DATE_ERROR_CARD_BUTTON" desc="Button text for client out of date error in sync error cards.">
Update <ph name="PRODUCT_NAME">%1$s<ex>Chrome</ex></ph>
</message>
<message name="IDS_PASSPHRASE_REQUIRED_ERROR_CARD_BUTTON" desc="Button text for passphrase required error in sync error cards.">
Enter passphrase
</message>
<message name="IDS_AUTH_ERROR_CARD_BUTTON" desc="Button text for auth error in sync error cards.">
Sign in again
</message>
<message name="IDS_SYNC_SETUP_INCOMPLETE_ERROR_CARD_CONFIRM_BUTTON" desc="Positive button text for advanced sync interrupted error in sync error cards.">
Confirm sync
</message>
<message name="IDS_TRUSTED_VAULT_ERROR_CARD_BUTTON" desc="Button text for trusted vault error in sync error cards.">
Unlock with Screen Lock
</message>
<!-- Sync error strings -->
<message name="IDS_SYNC_ERROR_GENERIC" desc="Sync error string for generic error. [CHAR-LIMIT=80]">
Sync has stopped working
......
6572c00b3bb97e2b4090429604a2fc8bf687a997
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment