本文整理汇总了Java中org.chromium.chrome.browser.sync.ProfileSyncService.isPassphraseRequiredForDecryption方法的典型用法代码示例。如果您正苦于以下问题:Java ProfileSyncService.isPassphraseRequiredForDecryption方法的具体用法?Java ProfileSyncService.isPassphraseRequiredForDecryption怎么用?Java ProfileSyncService.isPassphraseRequiredForDecryption使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.chromium.chrome.browser.sync.ProfileSyncService
的用法示例。
在下文中一共展示了ProfileSyncService.isPassphraseRequiredForDecryption方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例2: getSyncStatusSummary
import org.chromium.chrome.browser.sync.ProfileSyncService; //导入方法依赖的package包/类
private static String getSyncStatusSummary(Activity activity) {
if (!ChromeSigninController.get(activity).isSignedIn()) return "";
ProfileSyncService profileSyncService = ProfileSyncService.get();
Resources res = activity.getResources();
if (ChildAccountService.getInstance(activity).hasChildAccount()) {
return res.getString(R.string.kids_account);
}
if (!AndroidSyncSettings.isMasterSyncEnabled(activity)) {
return res.getString(R.string.sync_android_master_sync_disabled);
}
if (profileSyncService.getAuthError() != GoogleServiceAuthError.State.NONE) {
return res.getString(profileSyncService.getAuthError().getMessage());
}
if (AndroidSyncSettings.isSyncEnabled(activity)) {
if (!profileSyncService.isSyncInitialized()) {
return res.getString(R.string.sync_setup_progress);
}
if (profileSyncService.isPassphraseRequiredForDecryption()) {
return res.getString(R.string.sync_need_passphrase);
}
}
return AndroidSyncSettings.isSyncEnabled(activity)
? res.getString(R.string.sync_is_enabled)
: res.getString(R.string.sync_is_disabled);
}
示例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(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);
}
示例4: 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);
}