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);
}
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);
}
Aggregations