本文整理匯總了Java中org.chromium.components.sync.ProtocolErrorClientAction類的典型用法代碼示例。如果您正苦於以下問題:Java ProtocolErrorClientAction類的具體用法?Java ProtocolErrorClientAction怎麽用?Java ProtocolErrorClientAction使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
ProtocolErrorClientAction類屬於org.chromium.components.sync包,在下文中一共展示了ProtocolErrorClientAction類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: getSyncError
import org.chromium.components.sync.ProtocolErrorClientAction; //導入依賴的package包/類
@SyncError
private int getSyncError() {
if (!AndroidSyncSettings.isMasterSyncEnabled(getActivity())) {
return SYNC_ANDROID_SYNC_DISABLED;
}
if (!mSyncSwitchPreference.isChecked()) {
return SYNC_NO_ERROR;
}
if (mProfileSyncService.getAuthError()
== GoogleServiceAuthError.State.INVALID_GAIA_CREDENTIALS) {
return SYNC_AUTH_ERROR;
}
if (mProfileSyncService.getProtocolErrorClientAction()
== ProtocolErrorClientAction.UPGRADE_CLIENT) {
return SYNC_CLIENT_OUT_OF_DATE;
}
if (mProfileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE
|| mProfileSyncService.hasUnrecoverableError()) {
return SYNC_OTHER_ERRORS;
}
if (mProfileSyncService.isSyncActive()
&& mProfileSyncService.isPassphraseRequiredForDecryption()) {
return SYNC_PASSPHRASE_REQUIRED;
}
return SYNC_NO_ERROR;
}
示例2: getSyncStatusSummary
import org.chromium.components.sync.ProtocolErrorClientAction; //導入依賴的package包/類
/**
* Return a short summary of the current sync status.
*/
static String getSyncStatusSummary(Context context) {
if (!ChromeSigninController.get(context).isSignedIn()) return "";
ProfileSyncService profileSyncService = ProfileSyncService.get();
Resources res = context.getResources();
if (ChildAccountService.isChildAccount()) {
return res.getString(R.string.kids_account);
}
if (!AndroidSyncSettings.isMasterSyncEnabled(context)) {
return res.getString(R.string.sync_android_master_sync_disabled);
}
if (profileSyncService == null) {
return res.getString(R.string.sync_is_disabled);
}
if (profileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE) {
return res.getString(profileSyncService.getAuthError().getMessage());
}
if (profileSyncService.getProtocolErrorClientAction()
== ProtocolErrorClientAction.UPGRADE_CLIENT) {
return res.getString(
R.string.sync_error_upgrade_client, BuildInfo.getPackageLabel(context));
}
if (profileSyncService.hasUnrecoverableError()) {
return res.getString(R.string.sync_error_generic);
}
boolean syncEnabled = AndroidSyncSettings.isSyncEnabled(context);
if (syncEnabled) {
if (!profileSyncService.isSyncActive()) {
return res.getString(R.string.sync_setup_progress);
}
if (profileSyncService.isPassphraseRequiredForDecryption()) {
return res.getString(R.string.sync_need_passphrase);
}
Account account = ChromeSigninController.get(context).getSignedInUser();
return String.format(
context.getString(R.string.account_management_sync_summary), account.name);
}
return context.getString(R.string.sync_is_disabled);
}
示例3: getSyncStatusSummary
import org.chromium.components.sync.ProtocolErrorClientAction; //導入依賴的package包/類
/**
* Return a short summary of the current sync status.
*/
static String getSyncStatusSummary(Context context) {
if (!ChromeSigninController.get().isSignedIn()) return "";
ProfileSyncService profileSyncService = ProfileSyncService.get();
Resources res = context.getResources();
if (!AndroidSyncSettings.isMasterSyncEnabled(context)) {
return res.getString(R.string.sync_android_master_sync_disabled);
}
if (profileSyncService == null) {
return res.getString(R.string.sync_is_disabled);
}
if (profileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE) {
return res.getString(profileSyncService.getAuthError().getMessage());
}
if (profileSyncService.getProtocolErrorClientAction()
== ProtocolErrorClientAction.UPGRADE_CLIENT) {
return res.getString(R.string.sync_error_upgrade_client, BuildInfo.getPackageLabel());
}
if (profileSyncService.hasUnrecoverableError()) {
return res.getString(R.string.sync_error_generic);
}
boolean syncEnabled = AndroidSyncSettings.isSyncEnabled(context);
if (syncEnabled) {
if (!profileSyncService.isSyncActive()) {
return res.getString(R.string.sync_setup_progress);
}
if (profileSyncService.isPassphraseRequiredForDecryption()) {
return res.getString(R.string.sync_need_passphrase);
}
Account account = ChromeSigninController.get().getSignedInUser();
return String.format(
context.getString(R.string.account_management_sync_summary), account.name);
}
return context.getString(R.string.sync_is_disabled);
}