当前位置: 首页>>代码示例>>Java>>正文


Java ProfileSyncService.hasUnrecoverableError方法代码示例

本文整理汇总了Java中org.chromium.chrome.browser.sync.ProfileSyncService.hasUnrecoverableError方法的典型用法代码示例。如果您正苦于以下问题:Java ProfileSyncService.hasUnrecoverableError方法的具体用法?Java ProfileSyncService.hasUnrecoverableError怎么用?Java ProfileSyncService.hasUnrecoverableError使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.chromium.chrome.browser.sync.ProfileSyncService的用法示例。


在下文中一共展示了ProfileSyncService.hasUnrecoverableError方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: showSyncErrorIcon

import org.chromium.chrome.browser.sync.ProfileSyncService; //导入方法依赖的package包/类
/**
 * Checks if sync error icon should be shown. Show sync error icon if sync is off because
 * of error, passphrase required or disabled in Android.
 */
static boolean showSyncErrorIcon(Context context) {
    if (!AndroidSyncSettings.isMasterSyncEnabled(context)) {
        return true;
    }

    ProfileSyncService profileSyncService = ProfileSyncService.get();
    if (profileSyncService != null) {
        if (profileSyncService.hasUnrecoverableError()) {
            return true;
        }

        if (profileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE) {
            return true;
        }

        if (profileSyncService.isSyncActive()
                && profileSyncService.isPassphraseRequiredForDecryption()) {
            return true;
        }
    }

    return false;
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:28,代码来源:SyncPreference.java

示例2: getSyncStatusSummary

import org.chromium.chrome.browser.sync.ProfileSyncService; //导入方法依赖的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.chrome.browser.sync.ProfileSyncService; //导入方法依赖的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.chrome.browser.sync.ProfileSyncService.hasUnrecoverableError方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。