com.google.protos.ipc.invalidation.Types.ClientType Java Examples

The following examples show how to use com.google.protos.ipc.invalidation.Types.ClientType. 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: AndroidClientFactory.java    From android-chromium with BSD 2-Clause "Simplified" License 3 votes vote down vote up
/**
 * Creates a new client.
 * <p>
 * REQUIRES: no client exist, or a client exists with the same type and name as provided. In
 * the latter case, this call is a no-op.
 *
 * @param context Android system context
 * @param clientType type of the client to create
 * @param clientName name of the client to create
 */
public static void createClient(Context context, ClientType.Type clientType, byte[] clientName) {
  ClientConfigP config = InvalidationClientCore.createConfig().build();
  Intent intent = ProtocolIntents.InternalDowncalls.newCreateClientIntent(
      clientType.getNumber(), clientName, config, false);
  intent.setClassName(context, new AndroidTiclManifest(context).getTiclServiceClass());
  context.startService(intent);
}
 
Example #2
Source File: AndroidClientFactory.java    From android-chromium with BSD 2-Clause "Simplified" License 3 votes vote down vote up
/**
 * Creates a new client.
 * <p>
 * REQUIRES: no client exist, or a client exists with the same type and name as provided. In
 * the latter case, this call is a no-op.
 *
 * @param context Android system context
 * @param clientType type of the client to create
 * @param clientName name of the client to create
 */
public static void createClient(Context context, ClientType.Type clientType, byte[] clientName) {
  ClientConfigP config = InvalidationClientCore.createConfig().build();
  Intent intent = ProtocolIntents.InternalDowncalls.newCreateClientIntent(
      clientType.getNumber(), clientName, config, false);
  intent.setClassName(context, new AndroidTiclManifest(context).getTiclServiceClass());
  context.startService(intent);
}