Java Code Examples for com.google.ipc.invalidation.external.client.SystemResources.Logger#info()

The following examples show how to use com.google.ipc.invalidation.external.client.SystemResources.Logger#info() . 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: AndroidMessageReceiverService.java    From 365browser with Apache License 2.0 5 votes vote down vote up
/**
 * Initializes GCM as a convenience method for tests. In production, applications should handle
 * this.
 */
public static void initializeGcmForTest(Context context, Logger logger, String senderId) {
  // Initialize GCM.
  GCMRegistrar.checkDevice(context);
  GCMRegistrar.checkManifest(context);
  String regId = GCMRegistrar.getRegistrationId(context);
  if (regId.isEmpty()) {
    logger.info("Not registered with GCM; registering");
    GCMRegistrar.register(context, senderId);
  } else {
    logger.fine("Already registered with GCM: %s", regId);
  }
}
 
Example 2
Source File: AndroidMessageReceiverService.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Initializes GCM as a convenience method for tests. In production, applications should handle
 * this.
 */
public static void initializeGcmForTest(Context context, Logger logger, String senderId) {
  // Initialize GCM.
  GCMRegistrar.checkDevice(context);
  GCMRegistrar.checkManifest(context);
  String regId = GCMRegistrar.getRegistrationId(context);
  if (regId.equals("")) {
    logger.info("Not registered with GCM; registering");
    GCMRegistrar.register(context, senderId);
  } else {
    logger.fine("Already registered with GCM: %s", regId);
  }
}
 
Example 3
Source File: AndroidMessageReceiverService.java    From android-chromium with BSD 2-Clause "Simplified" License 5 votes vote down vote up
/**
 * Initializes GCM as a convenience method for tests. In production, applications should handle
 * this.
 */
public static void initializeGcmForTest(Context context, Logger logger, String senderId) {
  // Initialize GCM.
  GCMRegistrar.checkDevice(context);
  GCMRegistrar.checkManifest(context);
  String regId = GCMRegistrar.getRegistrationId(context);
  if (regId.equals("")) {
    logger.info("Not registered with GCM; registering");
    GCMRegistrar.register(context, senderId);
  } else {
    logger.fine("Already registered with GCM: %s", regId);
  }
}