use of org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator in project AndroidChromium by JackyAndroid.
the class ProcessInitializationHandler method handlePreNativeInitialization.
/**
* Performs the shared class initialization.
*/
protected void handlePreNativeInitialization() {
ChromeApplication application = (ChromeApplication) ContextUtils.getApplicationContext();
UiUtils.setKeyboardShowingDelegate(new UiUtils.KeyboardShowingDelegate() {
@Override
public boolean disableKeyboardCheck(Context context, View view) {
Activity activity = null;
if (context instanceof Activity) {
activity = (Activity) context;
} else if (view != null && view.getContext() instanceof Activity) {
activity = (Activity) view.getContext();
}
// For multiwindow mode we do not track keyboard visibility.
return activity != null && MultiWindowUtils.getInstance().isLegacyMultiWindow(activity);
}
});
// Initialize the AccountManagerHelper with the correct AccountManagerDelegate. Must be done
// only once and before AccountMangerHelper.get(...) is called to avoid using the
// default AccountManagerDelegate.
AccountManagerHelper.initializeAccountManagerHelper(application, application.createAccountManagerDelegate());
// Set the unique identification generator for invalidations. The
// invalidations system can start and attempt to fetch the client ID
// very early. We need this generator to be ready before that happens.
UniqueIdInvalidationClientNameGenerator.doInitializeAndInstallGenerator(application);
// Set minimum Tango log level. This sets an in-memory static field, and needs to be
// set in the ApplicationContext instead of an activity, since Tango can be woken up
// by the system directly though messages from GCM.
AndroidLogger.setMinimumAndroidLogLevel(Log.WARN);
// Set up the identification generator for sync. The ID is actually generated
// in the SyncController constructor.
UniqueIdentificationGeneratorFactory.registerGenerator(SyncController.GENERATOR_ID, new UuidBasedUniqueIdentificationGenerator(application, SESSIONS_UUID_PREF_KEY), false);
}
use of org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator 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