Search in sources :

Example 1 with UniqueIdentificationGenerator

use of org.chromium.chrome.browser.identity.UniqueIdentificationGenerator in project AndroidChromium by JackyAndroid.

the class SyncController method setSessionsId.

/**
     * Set the sessions ID using the generator that was registered for GENERATOR_ID.
     */
private void setSessionsId() {
    UniqueIdentificationGenerator generator = UniqueIdentificationGeneratorFactory.getInstance(GENERATOR_ID);
    String uniqueTag = generator.getUniqueId(null);
    if (uniqueTag.isEmpty()) {
        Log.e(TAG, "Unable to get unique tag for sync. " + "This may lead to unexpected tab sync behavior.");
        return;
    }
    mProfileSyncService.setSessionsId(SESSION_TAG_PREFIX + uniqueTag);
}
Also used : UniqueIdentificationGenerator(org.chromium.chrome.browser.identity.UniqueIdentificationGenerator)

Example 2 with UniqueIdentificationGenerator

use of org.chromium.chrome.browser.identity.UniqueIdentificationGenerator in project AndroidChromium by JackyAndroid.

the class UniqueIdInvalidationClientNameGenerator method doInitializeAndInstallGenerator.

/**
     * Called during early init to make this InvalidationClientNameGenerator the default.
     *
     * This should be called very early during initialization to setup the invalidaiton client name.
     */
public static void doInitializeAndInstallGenerator(Context context) {
    UniqueIdentificationGenerator idGenerator = new UuidBasedUniqueIdentificationGenerator(context, INVALIDATIONS_UUID_PREF_KEY);
    InvalidationClientNameGenerator clientNameGenerator = new UniqueIdInvalidationClientNameGenerator(idGenerator);
    InvalidationClientNameProvider.get().setPreferredClientNameGenerator(clientNameGenerator);
}
Also used : InvalidationClientNameGenerator(org.chromium.components.sync.notifier.InvalidationClientNameGenerator) UuidBasedUniqueIdentificationGenerator(org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator) UuidBasedUniqueIdentificationGenerator(org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator) UniqueIdentificationGenerator(org.chromium.chrome.browser.identity.UniqueIdentificationGenerator)

Aggregations

UniqueIdentificationGenerator (org.chromium.chrome.browser.identity.UniqueIdentificationGenerator)2 UuidBasedUniqueIdentificationGenerator (org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator)1 InvalidationClientNameGenerator (org.chromium.components.sync.notifier.InvalidationClientNameGenerator)1