Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
| index 19619979984abbb788237bbc91d8c7371c26a8d8..945d11eb5b1bf08dc90c052781b9934de6c0cfb9 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/sync/ProfileSyncService.java |
| @@ -4,14 +4,15 @@ |
| package org.chromium.chrome.browser.sync; |
| +import org.json.JSONArray; |
| +import org.json.JSONException; |
| + |
| import org.chromium.base.ThreadUtils; |
| import org.chromium.base.VisibleForTesting; |
| import org.chromium.base.annotations.CalledByNative; |
| import org.chromium.base.annotations.SuppressFBWarnings; |
| import org.chromium.components.sync.ModelType; |
| import org.chromium.components.sync.PassphraseType; |
| -import org.json.JSONArray; |
| -import org.json.JSONException; |
| import java.util.HashSet; |
| import java.util.List; |
| @@ -159,15 +160,14 @@ public class ProfileSyncService { |
| } |
| /** |
| - * Returns the actual passphrase type being used for encryption. |
| - * The sync backend must be running (isBackendInitialized() returns true) before |
| - * calling this function. |
| + * Returns the actual passphrase type being used for encryption. The sync backend must be |
| + * running (isEngineInitialized() returns true) before calling this function. |
| * <p/> |
| * This method should only be used if you want to know the raw value. For checking whether |
| * we should ask the user for a passphrase, use isPassphraseRequiredForDecryption(). |
| */ |
| public PassphraseType getPassphraseType() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| int passphraseType = nativeGetPassphraseType(mNativeProfileSyncServiceAndroid); |
| return PassphraseType.fromInternalValue(passphraseType); |
| } |
| @@ -176,7 +176,7 @@ public class ProfileSyncService { |
| * Returns true if the current explicit passphrase time is defined. |
| */ |
| public boolean hasExplicitPassphraseTime() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeHasExplicitPassphraseTime(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -184,22 +184,22 @@ public class ProfileSyncService { |
| * Returns the current explicit passphrase time in milliseconds since epoch. |
| */ |
| public long getExplicitPassphraseTime() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeGetExplicitPassphraseTime(mNativeProfileSyncServiceAndroid); |
| } |
| public String getSyncEnterGooglePassphraseBodyWithDateText() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeGetSyncEnterGooglePassphraseBodyWithDateText(mNativeProfileSyncServiceAndroid); |
| } |
| public String getSyncEnterCustomPassphraseBodyWithDateText() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeGetSyncEnterCustomPassphraseBodyWithDateText(mNativeProfileSyncServiceAndroid); |
| } |
| public String getCurrentSignedInAccountText() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeGetCurrentSignedInAccountText(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -209,12 +209,12 @@ public class ProfileSyncService { |
| /** |
| * Checks if sync is currently set to use a custom passphrase. The sync backend must be running |
|
skym
2016/12/05 19:38:55
backend
maxbogue
2016/12/05 22:17:10
Done.
|
| - * (isBackendInitialized() returns true) before calling this function. |
| + * (isEngineInitialized() returns true) before calling this function. |
| * |
| * @return true if sync is using a custom passphrase. |
| */ |
| public boolean isUsingSecondaryPassphrase() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeIsUsingSecondaryPassphrase(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -230,7 +230,7 @@ public class ProfileSyncService { |
| * @return true if we need a passphrase. |
| */ |
| public boolean isPassphraseRequiredForDecryption() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeIsPassphraseRequiredForDecryption(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -239,8 +239,8 @@ public class ProfileSyncService { |
| * |
| * @return true if sync is initialized/running. |
| */ |
| - public boolean isBackendInitialized() { |
| - return nativeIsBackendInitialized(mNativeProfileSyncServiceAndroid); |
| + public boolean isEngineInitialized() { |
| + return nativeIsEngineInitialized(mNativeProfileSyncServiceAndroid); |
| } |
| /** |
| @@ -250,7 +250,7 @@ public class ProfileSyncService { |
| * be encrypted. |
| */ |
| public boolean isEncryptEverythingAllowed() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeIsEncryptEverythingAllowed(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -260,7 +260,7 @@ public class ProfileSyncService { |
| * @return true if all data types are encrypted, false if only passwords are encrypted. |
| */ |
| public boolean isEncryptEverythingEnabled() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeIsEncryptEverythingEnabled(mNativeProfileSyncServiceAndroid); |
| } |
| @@ -269,22 +269,22 @@ public class ProfileSyncService { |
| * completed and setPreferredDataTypes() is invoked. |
| */ |
| public void enableEncryptEverything() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| nativeEnableEncryptEverything(mNativeProfileSyncServiceAndroid); |
| } |
| public void setEncryptionPassphrase(String passphrase) { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| nativeSetEncryptionPassphrase(mNativeProfileSyncServiceAndroid, passphrase); |
| } |
| public boolean isCryptographerReady() { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeIsCryptographerReady(mNativeProfileSyncServiceAndroid); |
| } |
| public boolean setDecryptionPassphrase(String passphrase) { |
| - assert isBackendInitialized(); |
| + assert isEngineInitialized(); |
| return nativeSetDecryptionPassphrase(mNativeProfileSyncServiceAndroid, passphrase); |
| } |
| @@ -547,7 +547,7 @@ public class ProfileSyncService { |
| private native String nativeQuerySyncStatusSummary(long nativeProfileSyncServiceAndroid); |
| private native int nativeGetAuthError(long nativeProfileSyncServiceAndroid); |
| private native int nativeGetProtocolErrorClientAction(long nativeProfileSyncServiceAndroid); |
| - private native boolean nativeIsBackendInitialized(long nativeProfileSyncServiceAndroid); |
| + private native boolean nativeIsEngineInitialized(long nativeProfileSyncServiceAndroid); |
| private native boolean nativeIsEncryptEverythingAllowed(long nativeProfileSyncServiceAndroid); |
| private native boolean nativeIsEncryptEverythingEnabled(long nativeProfileSyncServiceAndroid); |
| private native void nativeEnableEncryptEverything(long nativeProfileSyncServiceAndroid); |