xref: /aosp_15_r20/external/libtextclassifier/proto/model_manifest.proto (revision 993b0882672172b81d12fad7a7ac0c3e5c824a12)
1//
2// Copyright (C) 2018 The Android Open Source Project
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
17syntax = "proto2";
18
19package textclassifier.tcs;
20
21option java_package = "com.android.textclassifier.downloader";
22option java_multiple_files = true;
23
24// Manifest for a download task.
25message ModelManifest {
26  message Model {
27    optional string url = 1;
28    optional int64 size_in_bytes = 2;
29    optional string fingerprint = 3;
30    // ModelUsage enum used to assign usage to Model files.
31    // Model file could have one of {DARK, LIVE, UNKNOWN} usage value.
32    enum ModelUsage {
33      UNKNOWN_USAGE = 0;
34      LIVE_MODEL = 1;
35      DARK_MODEL = 2;
36    }
37    optional ModelUsage usage = 4;
38  }
39  // All models to download in this task. Currently the size is always one.
40  repeated Model models = 1;
41  // Consistent with androidx.work.NetworkType.
42  enum NetworkType {
43    UNMETERED = 0;
44    METERED = 1;
45    NOT_REQUIRED = 2;
46    NOT_ROAMING = 3;
47    CONNECTED = 4;
48  }
49  // Notice: all fields below are not used currently
50  optional NetworkType required_network_type = 2;
51  optional bool requires_battery_not_low = 3;
52  optional bool requires_charging = 4;
53  optional bool requires_device_idle = 5;
54  optional bool requires_storage_not_low = 6;
55}
56