本文整理汇总了Java中org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator类的典型用法代码示例。如果您正苦于以下问题:Java UuidBasedUniqueIdentificationGenerator类的具体用法?Java UuidBasedUniqueIdentificationGenerator怎么用?Java UuidBasedUniqueIdentificationGenerator使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
UuidBasedUniqueIdentificationGenerator类属于org.chromium.chrome.browser.identity包,在下文中一共展示了UuidBasedUniqueIdentificationGenerator类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doInitializeAndInstallGenerator
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; //导入依赖的package包/类
/**
* 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);
}
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:13,代码来源:UniqueIdInvalidationClientNameGenerator.java
示例2: onCreate
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; //导入依赖的package包/类
/**
* This is called once per ChromeApplication instance, which get created per process
* (browser OR renderer). Don't stick anything in here that shouldn't be called multiple times
* during Chrome's lifetime.
*/
@Override
public void onCreate() {
UmaUtils.recordMainEntryPointTime();
super.onCreate();
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().isMultiWindow(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(this, 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(this);
// 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(this, SESSIONS_UUID_PREF_KEY), false);
}
示例3: setupSessionSyncId
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; //导入依赖的package包/类
private void setupSessionSyncId() {
// Ensure that sync uses the correct UniqueIdentificationGenerator, but do not force the
// registration, in case a test case has already overridden it.
UuidBasedUniqueIdentificationGenerator generator =
new UuidBasedUniqueIdentificationGenerator(mContext, SESSIONS_UUID_PREF_KEY);
UniqueIdentificationGeneratorFactory.registerGenerator(
UuidBasedUniqueIdentificationGenerator.GENERATOR_ID, generator, false);
// Since we do not override the UniqueIdentificationGenerator, we get it from the factory,
// instead of using the instance we just created.
mProfileSyncService.setSessionsId(UniqueIdentificationGeneratorFactory
.getInstance(UuidBasedUniqueIdentificationGenerator.GENERATOR_ID));
}
示例4: handlePreNativeInitialization
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; //导入依赖的package包/类
/**
* 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);
}
示例5: handlePreNativeInitialization
import org.chromium.chrome.browser.identity.UuidBasedUniqueIdentificationGenerator; //导入依赖的package包/类
/**
* 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(
AppHooks.get().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);
// Indicate that we can use the GMS location provider.
LocationProviderFactory.useGmsCoreLocationProvider();
}