blob: e4a92f595773b32a0025880968e81e7eae5e2b38 [file] [log] [blame]
/*
* Copyright 2011 Google Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
//
// The Android delivery service's network endpoint id descriptor.
// This proto is internal to the Android channel.
syntax = "proto2";
package com.google.protos.ipc.invalidation;
option optimize_for = LITE_RUNTIME;
option java_outer_classname = "NanoAndroidChannel";
option java_package = "com.google.protos.ipc.invalidation";
import "client_protocol.proto";
// Defines the valid major versions of the android channel protocol. The
// channel version controls the expected envelope syntax and semantics of
// http and c2dm messages sent between the client and server.
enum MajorVersion {
// The initial version of the android channel protocol. Inbound and
// outbound channel packets contained a single binary protocol message only.
INITIAL = 0;
// Adds batching (multiple protocol messages in a single channel message)
BATCH = 1;
// The default channel version used by Android clients. Lower major numbers
// will represent earlier versions and higher numbers will represent
// experimental versions that are not yet released.
DEFAULT = 0;
// The minimum and maximum supported channel major versions. Used to validate
// incoming requests, so update as new versions are added or old versions are
// no longer supported.
MIN_SUPPORTED = 0;
MAX_SUPPORTED = 1;
}
// An id that specifies how to route a message to a Ticl on an Android device
// via C2DM.
message AndroidEndpointId {
// Field 1 was once the ProtocolVersion of this message.
// The "registration_id" returned when the client registers with c2dm. This
// id is required by c2dm in order to send a message to the device.
optional string c2dm_registration_id = 2;
// A key identifying a specific client on a device.
optional string client_key = 3;
// The C2DM sender ID to use to deliver messages to the endpoint.
optional string sender_id = 4 [deprecated = true];
// Defines the expected channel version generated by the network endpoint or
// expected in messages sent from the server.
optional Version channel_version = 5;
// The package name of the Android application that will receive the messages.
// Replaces sender_id. Must be set (unless sender_id is set; in which case it
// must not be set).
optional string package_name = 6;
}
// A message addressed to a particular Ticl on an Android device.
message AddressedAndroidMessage {
// Client on the device to which the message is destined.
optional string client_key = 1;
// Message contents (serialized ServerToClientMessage).
optional bytes message = 2;
}
// A batch of messages addressed to potentially-different Ticls on the same
// Android device.
message AddressedAndroidMessageBatch {
repeated AddressedAndroidMessage addressed_message = 1;
}