Upstream version 10.39.225.0
[platform/framework/web/crosswalk.git] / src / third_party / cacheinvalidation / src / proto / android_channel.proto
1 /*
2  * Copyright 2011 Google Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 //
17 // The Android delivery service's network endpoint id descriptor.
18 // This proto is internal to the Android channel.
19
20 syntax = "proto2";
21
22 package com.google.protos.ipc.invalidation;
23
24 option optimize_for = LITE_RUNTIME;
25
26
27
28 option java_outer_classname = "NanoAndroidChannel";
29 option java_package = "com.google.protos.ipc.invalidation";
30
31
32 import "client_protocol.proto";
33
34 // Defines the valid major versions of the android channel protocol.  The
35 // channel version controls the expected envelope syntax and semantics of
36 // http and c2dm messages sent between the client and server.
37 enum MajorVersion {
38
39   // The initial version of the android channel protocol.  Inbound and
40   // outbound channel packets contained a single binary protocol message only.
41   INITIAL = 0;
42
43   // Adds batching (multiple protocol messages in a single channel message)
44   BATCH = 1;
45
46   // The default channel version used by Android clients.   Lower major numbers
47   // will represent earlier versions and higher numbers will represent
48   // experimental versions that are not yet released.
49   DEFAULT = 0;
50
51   // The minimum and maximum supported channel major versions.  Used to validate
52   // incoming requests, so update as new versions are added or old versions are
53   // no longer supported.
54   MIN_SUPPORTED = 0;
55   MAX_SUPPORTED = 1;
56 }
57
58 // An id that specifies how to route a message to a Ticl on an Android device
59 // via C2DM.
60 message AndroidEndpointId {
61   // Field 1 was once the ProtocolVersion of this message.
62
63   // The "registration_id" returned when the client registers with c2dm.  This
64   // id is required by c2dm in order to send a message to the device.
65   optional string c2dm_registration_id = 2;
66
67   // A key identifying a specific client on a device.
68   optional string client_key = 3;
69
70   // The C2DM sender ID to use to deliver messages to the endpoint.
71   optional string sender_id = 4 [deprecated = true];
72
73   // Defines the expected channel version generated by the network endpoint or
74   // expected in messages sent from the server.
75   optional Version channel_version = 5;
76
77   // The package name of the Android application that will receive the messages.
78   // Replaces sender_id. Must be set (unless sender_id is set; in which case it
79   // must not be set).
80   optional string package_name = 6;
81 }
82
83 // A message addressed to a particular Ticl on an Android device.
84 message AddressedAndroidMessage {
85   // Client on the device to which the message is destined.
86   optional string client_key = 1;
87
88   // Message contents (serialized ServerToClientMessage).
89   optional bytes message = 2;
90 }
91
92 // A batch of messages addressed to potentially-different Ticls on the same
93 // Android device.
94 message AddressedAndroidMessageBatch {
95   repeated AddressedAndroidMessage addressed_message = 1;
96 }