org.chromium.chrome.browser.identity.UniqueIdentificationGenerator Java Examples

The following examples show how to use org.chromium.chrome.browser.identity.UniqueIdentificationGenerator. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SyncController.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #2
Source File: UniqueIdInvalidationClientNameGenerator.java    From delion with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #3
Source File: SyncController.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #4
Source File: UniqueIdInvalidationClientNameGenerator.java    From AndroidChromium with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #5
Source File: SyncController.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #6
Source File: UniqueIdInvalidationClientNameGenerator.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * 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);
}
 
Example #7
Source File: ProfileSyncService.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Sets the the machine tag used by session sync to a unique value.
 */
public void setSessionsId(UniqueIdentificationGenerator generator) {
    ThreadUtils.assertOnUiThread();
    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;
    }
    String sessionTag = SESSION_TAG_PREFIX + uniqueTag;
    if (!nativeSetSyncSessionsId(mNativeProfileSyncServiceAndroid, sessionTag)) {
        Log.e(TAG, "Unable to write session sync tag. " +
                "This may lead to unexpected tab sync behavior.");
    }
}
 
Example #8
Source File: ProfileSyncService.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Sets the the machine tag used by session sync to a unique value.
 */
public void setSessionsId(UniqueIdentificationGenerator generator) {
    ThreadUtils.assertOnUiThread();
    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;
    }
    String sessionTag = SESSION_TAG_PREFIX + uniqueTag;
    if (!nativeSetSyncSessionsId(mNativeProfileSyncServiceAndroid, sessionTag)) {
        Log.e(TAG, "Unable to write session sync tag. " +
                "This may lead to unexpected tab sync behavior.");
    }
}
 
Example #9
Source File: UniqueIdInvalidationClientNameGenerator.java    From delion with Apache License 2.0 4 votes vote down vote up
UniqueIdInvalidationClientNameGenerator(UniqueIdentificationGenerator generator) {
    mGenerator = generator;
}
 
Example #10
Source File: UniqueIdInvalidationClientNameGenerator.java    From AndroidChromium with Apache License 2.0 4 votes vote down vote up
UniqueIdInvalidationClientNameGenerator(UniqueIdentificationGenerator generator) {
    mGenerator = generator;
}
 
Example #11
Source File: UniqueIdInvalidationClientNameGenerator.java    From 365browser with Apache License 2.0 4 votes vote down vote up
UniqueIdInvalidationClientNameGenerator(UniqueIdentificationGenerator generator) {
    mGenerator = generator;
}