1syntax = "proto3"; 2 3package com.android.settingslib.graph; 4 5option java_package = "com.android.settingslib.graph.proto"; 6option java_multiple_files = true; 7 8// Proto represents preference graph. 9message PreferenceGraphProto { 10 // Preference screens appear in the graph. 11 // Key: preference key of the PreferenceScreen. Value: PreferenceScreen. 12 map<string, PreferenceScreenProto> screens = 1; 13 // Roots of the graph. 14 // Each element is a preference key of the PreferenceScreen. 15 repeated string roots = 2; 16 // Activities appear in the graph. 17 // Key: activity class. Value: preference key of associated PreferenceScreen. 18 map<string, string> activity_screens = 3; 19} 20 21// Proto of PreferenceScreen. 22message PreferenceScreenProto { 23 // Intent to show the PreferenceScreen. 24 optional IntentProto intent = 1; 25 // Root of the PreferenceScreen hierarchy. 26 optional PreferenceGroupProto root = 2; 27 // If the preference screen provides complete hierarchy by source code. 28 optional bool complete_hierarchy = 3; 29} 30 31// Proto of PreferenceGroup. 32message PreferenceGroupProto { 33 // Self information of PreferenceGroup. 34 optional PreferenceProto preference = 1; 35 // A list of children. 36 repeated PreferenceOrGroupProto preferences = 2; 37} 38 39// Proto represents either PreferenceProto or PreferenceGroupProto. 40message PreferenceOrGroupProto { 41 oneof kind { 42 // It is a Preference. 43 PreferenceProto preference = 1; 44 // It is a PreferenceGroup. 45 PreferenceGroupProto group = 2; 46 } 47} 48 49// Proto of Preference. 50message PreferenceProto { 51 // Key of the preference. 52 optional string key = 1; 53 // Title of the preference. 54 optional TextProto title = 2; 55 // Summary of the preference. 56 optional TextProto summary = 3; 57 // Icon of the preference. 58 optional int32 icon = 4; 59 // Additional keywords for indexing. 60 optional int32 keywords = 5; 61 // Extras of the preference. 62 optional BundleProto extras = 6; 63 // Whether the preference is indexable. 64 optional bool indexable = 7; 65 // Whether the preference is enabled. 66 optional bool enabled = 8; 67 // Whether the preference is available/visible. 68 optional bool available = 9; 69 // Whether the preference is persistent. 70 optional bool persistent = 10; 71 // Whether the preference is restricted by managed configurations. 72 optional bool restricted = 11; 73 // Target of the preference action. 74 optional ActionTarget action_target = 12; 75 // Preference value (if present, it means `persistent` is true). 76 optional PreferenceValueProto value = 13; 77 // Intent to show and locate the preference (might have highlight animation on 78 // the preference). 79 optional IntentProto launch_intent = 14; 80 // Descriptor of the preference value. 81 optional PreferenceValueDescriptorProto value_descriptor = 15; 82 // Indicate how sensitive of the preference. 83 optional int32 sensitivity_level = 16; 84 85 // Target of an Intent 86 message ActionTarget { 87 oneof kind { 88 // Resolved key of the preference screen located in current app. 89 // This is resolved from android:fragment or activity of current app. 90 string key = 1; 91 // Unresolvable Intent that is either an unrecognized activity of current 92 // app or activity belongs to other app. 93 IntentProto intent = 2; 94 } 95 } 96} 97 98// Proto of string or string resource id. 99message TextProto { 100 oneof text { 101 int32 resource_id = 1; 102 string string = 2; 103 } 104} 105 106// Proto of preference value. 107message PreferenceValueProto { 108 oneof value { 109 bool boolean_value = 1; 110 int32 int_value = 2; 111 } 112} 113 114// Proto of preference value descriptor. 115message PreferenceValueDescriptorProto { 116 oneof type { 117 bool boolean_type = 1; 118 RangeValueProto range_value = 2; 119 } 120} 121 122// Proto of preference value that is between a range. 123message RangeValueProto { 124 // The lower bound (inclusive) of the range. 125 optional int32 min = 1; 126 // The upper bound (inclusive) of the range. 127 optional int32 max = 2; 128 // The increment step within the range. 0 means unset, which implies step size is 1. 129 optional int32 step = 3; 130} 131 132// Proto of android.content.Intent 133message IntentProto { 134 // The action of the Intent. 135 optional string action = 1; 136 137 // The data attribute of the Intent, expressed as a URI. 138 optional string data = 2; 139 140 // The package attribute of the Intent, which may be set to force the 141 // detection of a particular application package that can handle the event. 142 optional string pkg = 3; 143 144 // The component attribute of the Intent, which may be set to force the 145 // detection of a particular component (app). If present, this must be a 146 // package name followed by a '/' and then followed by the class name. 147 optional string component = 4; 148 149 // Flags controlling how intent is handled. The value must be bitwise OR of 150 // intent flag constants defined by Android. 151 // http://developer.android.com/reference/android/content/Intent.html#setFlags(int) 152 optional int32 flags = 5; 153 154 // Extended data from the intent. 155 optional BundleProto extras = 6; 156 157 // The MIME type of the Intent (e.g. "text/plain"). 158 // 159 // For more information, see 160 // https://developer.android.com/reference/android/content/Intent#setType(java.lang.String). 161 optional string mime_type = 7; 162} 163 164// Proto of android.os.Bundle 165message BundleProto { 166 // Bundle data. 167 map<string, BundleValue> values = 1; 168 169 message BundleValue { 170 // Bundle data value for the associated key name. 171 // Can be extended to support other types of bundled data. 172 oneof value { 173 string string_value = 1; 174 bytes bytes_value = 2; 175 int32 int_value = 3; 176 int64 long_value = 4; 177 bool boolean_value = 5; 178 double double_value = 6; 179 BundleProto bundle_value = 7; 180 } 181 } 182} 183