1*6fa6b5e2SAndroid Build Coastguard Worker// Copyright 2022 Google LLC 2*6fa6b5e2SAndroid Build Coastguard Worker// 3*6fa6b5e2SAndroid Build Coastguard Worker// Licensed under the Apache License, Version 2.0 (the "License"); 4*6fa6b5e2SAndroid Build Coastguard Worker// you may not use this file except in compliance with the License. 5*6fa6b5e2SAndroid Build Coastguard Worker// You may obtain a copy of the License at 6*6fa6b5e2SAndroid Build Coastguard Worker// 7*6fa6b5e2SAndroid Build Coastguard Worker// http://www.apache.org/licenses/LICENSE-2.0 8*6fa6b5e2SAndroid Build Coastguard Worker// 9*6fa6b5e2SAndroid Build Coastguard Worker// Unless required by applicable law or agreed to in writing, software 10*6fa6b5e2SAndroid Build Coastguard Worker// distributed under the License is distributed on an "AS IS" BASIS, 11*6fa6b5e2SAndroid Build Coastguard Worker// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12*6fa6b5e2SAndroid Build Coastguard Worker// See the License for the specific language governing permissions and 13*6fa6b5e2SAndroid Build Coastguard Worker// limitations under the License. 14*6fa6b5e2SAndroid Build Coastguard Workersyntax = "proto2"; 15*6fa6b5e2SAndroid Build Coastguard Worker 16*6fa6b5e2SAndroid Build Coastguard Workerpackage mdi.download; 17*6fa6b5e2SAndroid Build Coastguard Worker 18*6fa6b5e2SAndroid Build Coastguard Workerimport "google/protobuf/any.proto"; 19*6fa6b5e2SAndroid Build Coastguard Workerimport "transform.proto"; 20*6fa6b5e2SAndroid Build Coastguard Worker 21*6fa6b5e2SAndroid Build Coastguard Workeroption java_package = "com.google.mobiledatadownload"; 22*6fa6b5e2SAndroid Build Coastguard Workeroption java_outer_classname = "DownloadConfigProto"; 23*6fa6b5e2SAndroid Build Coastguard Workeroption objc_class_prefix = "Icing"; 24*6fa6b5e2SAndroid Build Coastguard Worker 25*6fa6b5e2SAndroid Build Coastguard Worker// The top-level proto for Mobile Data Download (<internal>). 26*6fa6b5e2SAndroid Build Coastguard Workermessage DownloadConfig { 27*6fa6b5e2SAndroid Build Coastguard Worker repeated DataFileGroup data_file_group = 1; 28*6fa6b5e2SAndroid Build Coastguard Worker 29*6fa6b5e2SAndroid Build Coastguard Worker reserved 2; 30*6fa6b5e2SAndroid Build Coastguard Worker} 31*6fa6b5e2SAndroid Build Coastguard Worker 32*6fa6b5e2SAndroid Build Coastguard Worker// HTTP headers are described in https://tools.ietf.org/html/rfc7230#section-3.2 33*6fa6b5e2SAndroid Build Coastguard Worker// as key:value, where the value may have a whitespace on each end. 34*6fa6b5e2SAndroid Build Coastguard Workermessage ExtraHttpHeader { 35*6fa6b5e2SAndroid Build Coastguard Worker optional string key = 1; 36*6fa6b5e2SAndroid Build Coastguard Worker optional string value = 2; 37*6fa6b5e2SAndroid Build Coastguard Worker} 38*6fa6b5e2SAndroid Build Coastguard Worker 39*6fa6b5e2SAndroid Build Coastguard Worker// A FileGroup is a set of files that should be atomically updated. 40*6fa6b5e2SAndroid Build Coastguard Worker// Next id: 29 41*6fa6b5e2SAndroid Build Coastguard Workermessage DataFileGroup { 42*6fa6b5e2SAndroid Build Coastguard Worker // Unique name to identify the group. It should be unique per owner package. 43*6fa6b5e2SAndroid Build Coastguard Worker // In GMSCore, use the module name as the prefix of the group name. 44*6fa6b5e2SAndroid Build Coastguard Worker // 45*6fa6b5e2SAndroid Build Coastguard Worker // Ex: A group name in mdisync module could be named: mdisync-profile-photos. 46*6fa6b5e2SAndroid Build Coastguard Worker // 47*6fa6b5e2SAndroid Build Coastguard Worker // This shouldn't ideally be something like "config", and 48*6fa6b5e2SAndroid Build Coastguard Worker // instead should better define the feature it will be used for. 49*6fa6b5e2SAndroid Build Coastguard Worker // 50*6fa6b5e2SAndroid Build Coastguard Worker // Ex: "icing-language-detection-model", "smart-action-detection-model" 51*6fa6b5e2SAndroid Build Coastguard Worker // 52*6fa6b5e2SAndroid Build Coastguard Worker // IMPORTANT: this group name will be logged to clearcut, and must never 53*6fa6b5e2SAndroid Build Coastguard Worker // contain PII. 54*6fa6b5e2SAndroid Build Coastguard Worker optional string group_name = 1; 55*6fa6b5e2SAndroid Build Coastguard Worker 56*6fa6b5e2SAndroid Build Coastguard Worker // The name of the package that owns this group. If this field is left empty, 57*6fa6b5e2SAndroid Build Coastguard Worker // the owner is assumed to be the package name of the host app. 58*6fa6b5e2SAndroid Build Coastguard Worker // 59*6fa6b5e2SAndroid Build Coastguard Worker // The files will only be downloaded onto the device if the owner package is 60*6fa6b5e2SAndroid Build Coastguard Worker // present on the device. 61*6fa6b5e2SAndroid Build Coastguard Worker // 62*6fa6b5e2SAndroid Build Coastguard Worker // Ex: "com.google.android.gms", "com.google.android.apps.bugle" 63*6fa6b5e2SAndroid Build Coastguard Worker optional string owner_package = 6; 64*6fa6b5e2SAndroid Build Coastguard Worker 65*6fa6b5e2SAndroid Build Coastguard Worker // Client set version number used to identify the file group. 66*6fa6b5e2SAndroid Build Coastguard Worker // 67*6fa6b5e2SAndroid Build Coastguard Worker // Note that this does not uniquely identify the contents of the file group. 68*6fa6b5e2SAndroid Build Coastguard Worker // It simply reflects a snapshot of client config changes. 69*6fa6b5e2SAndroid Build Coastguard Worker // For example: say there's a file group 'language-detector-model' that 70*6fa6b5e2SAndroid Build Coastguard Worker // downloads a different file per user locale. 71*6fa6b5e2SAndroid Build Coastguard Worker // data_file_group { 72*6fa6b5e2SAndroid Build Coastguard Worker // file_group_name = 'language-detector-model' 73*6fa6b5e2SAndroid Build Coastguard Worker // file_group_version_number = 1 74*6fa6b5e2SAndroid Build Coastguard Worker // file { 75*6fa6b5e2SAndroid Build Coastguard Worker // url = 'en-model' 76*6fa6b5e2SAndroid Build Coastguard Worker // } 77*6fa6b5e2SAndroid Build Coastguard Worker // } 78*6fa6b5e2SAndroid Build Coastguard Worker // data_file_group { 79*6fa6b5e2SAndroid Build Coastguard Worker // file_group_name = 'language-detector-model' 80*6fa6b5e2SAndroid Build Coastguard Worker // file_group_version_number = 1 81*6fa6b5e2SAndroid Build Coastguard Worker // file { 82*6fa6b5e2SAndroid Build Coastguard Worker // url = 'es-model' 83*6fa6b5e2SAndroid Build Coastguard Worker // } 84*6fa6b5e2SAndroid Build Coastguard Worker // } 85*6fa6b5e2SAndroid Build Coastguard Worker // Note that even though the actual contents of the file group are different 86*6fa6b5e2SAndroid Build Coastguard Worker // for each locale, the version is the same because this config was pushed 87*6fa6b5e2SAndroid Build Coastguard Worker // at the same snapshot. 88*6fa6b5e2SAndroid Build Coastguard Worker // 89*6fa6b5e2SAndroid Build Coastguard Worker // Available GMS v18+. 90*6fa6b5e2SAndroid Build Coastguard Worker optional int32 file_group_version_number = 10; 91*6fa6b5e2SAndroid Build Coastguard Worker 92*6fa6b5e2SAndroid Build Coastguard Worker reserved 20; 93*6fa6b5e2SAndroid Build Coastguard Worker 94*6fa6b5e2SAndroid Build Coastguard Worker // Custom metadata attached to the file group. 95*6fa6b5e2SAndroid Build Coastguard Worker // 96*6fa6b5e2SAndroid Build Coastguard Worker // This allows clients to include specific metadata about the group for their 97*6fa6b5e2SAndroid Build Coastguard Worker // own processing purposes. The metadata will be stored with the group and 98*6fa6b5e2SAndroid Build Coastguard Worker // accessible when the file group is retrieved. 99*6fa6b5e2SAndroid Build Coastguard Worker // 100*6fa6b5e2SAndroid Build Coastguard Worker // This property should only be used if absolutely necessary. Please consult 101*6fa6b5e2SAndroid Build Coastguard Worker // with <internal>@ if you have questions about this property or a potential 102*6fa6b5e2SAndroid Build Coastguard Worker // use-case. 103*6fa6b5e2SAndroid Build Coastguard Worker // 104*6fa6b5e2SAndroid Build Coastguard Worker // Available for aMDD Lib only. 105*6fa6b5e2SAndroid Build Coastguard Worker optional google.protobuf.Any custom_metadata = 27; 106*6fa6b5e2SAndroid Build Coastguard Worker 107*6fa6b5e2SAndroid Build Coastguard Worker reserved 22; 108*6fa6b5e2SAndroid Build Coastguard Worker 109*6fa6b5e2SAndroid Build Coastguard Worker reserved 21; 110*6fa6b5e2SAndroid Build Coastguard Worker 111*6fa6b5e2SAndroid Build Coastguard Worker enum AllowedReaders { 112*6fa6b5e2SAndroid Build Coastguard Worker ALL_GOOGLE_APPS = 0; 113*6fa6b5e2SAndroid Build Coastguard Worker ONLY_GOOGLE_PLAY_SERVICES = 1; 114*6fa6b5e2SAndroid Build Coastguard Worker ALL_APPS = 2; 115*6fa6b5e2SAndroid Build Coastguard Worker } 116*6fa6b5e2SAndroid Build Coastguard Worker 117*6fa6b5e2SAndroid Build Coastguard Worker // Defines who is allowed to read this file group. Currently the options are: 118*6fa6b5e2SAndroid Build Coastguard Worker // 119*6fa6b5e2SAndroid Build Coastguard Worker // ALL_GOOGLE_APPS: accessible to all Google 1p Apps. 120*6fa6b5e2SAndroid Build Coastguard Worker // ONLY_GOOGLE_PLAY_SERVICES: accessible to only GMS Core. 121*6fa6b5e2SAndroid Build Coastguard Worker // 122*6fa6b5e2SAndroid Build Coastguard Worker // If this field is not explicitly set it defaults to "ALL_GOOGLE_APPS". 123*6fa6b5e2SAndroid Build Coastguard Worker // 124*6fa6b5e2SAndroid Build Coastguard Worker // Available GMS v20+. 125*6fa6b5e2SAndroid Build Coastguard Worker optional AllowedReaders allowed_readers_enum = 12; 126*6fa6b5e2SAndroid Build Coastguard Worker 127*6fa6b5e2SAndroid Build Coastguard Worker // Length of time (in seconds) for which a file group version will live after 128*6fa6b5e2SAndroid Build Coastguard Worker // a newer version became fully downloaded. Clients should set this time 129*6fa6b5e2SAndroid Build Coastguard Worker // to be more than the time in which they call MDD to refresh their data. 130*6fa6b5e2SAndroid Build Coastguard Worker // NOTE: MDD will delete the file group version within a day of this time. 131*6fa6b5e2SAndroid Build Coastguard Worker // Ex: 172800 // 2 Days 132*6fa6b5e2SAndroid Build Coastguard Worker optional int64 stale_lifetime_secs = 3; 133*6fa6b5e2SAndroid Build Coastguard Worker 134*6fa6b5e2SAndroid Build Coastguard Worker // The timestamp at which this filegroup should be deleted specified in 135*6fa6b5e2SAndroid Build Coastguard Worker // seconds since epoch. This is a hard deadline and can be applied to file 136*6fa6b5e2SAndroid Build Coastguard Worker // groups still in the ACTIVE state. If the value is 0, that is the same as 137*6fa6b5e2SAndroid Build Coastguard Worker // unset (no expiration). Expiration is performed at next cleanup time, which 138*6fa6b5e2SAndroid Build Coastguard Worker // is typically daily. Therefore, file groups may remain even after expired, 139*6fa6b5e2SAndroid Build Coastguard Worker // and may do so indefinitely if cleanup is not scheduled. 140*6fa6b5e2SAndroid Build Coastguard Worker // 141*6fa6b5e2SAndroid Build Coastguard Worker // NOTE this is not the way to delete a file group. For example, setting an 142*6fa6b5e2SAndroid Build Coastguard Worker // expiration date in the past will fail, potentially leaving an unexpired 143*6fa6b5e2SAndroid Build Coastguard Worker // file group in place indefinitely. Use the MDD removeFileGroup API for that 144*6fa6b5e2SAndroid Build Coastguard Worker // on device. From the server, the way to delete a file group is to add a new 145*6fa6b5e2SAndroid Build Coastguard Worker // one with the same name, but with no files (this functions as a tombstone). 146*6fa6b5e2SAndroid Build Coastguard Worker // 147*6fa6b5e2SAndroid Build Coastguard Worker // NOTE b/252890898 for behavior on CastOS (cMDD) 148*6fa6b5e2SAndroid Build Coastguard Worker // NOTE b/252885626 for missing support for delete in MobServe Ingress 149*6fa6b5e2SAndroid Build Coastguard Worker optional int64 expiration_date = 11; 150*6fa6b5e2SAndroid Build Coastguard Worker 151*6fa6b5e2SAndroid Build Coastguard Worker // Specify the conditions under which the file group should be downloaded. 152*6fa6b5e2SAndroid Build Coastguard Worker optional DownloadConditions download_conditions = 13; 153*6fa6b5e2SAndroid Build Coastguard Worker 154*6fa6b5e2SAndroid Build Coastguard Worker // Setting this flag to true will mean that the downloaded files will appear 155*6fa6b5e2SAndroid Build Coastguard Worker // to be in a directory by themselves. 156*6fa6b5e2SAndroid Build Coastguard Worker // The file name/file path of the exposed file will be the filename set in the 157*6fa6b5e2SAndroid Build Coastguard Worker // file.relative_file_path field, OR if that field is empty, the file name 158*6fa6b5e2SAndroid Build Coastguard Worker // from the file.url_to_download field. This enables downloaded files to refer 159*6fa6b5e2SAndroid Build Coastguard Worker // to each other by name. 160*6fa6b5e2SAndroid Build Coastguard Worker // It's invalid to set this flag to true if two files end up with the same 161*6fa6b5e2SAndroid Build Coastguard Worker // file path. 162*6fa6b5e2SAndroid Build Coastguard Worker // Valid on iOS, cMDD, and aMDD. 163*6fa6b5e2SAndroid Build Coastguard Worker // 164*6fa6b5e2SAndroid Build Coastguard Worker // NOTE: For aMDD, this feature is not available if Android Blob Sharing is 165*6fa6b5e2SAndroid Build Coastguard Worker // enabled or if using an API level below 21 (L). If either case is true, this 166*6fa6b5e2SAndroid Build Coastguard Worker // option will be ignored. 167*6fa6b5e2SAndroid Build Coastguard Worker optional bool preserve_filenames_and_isolate_files = 14; 168*6fa6b5e2SAndroid Build Coastguard Worker 169*6fa6b5e2SAndroid Build Coastguard Worker // List of files in the group. 170*6fa6b5e2SAndroid Build Coastguard Worker repeated DataFile file = 2; 171*6fa6b5e2SAndroid Build Coastguard Worker 172*6fa6b5e2SAndroid Build Coastguard Worker // Tag for the network traffic to download this file group. 173*6fa6b5e2SAndroid Build Coastguard Worker // Tag space is determined by the host app. 174*6fa6b5e2SAndroid Build Coastguard Worker // For Gmscore, the tag should come from: 175*6fa6b5e2SAndroid Build Coastguard Worker // <internal> 176*6fa6b5e2SAndroid Build Coastguard Worker optional int32 traffic_tag = 16; 177*6fa6b5e2SAndroid Build Coastguard Worker 178*6fa6b5e2SAndroid Build Coastguard Worker // Extra HTTP headers to apply when downloading all files in the group. 179*6fa6b5e2SAndroid Build Coastguard Worker repeated ExtraHttpHeader group_extra_http_headers = 17; 180*6fa6b5e2SAndroid Build Coastguard Worker 181*6fa6b5e2SAndroid Build Coastguard Worker reserved 19; 182*6fa6b5e2SAndroid Build Coastguard Worker 183*6fa6b5e2SAndroid Build Coastguard Worker // Unique identifier of a DataFileGroup config (i.e. a "snapshot") created 184*6fa6b5e2SAndroid Build Coastguard Worker // when using MDD Ingress API. 185*6fa6b5e2SAndroid Build Coastguard Worker optional int64 build_id = 23; 186*6fa6b5e2SAndroid Build Coastguard Worker 187*6fa6b5e2SAndroid Build Coastguard Worker // A fingerprint allowing clients to identify a DataFileGroup 188*6fa6b5e2SAndroid Build Coastguard Worker // config based on a given set of properties (i.e. a "partition" of 189*6fa6b5e2SAndroid Build Coastguard Worker // any file group properties). This can be used by clients as an exact match 190*6fa6b5e2SAndroid Build Coastguard Worker // for a class of DataFileGroups during targeting or as a compatibility check. 191*6fa6b5e2SAndroid Build Coastguard Worker optional string variant_id = 26; 192*6fa6b5e2SAndroid Build Coastguard Worker 193*6fa6b5e2SAndroid Build Coastguard Worker // The locales compatible with the file group. This can be different from the 194*6fa6b5e2SAndroid Build Coastguard Worker // device locale. 195*6fa6b5e2SAndroid Build Coastguard Worker // 196*6fa6b5e2SAndroid Build Coastguard Worker // Values in this list may be exact locales (e.g. "en-US") or language-only 197*6fa6b5e2SAndroid Build Coastguard Worker // ("en-*"). 198*6fa6b5e2SAndroid Build Coastguard Worker // Example 1: locale = ["en-US"]; // compatible with "en-US" only 199*6fa6b5e2SAndroid Build Coastguard Worker // Example 2: locale = ["en-US", "en-CA"]; // compatible with "en-US" or 200*6fa6b5e2SAndroid Build Coastguard Worker // // "en-CA" 201*6fa6b5e2SAndroid Build Coastguard Worker // Example 3: locale = ["en-*"]; // compatible with all "en" locales 202*6fa6b5e2SAndroid Build Coastguard Worker repeated string locale = 25; 203*6fa6b5e2SAndroid Build Coastguard Worker 204*6fa6b5e2SAndroid Build Coastguard Worker reserved 28; 205*6fa6b5e2SAndroid Build Coastguard Worker 206*6fa6b5e2SAndroid Build Coastguard Worker reserved 4, 5, 7, 8, 9, 15, 18, 24, 248813966 /*aMDD extension*/, 207*6fa6b5e2SAndroid Build Coastguard Worker 248606552 /*cMDD extension*/; 208*6fa6b5e2SAndroid Build Coastguard Worker} 209*6fa6b5e2SAndroid Build Coastguard Worker 210*6fa6b5e2SAndroid Build Coastguard Worker// A data file represents all the metadata to download the file and then 211*6fa6b5e2SAndroid Build Coastguard Worker// manage it on the device. 212*6fa6b5e2SAndroid Build Coastguard Worker// Next tag: 22 213*6fa6b5e2SAndroid Build Coastguard Worker// 214*6fa6b5e2SAndroid Build Coastguard Worker// This should not contain any fields that are marked internal, as we compare 215*6fa6b5e2SAndroid Build Coastguard Worker// the protos directly to decide if it is a new version of the file. 216*6fa6b5e2SAndroid Build Coastguard Worker// LINT.IfChange(data_file) 217*6fa6b5e2SAndroid Build Coastguard Workermessage DataFile { 218*6fa6b5e2SAndroid Build Coastguard Worker // A unique identifier of the file within the group, that can be used to 219*6fa6b5e2SAndroid Build Coastguard Worker // get this file from the group. 220*6fa6b5e2SAndroid Build Coastguard Worker // Ex: "language-detection-model" 221*6fa6b5e2SAndroid Build Coastguard Worker optional string file_id = 7; 222*6fa6b5e2SAndroid Build Coastguard Worker 223*6fa6b5e2SAndroid Build Coastguard Worker // Url from where the file is to be downloaded. 224*6fa6b5e2SAndroid Build Coastguard Worker // Ex: https://www.gstatic.com/group-name/model_1234.zip 225*6fa6b5e2SAndroid Build Coastguard Worker optional string url_to_download = 2; 226*6fa6b5e2SAndroid Build Coastguard Worker 227*6fa6b5e2SAndroid Build Coastguard Worker // Exact size of the file. This is used to check if there is space available 228*6fa6b5e2SAndroid Build Coastguard Worker // for the file before scheduling the download. 229*6fa6b5e2SAndroid Build Coastguard Worker // The byte_size is optional. If not set, MDD will not be able check the space 230*6fa6b5e2SAndroid Build Coastguard Worker // available before schedulding the download. 231*6fa6b5e2SAndroid Build Coastguard Worker optional int32 byte_size = 4; 232*6fa6b5e2SAndroid Build Coastguard Worker 233*6fa6b5e2SAndroid Build Coastguard Worker // Enum for checksum types. 234*6fa6b5e2SAndroid Build Coastguard Worker // NOTE: do not add any new checksum type here, older MDD versions would break 235*6fa6b5e2SAndroid Build Coastguard Worker // otherwise. 236*6fa6b5e2SAndroid Build Coastguard Worker enum ChecksumType { 237*6fa6b5e2SAndroid Build Coastguard Worker // Default checksum is SHA1. 238*6fa6b5e2SAndroid Build Coastguard Worker DEFAULT = 0; 239*6fa6b5e2SAndroid Build Coastguard Worker 240*6fa6b5e2SAndroid Build Coastguard Worker // No checksum is provided. 241*6fa6b5e2SAndroid Build Coastguard Worker // This is NOT currently supported by iMDD. Please contact <internal>@ if you 242*6fa6b5e2SAndroid Build Coastguard Worker // need this feature. 243*6fa6b5e2SAndroid Build Coastguard Worker NONE = 1; 244*6fa6b5e2SAndroid Build Coastguard Worker 245*6fa6b5e2SAndroid Build Coastguard Worker // This is currently only supported by cMDD. If you need it for Android or 246*6fa6b5e2SAndroid Build Coastguard Worker // iOS, please contact MDD team <internal>@. 247*6fa6b5e2SAndroid Build Coastguard Worker SHA256 = 2; 248*6fa6b5e2SAndroid Build Coastguard Worker } 249*6fa6b5e2SAndroid Build Coastguard Worker 250*6fa6b5e2SAndroid Build Coastguard Worker optional ChecksumType checksum_type = 15; 251*6fa6b5e2SAndroid Build Coastguard Worker 252*6fa6b5e2SAndroid Build Coastguard Worker // SHA1 checksum to verify the file before it can be used. This is also used 253*6fa6b5e2SAndroid Build Coastguard Worker // to de-duplicate files between different groups. 254*6fa6b5e2SAndroid Build Coastguard Worker // For most files, this will be the checksum of the file being downloaded. 255*6fa6b5e2SAndroid Build Coastguard Worker // For files with download_transform, this should contain the transform of 256*6fa6b5e2SAndroid Build Coastguard Worker // the file after the transforms have been applied. 257*6fa6b5e2SAndroid Build Coastguard Worker // The checksum is optional. If not set, the checksum_type must be 258*6fa6b5e2SAndroid Build Coastguard Worker // ChecksumType.NONE. 259*6fa6b5e2SAndroid Build Coastguard Worker optional string checksum = 5; 260*6fa6b5e2SAndroid Build Coastguard Worker 261*6fa6b5e2SAndroid Build Coastguard Worker // The following are <internal> transforms to apply to the downloaded files. 262*6fa6b5e2SAndroid Build Coastguard Worker // Transforms are bi-directional and defined in terms of what they do on 263*6fa6b5e2SAndroid Build Coastguard Worker // write. Since these transforms are applied while reading, their 264*6fa6b5e2SAndroid Build Coastguard Worker // directionality is reversed. Eg, you'll see 'compress' to indicate that the 265*6fa6b5e2SAndroid Build Coastguard Worker // file should be decompressed. 266*6fa6b5e2SAndroid Build Coastguard Worker 267*6fa6b5e2SAndroid Build Coastguard Worker // These transforms are applied once by MDD after downloading the file. 268*6fa6b5e2SAndroid Build Coastguard Worker // Currently only compress is available. 269*6fa6b5e2SAndroid Build Coastguard Worker // Valid on Android. iOS support is tracked by b/118828045. 270*6fa6b5e2SAndroid Build Coastguard Worker optional mobstore.proto.Transforms download_transforms = 11; 271*6fa6b5e2SAndroid Build Coastguard Worker 272*6fa6b5e2SAndroid Build Coastguard Worker // If DataFile has download_transforms, this field must be provided with the 273*6fa6b5e2SAndroid Build Coastguard Worker // SHA1 checksum of the file before any transform are applied. The original 274*6fa6b5e2SAndroid Build Coastguard Worker // checksum would also be checked after the download_transforms are applied. 275*6fa6b5e2SAndroid Build Coastguard Worker optional string downloaded_file_checksum = 14; 276*6fa6b5e2SAndroid Build Coastguard Worker 277*6fa6b5e2SAndroid Build Coastguard Worker // Exact size of the downloaded file. If the DataFile has download transforms 278*6fa6b5e2SAndroid Build Coastguard Worker // like compress and zip, the downloaded file size would be different than 279*6fa6b5e2SAndroid Build Coastguard Worker // the final file size on disk. Client could use 280*6fa6b5e2SAndroid Build Coastguard Worker // this field to track the downloaded file size and calculate the download 281*6fa6b5e2SAndroid Build Coastguard Worker // progress percentage. This field is not used by MDD currently. 282*6fa6b5e2SAndroid Build Coastguard Worker optional int32 downloaded_file_byte_size = 16; 283*6fa6b5e2SAndroid Build Coastguard Worker 284*6fa6b5e2SAndroid Build Coastguard Worker // These transforms are evaluated by the caller on-the-fly when reading the 285*6fa6b5e2SAndroid Build Coastguard Worker // data with MobStore. Any transforms installed in the caller's MobStore 286*6fa6b5e2SAndroid Build Coastguard Worker // instance is available. 287*6fa6b5e2SAndroid Build Coastguard Worker // Valid on Android and cMDD. iOS support is tracked by b/118759254. 288*6fa6b5e2SAndroid Build Coastguard Worker optional mobstore.proto.Transforms read_transforms = 12; 289*6fa6b5e2SAndroid Build Coastguard Worker 290*6fa6b5e2SAndroid Build Coastguard Worker // List of delta files that can be encoded and decoded with base files. 291*6fa6b5e2SAndroid Build Coastguard Worker // If the device has any base file, the delta file which is much 292*6fa6b5e2SAndroid Build Coastguard Worker // smaller will be downloaded instead of the full file. 293*6fa6b5e2SAndroid Build Coastguard Worker // For most clients, only one delta file should be enough. If specifying 294*6fa6b5e2SAndroid Build Coastguard Worker // multiple delta files, they should be in a sequence from the most recent 295*6fa6b5e2SAndroid Build Coastguard Worker // base file to the oldest. 296*6fa6b5e2SAndroid Build Coastguard Worker // This is currently only supported on Android. 297*6fa6b5e2SAndroid Build Coastguard Worker repeated DeltaFile delta_file = 13; 298*6fa6b5e2SAndroid Build Coastguard Worker 299*6fa6b5e2SAndroid Build Coastguard Worker enum AndroidSharingType { 300*6fa6b5e2SAndroid Build Coastguard Worker // The dataFile isn't available for sharing. 301*6fa6b5e2SAndroid Build Coastguard Worker UNSUPPORTED = 0; 302*6fa6b5e2SAndroid Build Coastguard Worker 303*6fa6b5e2SAndroid Build Coastguard Worker // If sharing with the Android Blob Sharing Service isn't available, fall 304*6fa6b5e2SAndroid Build Coastguard Worker // back to normal behavior, i.e. download locally. 305*6fa6b5e2SAndroid Build Coastguard Worker ANDROID_BLOB_WHEN_AVAILABLE = 1; 306*6fa6b5e2SAndroid Build Coastguard Worker } 307*6fa6b5e2SAndroid Build Coastguard Worker 308*6fa6b5e2SAndroid Build Coastguard Worker // Defines whether the file should be shared and how. 309*6fa6b5e2SAndroid Build Coastguard Worker // NOTE: currently this field is only used by aMDD and has no effect on iMDD. 310*6fa6b5e2SAndroid Build Coastguard Worker optional AndroidSharingType android_sharing_type = 17; 311*6fa6b5e2SAndroid Build Coastguard Worker 312*6fa6b5e2SAndroid Build Coastguard Worker // Enum for android sharing checksum types. 313*6fa6b5e2SAndroid Build Coastguard Worker enum AndroidSharingChecksumType { 314*6fa6b5e2SAndroid Build Coastguard Worker NOT_SET = 0; 315*6fa6b5e2SAndroid Build Coastguard Worker 316*6fa6b5e2SAndroid Build Coastguard Worker // If the file group should be shared through the Android Blob Sharing 317*6fa6b5e2SAndroid Build Coastguard Worker // Service, the checksum type must be set to SHA256. 318*6fa6b5e2SAndroid Build Coastguard Worker SHA2_256 = 1; 319*6fa6b5e2SAndroid Build Coastguard Worker } 320*6fa6b5e2SAndroid Build Coastguard Worker 321*6fa6b5e2SAndroid Build Coastguard Worker optional AndroidSharingChecksumType android_sharing_checksum_type = 18; 322*6fa6b5e2SAndroid Build Coastguard Worker 323*6fa6b5e2SAndroid Build Coastguard Worker // Checksum used to access files through the Android Blob Sharing Service. 324*6fa6b5e2SAndroid Build Coastguard Worker optional string android_sharing_checksum = 19; 325*6fa6b5e2SAndroid Build Coastguard Worker 326*6fa6b5e2SAndroid Build Coastguard Worker // Relative file path and file name to be preserved within the parent 327*6fa6b5e2SAndroid Build Coastguard Worker // directory when creating symlinks for the file groups that have 328*6fa6b5e2SAndroid Build Coastguard Worker // preserve_filenames_and_isolate_files set to true. 329*6fa6b5e2SAndroid Build Coastguard Worker // This filename should NOT start or end with a '/', and it can not contain 330*6fa6b5e2SAndroid Build Coastguard Worker // the substring '..'. 331*6fa6b5e2SAndroid Build Coastguard Worker // Working example: "subDir/FileName.txt". 332*6fa6b5e2SAndroid Build Coastguard Worker optional string relative_file_path = 20; 333*6fa6b5e2SAndroid Build Coastguard Worker 334*6fa6b5e2SAndroid Build Coastguard Worker // Custom metadata attached to the file. 335*6fa6b5e2SAndroid Build Coastguard Worker // 336*6fa6b5e2SAndroid Build Coastguard Worker // This allows clients to include specific metadata about the file for their 337*6fa6b5e2SAndroid Build Coastguard Worker // own processing purposes. The metadata will be stored with the file and 338*6fa6b5e2SAndroid Build Coastguard Worker // accessible when the file's file group is retrieved. 339*6fa6b5e2SAndroid Build Coastguard Worker // 340*6fa6b5e2SAndroid Build Coastguard Worker // This property should only be used if absolutely necessary. Please consult 341*6fa6b5e2SAndroid Build Coastguard Worker // with <internal>@ if you have questions about this property or a potential 342*6fa6b5e2SAndroid Build Coastguard Worker // use-case. 343*6fa6b5e2SAndroid Build Coastguard Worker // 344*6fa6b5e2SAndroid Build Coastguard Worker // Available for aMDD Lib only. 345*6fa6b5e2SAndroid Build Coastguard Worker optional google.protobuf.Any custom_metadata = 21; 346*6fa6b5e2SAndroid Build Coastguard Worker 347*6fa6b5e2SAndroid Build Coastguard Worker reserved 1, 3, 6, 8, 9; 348*6fa6b5e2SAndroid Build Coastguard Worker} 349*6fa6b5e2SAndroid Build Coastguard Worker// LINT.ThenChange( 350*6fa6b5e2SAndroid Build Coastguard Worker// <internal>, 351*6fa6b5e2SAndroid Build Coastguard Worker// <internal>) 352*6fa6b5e2SAndroid Build Coastguard Worker 353*6fa6b5e2SAndroid Build Coastguard Worker// A delta file represents all the metadata to download for a diff file encoded 354*6fa6b5e2SAndroid Build Coastguard Worker// based on a base file 355*6fa6b5e2SAndroid Build Coastguard Worker// LINT.IfChange(delta_file) 356*6fa6b5e2SAndroid Build Coastguard Workermessage DeltaFile { 357*6fa6b5e2SAndroid Build Coastguard Worker // These fields all mirror the similarly-named fields in DataFile. 358*6fa6b5e2SAndroid Build Coastguard Worker optional string url_to_download = 1; 359*6fa6b5e2SAndroid Build Coastguard Worker optional int32 byte_size = 2; 360*6fa6b5e2SAndroid Build Coastguard Worker optional string checksum = 3; 361*6fa6b5e2SAndroid Build Coastguard Worker 362*6fa6b5e2SAndroid Build Coastguard Worker // Enum of all diff decoders supported 363*6fa6b5e2SAndroid Build Coastguard Worker enum DiffDecoder { 364*6fa6b5e2SAndroid Build Coastguard Worker // Default to have no diff decoder specified, will thrown unsupported 365*6fa6b5e2SAndroid Build Coastguard Worker // exception 366*6fa6b5e2SAndroid Build Coastguard Worker UNSPECIFIED = 0; 367*6fa6b5e2SAndroid Build Coastguard Worker 368*6fa6b5e2SAndroid Build Coastguard Worker // VcDIFF decoder 369*6fa6b5e2SAndroid Build Coastguard Worker // Generic Differencing and Compression Data Format 370*6fa6b5e2SAndroid Build Coastguard Worker // For more information, please refer to rfc3284 371*6fa6b5e2SAndroid Build Coastguard Worker // The VcDiff decoder for GMS service: 372*6fa6b5e2SAndroid Build Coastguard Worker // <internal> 373*6fa6b5e2SAndroid Build Coastguard Worker VC_DIFF = 1; 374*6fa6b5e2SAndroid Build Coastguard Worker } 375*6fa6b5e2SAndroid Build Coastguard Worker // The diff decoder used to generate full file with delta and base file. 376*6fa6b5e2SAndroid Build Coastguard Worker // For MDD as a GMS service, a VcDiff decoder will be registered and injected 377*6fa6b5e2SAndroid Build Coastguard Worker // in by default. Using MDD as a library, clients need to register and inject 378*6fa6b5e2SAndroid Build Coastguard Worker // in a VcDiff decoder, otherwise, an exception will be thrown. 379*6fa6b5e2SAndroid Build Coastguard Worker optional DiffDecoder diff_decoder = 5; 380*6fa6b5e2SAndroid Build Coastguard Worker 381*6fa6b5e2SAndroid Build Coastguard Worker // The base file represents to a full file on device. It should contain the 382*6fa6b5e2SAndroid Build Coastguard Worker // bare minimum fields of a DataFile to identify a DataFile on device. 383*6fa6b5e2SAndroid Build Coastguard Worker optional BaseFile base_file = 6; 384*6fa6b5e2SAndroid Build Coastguard Worker 385*6fa6b5e2SAndroid Build Coastguard Worker reserved 4; 386*6fa6b5e2SAndroid Build Coastguard Worker} 387*6fa6b5e2SAndroid Build Coastguard Worker// LINT.ThenChange( 388*6fa6b5e2SAndroid Build Coastguard Worker// <internal>, 389*6fa6b5e2SAndroid Build Coastguard Worker// <internal>) 390*6fa6b5e2SAndroid Build Coastguard Worker 391*6fa6b5e2SAndroid Build Coastguard Workermessage BaseFile { 392*6fa6b5e2SAndroid Build Coastguard Worker // SHA1 checksum of the base file to identify a file on device. It should 393*6fa6b5e2SAndroid Build Coastguard Worker // match the checksum field of the base file used to generate the delta file. 394*6fa6b5e2SAndroid Build Coastguard Worker optional string checksum = 1; 395*6fa6b5e2SAndroid Build Coastguard Worker} 396*6fa6b5e2SAndroid Build Coastguard Worker 397*6fa6b5e2SAndroid Build Coastguard Worker// LINT.IfChange 398*6fa6b5e2SAndroid Build Coastguard Worker// Next id: 5 399*6fa6b5e2SAndroid Build Coastguard Workermessage DownloadConditions { 400*6fa6b5e2SAndroid Build Coastguard Worker // TODO(b/143548753): The first value in an enum must have a specific prefix. 401*6fa6b5e2SAndroid Build Coastguard Worker enum DeviceStoragePolicy { 402*6fa6b5e2SAndroid Build Coastguard Worker // MDD will block download of files in android low storage. Currently MDD 403*6fa6b5e2SAndroid Build Coastguard Worker // doesn't delete the files in case the device reaches low storage 404*6fa6b5e2SAndroid Build Coastguard Worker // after the file has been downloaded. 405*6fa6b5e2SAndroid Build Coastguard Worker BLOCK_DOWNLOAD_IN_LOW_STORAGE = 0; 406*6fa6b5e2SAndroid Build Coastguard Worker 407*6fa6b5e2SAndroid Build Coastguard Worker // Block download of files only under a lower threshold defined here 408*6fa6b5e2SAndroid Build Coastguard Worker // <internal> 409*6fa6b5e2SAndroid Build Coastguard Worker BLOCK_DOWNLOAD_LOWER_THRESHOLD = 1; 410*6fa6b5e2SAndroid Build Coastguard Worker 411*6fa6b5e2SAndroid Build Coastguard Worker // Set the storage threshold to an extremely low value when downloading. 412*6fa6b5e2SAndroid Build Coastguard Worker // IMPORTANT: if the download make the device runs out of disk, this could 413*6fa6b5e2SAndroid Build Coastguard Worker // render the device unusable. 414*6fa6b5e2SAndroid Build Coastguard Worker // This should only be used for critical use cases such as privacy 415*6fa6b5e2SAndroid Build Coastguard Worker // violations. Emergency fix should not belong to this category. Please 416*6fa6b5e2SAndroid Build Coastguard Worker // talks to <internal>@ when you want to use this option. 417*6fa6b5e2SAndroid Build Coastguard Worker EXTREMELY_LOW_THRESHOLD = 2; 418*6fa6b5e2SAndroid Build Coastguard Worker } 419*6fa6b5e2SAndroid Build Coastguard Worker 420*6fa6b5e2SAndroid Build Coastguard Worker // Specify the device storage under which the files should be downloaded. 421*6fa6b5e2SAndroid Build Coastguard Worker // By default, the files will only be downloaded if the device is not in 422*6fa6b5e2SAndroid Build Coastguard Worker // low storage. 423*6fa6b5e2SAndroid Build Coastguard Worker optional DeviceStoragePolicy device_storage_policy = 1; 424*6fa6b5e2SAndroid Build Coastguard Worker 425*6fa6b5e2SAndroid Build Coastguard Worker // TODO(b/143548753): The first value in an enum must have a specific prefix. 426*6fa6b5e2SAndroid Build Coastguard Worker enum DeviceNetworkPolicy { 427*6fa6b5e2SAndroid Build Coastguard Worker // Only download files on wifi. 428*6fa6b5e2SAndroid Build Coastguard Worker DOWNLOAD_ONLY_ON_WIFI = 0; 429*6fa6b5e2SAndroid Build Coastguard Worker 430*6fa6b5e2SAndroid Build Coastguard Worker // Allow download on any network including wifi and cellular. 431*6fa6b5e2SAndroid Build Coastguard Worker DOWNLOAD_ON_ANY_NETWORK = 1; 432*6fa6b5e2SAndroid Build Coastguard Worker 433*6fa6b5e2SAndroid Build Coastguard Worker // Allow downloading only on wifi first, then after a configurable time 434*6fa6b5e2SAndroid Build Coastguard Worker // period set in the field download_first_on_wifi_period_secs below, 435*6fa6b5e2SAndroid Build Coastguard Worker // allow downloading on any network including wifi and cellular. 436*6fa6b5e2SAndroid Build Coastguard Worker DOWNLOAD_FIRST_ON_WIFI_THEN_ON_ANY_NETWORK = 2; 437*6fa6b5e2SAndroid Build Coastguard Worker } 438*6fa6b5e2SAndroid Build Coastguard Worker 439*6fa6b5e2SAndroid Build Coastguard Worker // Specify the device network under which the files should be downloaded. 440*6fa6b5e2SAndroid Build Coastguard Worker // By default, the files will only be downloaded on wifi. 441*6fa6b5e2SAndroid Build Coastguard Worker // 442*6fa6b5e2SAndroid Build Coastguard Worker // If your feature targets below v20 and want to download on cellular in 443*6fa6b5e2SAndroid Build Coastguard Worker // these versions of gms, also set allow_download_without_wifi = true; 444*6fa6b5e2SAndroid Build Coastguard Worker optional DeviceNetworkPolicy device_network_policy = 2; 445*6fa6b5e2SAndroid Build Coastguard Worker 446*6fa6b5e2SAndroid Build Coastguard Worker // This field will only be used when the 447*6fa6b5e2SAndroid Build Coastguard Worker // DeviceNetworkPolicy = DOWNLOAD_FIRST_ON_WIFI_THEN_ON_ANY_NETWORK 448*6fa6b5e2SAndroid Build Coastguard Worker // MDD will download the file only on wifi for this period of time. If the 449*6fa6b5e2SAndroid Build Coastguard Worker // download was not finished, MDD will download on any network including 450*6fa6b5e2SAndroid Build Coastguard Worker // wifi and cellular. 451*6fa6b5e2SAndroid Build Coastguard Worker // Ex: 604800 // 7 Days 452*6fa6b5e2SAndroid Build Coastguard Worker optional int64 download_first_on_wifi_period_secs = 4; 453*6fa6b5e2SAndroid Build Coastguard Worker 454*6fa6b5e2SAndroid Build Coastguard Worker // TODO(b/143548753): The first value in an enum must have a specific prefix. 455*6fa6b5e2SAndroid Build Coastguard Worker enum ActivatingCondition { 456*6fa6b5e2SAndroid Build Coastguard Worker // The download is activated as soon the server side config is received and 457*6fa6b5e2SAndroid Build Coastguard Worker // the server configured download conditions are satisfied. 458*6fa6b5e2SAndroid Build Coastguard Worker ALWAYS_ACTIVATED = 0; 459*6fa6b5e2SAndroid Build Coastguard Worker 460*6fa6b5e2SAndroid Build Coastguard Worker // The download is activated when both server side activation conditions 461*6fa6b5e2SAndroid Build Coastguard Worker // are satisfied and the client has activated the download on device. 462*6fa6b5e2SAndroid Build Coastguard Worker // 463*6fa6b5e2SAndroid Build Coastguard Worker // Clients can activate this group using the activateFileGroup API. 464*6fa6b5e2SAndroid Build Coastguard Worker // <internal> 465*6fa6b5e2SAndroid Build Coastguard Worker DEVICE_ACTIVATED = 1; 466*6fa6b5e2SAndroid Build Coastguard Worker } 467*6fa6b5e2SAndroid Build Coastguard Worker 468*6fa6b5e2SAndroid Build Coastguard Worker // Specify how the download is activated. By default, the download is 469*6fa6b5e2SAndroid Build Coastguard Worker // activated as soon as server configured activating conditions are satisfied. 470*6fa6b5e2SAndroid Build Coastguard Worker optional ActivatingCondition activating_condition = 3; 471*6fa6b5e2SAndroid Build Coastguard Worker} 472*6fa6b5e2SAndroid Build Coastguard Worker// LINT.ThenChange( 473*6fa6b5e2SAndroid Build Coastguard Worker// <internal>, 474*6fa6b5e2SAndroid Build Coastguard Worker// <internal>) 475*6fa6b5e2SAndroid Build Coastguard Worker 476*6fa6b5e2SAndroid Build Coastguard Workermessage PhConfig { 477*6fa6b5e2SAndroid Build Coastguard Worker repeated PhClient ph_client = 1; 478*6fa6b5e2SAndroid Build Coastguard Worker} 479*6fa6b5e2SAndroid Build Coastguard Worker 480*6fa6b5e2SAndroid Build Coastguard Worker// Config for a client that wants to download their data file group using 481*6fa6b5e2SAndroid Build Coastguard Worker// a phenotype flag. It contains the phenotype flag name where the client 482*6fa6b5e2SAndroid Build Coastguard Worker// config is present. 483*6fa6b5e2SAndroid Build Coastguard Worker// This is used by clients that want to download data files conditionally. Its 484*6fa6b5e2SAndroid Build Coastguard Worker// current usage is to download webref slices. 485*6fa6b5e2SAndroid Build Coastguard Workermessage PhClient { 486*6fa6b5e2SAndroid Build Coastguard Worker // The phenotype flag name where the config is present. 487*6fa6b5e2SAndroid Build Coastguard Worker optional string ph_flag_name = 1; 488*6fa6b5e2SAndroid Build Coastguard Worker} 489*6fa6b5e2SAndroid Build Coastguard Worker 490*6fa6b5e2SAndroid Build Coastguard Worker// ManifestConfig to support on device targeting. 491*6fa6b5e2SAndroid Build Coastguard Worker// The ManifestConfig could be in a payload of a PH flag or it could be in the 492*6fa6b5e2SAndroid Build Coastguard Worker// content of a Manifest file. See <internal> for more 493*6fa6b5e2SAndroid Build Coastguard Worker// details. 494*6fa6b5e2SAndroid Build Coastguard Worker// Each ManifestConfig.Entry will have a Modifier and a corresponding 495*6fa6b5e2SAndroid Build Coastguard Worker// DataFileGroup. The Modifier will be used for on device filtering/targeting. 496*6fa6b5e2SAndroid Build Coastguard Workermessage ManifestConfig { 497*6fa6b5e2SAndroid Build Coastguard Worker message Entry { 498*6fa6b5e2SAndroid Build Coastguard Worker // All the modifier variables are used for filtering/targeting on the device 499*6fa6b5e2SAndroid Build Coastguard Worker // side. For example, we can specify the locale "en_US" and does the 500*6fa6b5e2SAndroid Build Coastguard Worker // targeting on the device based on this locale. If you need to add more 501*6fa6b5e2SAndroid Build Coastguard Worker // fields to Modifier, please email <internal>@. 502*6fa6b5e2SAndroid Build Coastguard Worker message Modifier { 503*6fa6b5e2SAndroid Build Coastguard Worker // Locales for which this DataFileGroup is valid. 504*6fa6b5e2SAndroid Build Coastguard Worker // Locales defined here are application's specific. 505*6fa6b5e2SAndroid Build Coastguard Worker // It will be consumed by the application's 506*6fa6b5e2SAndroid Build Coastguard Worker // ManifestConfigFlagPopulator.Overrider to do on-device targeting. The 507*6fa6b5e2SAndroid Build Coastguard Worker // Overrider will interprete the locales to select best locale matches. 508*6fa6b5e2SAndroid Build Coastguard Worker // For example, it can invoke the LanguageMatcher [1] to support 509*6fa6b5e2SAndroid Build Coastguard Worker // "Local Inheritance" [2]. 510*6fa6b5e2SAndroid Build Coastguard Worker // [1] 511*6fa6b5e2SAndroid Build Coastguard Worker // <internal> 512*6fa6b5e2SAndroid Build Coastguard Worker // [2] <internal> 513*6fa6b5e2SAndroid Build Coastguard Worker repeated string locale = 1; 514*6fa6b5e2SAndroid Build Coastguard Worker 515*6fa6b5e2SAndroid Build Coastguard Worker // Custom Properties. 516*6fa6b5e2SAndroid Build Coastguard Worker // Defined by each application. The application needs to provide a 517*6fa6b5e2SAndroid Build Coastguard Worker // ManifestConfigOverrider 518*6fa6b5e2SAndroid Build Coastguard Worker // (<internal> 519*6fa6b5e2SAndroid Build Coastguard Worker // that understands and filters entries based on this Custom Properties. 520*6fa6b5e2SAndroid Build Coastguard Worker optional google.protobuf.Any custom_properties = 2; 521*6fa6b5e2SAndroid Build Coastguard Worker 522*6fa6b5e2SAndroid Build Coastguard Worker message Location { 523*6fa6b5e2SAndroid Build Coastguard Worker // S2CellId (<internal>) associated with this DataFileGroup. It will be 524*6fa6b5e2SAndroid Build Coastguard Worker // used to do location based targeting on device, optionally filtering 525*6fa6b5e2SAndroid Build Coastguard Worker // extraneous slices if the user has location permissions enabled. 526*6fa6b5e2SAndroid Build Coastguard Worker // Otherwise location targeting will be based on a rough estimate from 527*6fa6b5e2SAndroid Build Coastguard Worker // IP-based geolocation on the server. The type fixed64 is a bit more 528*6fa6b5e2SAndroid Build Coastguard Worker // efficient than int64 for our purposes. This is because int64 uses 529*6fa6b5e2SAndroid Build Coastguard Worker // prefix encoding, however, for the S2CellIds the high-order bits 530*6fa6b5e2SAndroid Build Coastguard Worker // encode the face-ID and as a result we often end up with large 531*6fa6b5e2SAndroid Build Coastguard Worker // numbers. 532*6fa6b5e2SAndroid Build Coastguard Worker optional fixed64 s2_cell_id = 1; 533*6fa6b5e2SAndroid Build Coastguard Worker } 534*6fa6b5e2SAndroid Build Coastguard Worker 535*6fa6b5e2SAndroid Build Coastguard Worker optional Location location = 3; 536*6fa6b5e2SAndroid Build Coastguard Worker } 537*6fa6b5e2SAndroid Build Coastguard Worker 538*6fa6b5e2SAndroid Build Coastguard Worker optional Modifier modifier = 1; 539*6fa6b5e2SAndroid Build Coastguard Worker optional DataFileGroup data_file_group = 2; 540*6fa6b5e2SAndroid Build Coastguard Worker } 541*6fa6b5e2SAndroid Build Coastguard Worker 542*6fa6b5e2SAndroid Build Coastguard Worker message UrlTemplate { 543*6fa6b5e2SAndroid Build Coastguard Worker // Template to construct a {@code DataFile}'s url_to_download on device. 544*6fa6b5e2SAndroid Build Coastguard Worker // If the url template should be used, the url_to_download field should be 545*6fa6b5e2SAndroid Build Coastguard Worker // left unpopulated. If the url template and the url_to_download are both 546*6fa6b5e2SAndroid Build Coastguard Worker // populated, the template will be ignored. 547*6fa6b5e2SAndroid Build Coastguard Worker optional string file_url_template = 1; 548*6fa6b5e2SAndroid Build Coastguard Worker } 549*6fa6b5e2SAndroid Build Coastguard Worker 550*6fa6b5e2SAndroid Build Coastguard Worker repeated Entry entry = 1; 551*6fa6b5e2SAndroid Build Coastguard Worker 552*6fa6b5e2SAndroid Build Coastguard Worker // Template definition for constructing URLs on device. It applies to every 553*6fa6b5e2SAndroid Build Coastguard Worker // DataFile defined in the ManifestConfig. 554*6fa6b5e2SAndroid Build Coastguard Worker optional UrlTemplate url_template = 2; 555*6fa6b5e2SAndroid Build Coastguard Worker} 556*6fa6b5e2SAndroid Build Coastguard Worker 557*6fa6b5e2SAndroid Build Coastguard Worker// The flag that MDD gets from P/H, and contains information about the manifest 558*6fa6b5e2SAndroid Build Coastguard Worker// file to be downloaded. 559*6fa6b5e2SAndroid Build Coastguard Worker// Next id: 3 560*6fa6b5e2SAndroid Build Coastguard Workermessage ManifestFileFlag { 561*6fa6b5e2SAndroid Build Coastguard Worker // The ID for the manifest file. This should be unique in the host app space. 562*6fa6b5e2SAndroid Build Coastguard Worker optional string manifest_id = 1; 563*6fa6b5e2SAndroid Build Coastguard Worker 564*6fa6b5e2SAndroid Build Coastguard Worker // The url to the manifest file on Google hosting service. 565*6fa6b5e2SAndroid Build Coastguard Worker optional string manifest_file_url = 2; 566*6fa6b5e2SAndroid Build Coastguard Worker} 567