1/*
2 * Copyright (C) 2017 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";
18package android.content;
19
20option java_multiple_files = true;
21
22import "frameworks/base/core/proto/android/content/component_name.proto";
23import "frameworks/base/core/proto/android/os/patternmatcher.proto";
24import "frameworks/base/core/proto/android/os/persistablebundle.proto";
25import "frameworks/base/core/proto/android/privacy.proto";
26
27// Next Tag: 14
28message IntentProto {
29    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
30
31    enum DockState {
32        // Used as an int value for Intent#EXTRA_DOCK_STATE to represent that
33        // the phone is not in any dock.
34        DOCK_STATE_UNDOCKED = 0;
35
36        // Used as an int value for Intent#EXTRA_DOCK_STATE to represent that
37        // the phone is in a desk dock.
38        DOCK_STATE_DESK = 1;
39
40        // Used as an int value for Intent#EXTRA_DOCK_STATE to represent that
41        // the phone is in a car dock.
42        DOCK_STATE_CAR = 2;
43
44        // Used as an int value for Intent#EXTRA_DOCK_STATE to represent that
45        // the phone is in a analog (low end) dock.
46        DOCK_STATE_LE_DESK = 3;
47
48        // Used as an int value for Intent#EXTRA_DOCK_STATE to represent that
49        // the phone is in a digital (high end) dock.
50        DOCK_STATE_HE_DESK = 4;
51    }
52
53    optional string action = 1;
54    repeated string categories = 2;
55    optional string data = 3 [ (.android.privacy).dest = DEST_EXPLICIT ];
56    optional string type = 4;
57    optional string flag = 5;
58    optional string extended_flag = 14;
59    optional string package = 6;
60    optional ComponentNameProto component = 7;
61    optional string source_bounds = 8;
62    optional string clip_data = 9 [ (.android.privacy).dest = DEST_LOCAL ];
63    optional string extras = 10 [ (.android.privacy).dest = DEST_LOCAL ];
64    // UserHandle value (similar to user_id in other protos).
65    optional int32 content_user_hint = 11;
66    optional string selector = 12;
67    optional string identifier = 13 [ (.android.privacy).dest = DEST_EXPLICIT ];
68}
69
70// Next Tag: 14
71message IntentFilterProto {
72    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
73
74    repeated string actions = 1;
75    repeated string categories = 2;
76    // https://developer.android.com/guide/topics/manifest/data-element#scheme:
77    // The scheme part of a URI. This is the minimal essential attribute for
78    // specifying a URI; at least one scheme attribute must be set for the filter,
79    // or none of the other URI attributes are meaningful. A scheme is specified
80    // without the trailing colon (for example, http, rather than http:). If the
81    // filter has a data type set (the mimeType attribute) but no scheme, the
82    // content: and file: schemes are assumed.
83    repeated string data_schemes = 3  [ (.android.privacy).dest = DEST_EXPLICIT ];
84    repeated android.os.PatternMatcherProto data_scheme_specs = 4;
85    repeated AuthorityEntryProto data_authorities = 5;
86    repeated android.os.PatternMatcherProto data_paths = 6;
87    repeated string data_types = 7;
88    optional int32 priority = 8;
89    optional bool has_partial_types = 9;
90    optional bool get_auto_verify = 10;
91    repeated string mime_groups = 11;
92    optional android.os.PersistableBundleProto extras = 12;
93    repeated UriRelativeFilterGroupProto uri_relative_filter_groups = 13;
94}
95
96message AuthorityEntryProto {
97    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
98
99    optional string host = 1;
100    optional bool wild = 2;
101    optional int32 port = 3;
102}
103
104message UriRelativeFilterGroupProto {
105    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
106
107    enum Action {
108        ACTION_ALLOW = 0;
109        ACTION_BLOCK = 1;
110    }
111
112    optional Action action = 1;
113    repeated UriRelativeFilterProto uri_relative_filters = 2;
114}
115
116message UriRelativeFilterProto {
117    option (.android.msg_privacy).dest = DEST_AUTOMATIC;
118
119    required int32 uri_part = 1;
120    required int32 pattern_type = 2;
121    required string filter = 3;
122}
123