當前位置: 首頁>>代碼示例>>Java>>正文


Java ProtocolErrorClientAction類代碼示例

本文整理匯總了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;
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:33,代碼來源:SyncCustomizationFragment.java

示例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);
}
 
開發者ID:rkshuai,項目名稱:chromium-for-android-56-debug-video,代碼行數:54,代碼來源:SyncPreference.java

示例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);
}
 
開發者ID:mogoweb,項目名稱:365browser,代碼行數:49,代碼來源:SyncPreference.java


注:本文中的org.chromium.components.sync.ProtocolErrorClientAction類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。