| syntax = "proto3"; |
| |
| package com.android.settingslib.graph; |
| |
| option java_package = "com.android.settingslib.graph.proto"; |
| option java_multiple_files = true; |
| |
| // Proto represents preference graph. |
| message PreferenceGraphProto { |
| // Preference screens appear in the graph. |
| // Key: preference key of the PreferenceScreen. Value: PreferenceScreen. |
| map<string, PreferenceScreenProto> screens = 1; |
| // Roots of the graph. |
| // Each element is a preference key of the PreferenceScreen. |
| repeated string roots = 2; |
| // Activities appear in the graph. |
| // Key: activity class. Value: preference key of associated PreferenceScreen. |
| map<string, string> activity_screens = 3; |
| |
| // Value descriptors for the preference types. |
| // Key: key of the preference type. Value: possible values of the type. |
| map<string, PreferenceValueDescriptorProto> value_descriptors = 4; |
| } |
| |
| // Proto of PreferenceScreen. |
| message PreferenceScreenProto { |
| // Intent to show the PreferenceScreen. |
| optional IntentProto intent = 1; |
| // Root of the PreferenceScreen hierarchy. |
| optional PreferenceGroupProto root = 2; |
| // If the preference screen provides complete hierarchy by source code. |
| optional bool complete_hierarchy = 3; |
| // Parameterized screens (not recursive, provided on the top level only) |
| repeated ParameterizedPreferenceScreenProto parameterized_screens = 4; |
| // If the preference screen is parameterized. |
| optional bool parameterized = 5; |
| // Available parameters of the parameterized screen. |
| // Deprecated: Use key_parameters instead. See b/447555338 for details. |
| repeated BundleProto parameters = 6 [deprecated = true]; |
| // Schema for the key-value parameters. |
| optional KeyParametersSchemaProto parameters_schema = 7; |
| // Available type-safe parameters of the parameterized screen |
| repeated KeyParametersProto key_parameters = 8; |
| } |
| |
| // Proto of parameterized preference screen |
| message ParameterizedPreferenceScreenProto { |
| // Arguments to materialize the parameterized screen. |
| oneof args_oneof { |
| // Legacy bundle to pass the arguments. This is deprecated, please use |
| // key_parameters for new usages. See b/447555338 for details. |
| BundleProto args = 1 [deprecated = true]; |
| // A map of string to string representing the parameters |
| KeyParametersProto key_parameters = 3; |
| } |
| // Materialized screen. |
| optional PreferenceScreenProto screen = 2; |
| } |
| |
| // Proto of PreferenceGroup. |
| message PreferenceGroupProto { |
| // Self information of PreferenceGroup. |
| optional PreferenceProto preference = 1; |
| // A list of children. |
| repeated PreferenceOrGroupProto preferences = 2; |
| } |
| |
| // Proto represents either PreferenceProto or PreferenceGroupProto. |
| message PreferenceOrGroupProto { |
| oneof kind { |
| // It is a Preference. |
| PreferenceProto preference = 1; |
| // It is a PreferenceGroup. |
| PreferenceGroupProto group = 2; |
| } |
| } |
| |
| // Proto of Preference. |
| message PreferenceProto { |
| // Key of the preference. |
| optional string key = 1; |
| // Title of the preference. |
| optional TextProto title = 2; |
| // Summary of the preference. |
| optional TextProto summary = 3; |
| // Icon of the preference. |
| optional int32 icon = 4; |
| // Additional keywords for indexing. |
| optional int32 keywords = 5; |
| // Extras of the preference. |
| optional BundleProto extras = 6; |
| // Whether the preference is indexable. |
| optional bool indexable = 7; |
| // Whether the preference is enabled. |
| optional bool enabled = 8; |
| // Whether the preference is available/visible. |
| optional bool available = 9; |
| // Whether the preference is persistent. |
| optional bool persistent = 10; |
| // Whether the preference is restricted by managed configurations. |
| optional bool restricted = 11; |
| // Target of the preference action. |
| optional ActionTarget action_target = 12; |
| // Preference value (if present, it means `persistent` is true). |
| optional PreferenceValueProto value = 13; |
| // Intent to show and locate the preference (might have highlight animation on |
| // the preference). |
| optional IntentProto launch_intent = 14; |
| // Descriptor of the preference value. |
| optional PreferenceValueDescriptorProto value_descriptor = 15; |
| // Indicate how sensitive of the preference. |
| optional int32 sensitivity_level = 16; |
| // The required permissions to read preference value. |
| optional PermissionsProto read_permissions = 17; |
| // The required permissions to write preference value. |
| optional PermissionsProto write_permissions = 18; |
| // Tag constants associated with the preference. |
| repeated string tags = 19; |
| // Permit to read and write preference value (the lower 15 bits is reserved for read permit). |
| optional int32 read_write_permit = 20; |
| |
| // Target of an Intent |
| message ActionTarget { |
| oneof kind { |
| // Resolved key of the preference screen located in current app. |
| // This is resolved from android:fragment or activity of current app. |
| string key = 1; |
| // Unresolvable Intent that is either an unrecognized activity of current |
| // app or activity belongs to other app. |
| IntentProto intent = 2; |
| } |
| oneof args_oneof { |
| // Arguments to materialize the parameterized screen. |
| BundleProto args = 3 [deprecated = true]; |
| // A map of string to string representing the parameters |
| KeyParametersProto key_parameters = 4; |
| } |
| } |
| optional int32 purpose = 21; |
| // Preconditions of the preference. |
| repeated string get_preconditions = 22 [deprecated = true]; |
| // Preconditions of the preference when setting values. |
| repeated string set_preconditions = 23 [deprecated = true]; |
| // True if the preference supports setting values in any circumstances. |
| optional bool writable = 24; |
| // Schema for the key-value parameters, as a string. |
| optional KeyParametersSchemaProto parameters_schema = 25; |
| // A map of string to string representing the parameters |
| optional KeyParametersProto key_parameters = 26; |
| // Warning of the preference when setting values. |
| optional SetWarningProto set_warning = 27; |
| repeated PreconditionStatusProto get_preconditions_status = 28; |
| repeated PreconditionStatusProto set_preconditions_status = 29; |
| } |
| |
| message PreconditionStatusProto { |
| optional string precondition = 1; |
| optional bool satisfied = 2; |
| // Only populated when satisfied is false. |
| optional string failure = 3; |
| optional PreconditionStability stability = 4; |
| } |
| |
| enum PreconditionStability { |
| STABILITY_UNKNOWN = 0; |
| STABLE_UNTIL_APK_UPDATE = 1; |
| UNSTABLE = 2; |
| } |
| |
| message PossibleValueProto { |
| optional PreferenceValueProto value = 1; |
| optional string description = 2; |
| } |
| |
| // Proto of permissions |
| message PermissionsProto { |
| repeated PermissionProto all_of = 1; |
| repeated PermissionProto any_of = 2; |
| } |
| |
| // Proto of permission |
| message PermissionProto { |
| oneof kind { |
| string permission = 1; |
| PermissionsProto permissions = 2; |
| } |
| } |
| |
| // Proto of string or string resource id. |
| message TextProto { |
| oneof text { |
| int32 resource_id = 1; |
| string string = 2; |
| } |
| } |
| |
| // Proto of preference value. |
| message PreferenceValueProto { |
| oneof value { |
| bool boolean_value = 1; |
| int32 int_value = 2; |
| float float_value = 3; |
| int64 long_value = 4; |
| string string_value = 5; |
| PreferenceErrorProto error = 6; |
| } |
| } |
| |
| message PreferenceErrorProto { |
| string error = 1; |
| } |
| |
| // Proto of preference value descriptor. |
| message PreferenceValueDescriptorProto { |
| oneof type { |
| bool boolean_type = 1; |
| // This actually means "integer". If all of the min, max, and step are |
| // unset, this is just an integer. |
| RangeValueProto range_value = 2; |
| bool float_type = 3; |
| bool long_type = 4; |
| bool string_type = 5; |
| } |
| |
| repeated PossibleValueProto possible_values = 6; |
| optional string value_descriptor_key = 7; |
| optional string description = 8; |
| |
| // Schema for the key-value parameters, as a string. This will only be present |
| // when the value descriptor is parameterized. |
| optional KeyParametersSchemaProto parameters_schema = 9; |
| optional KeyParametersProto parameters = 10; |
| } |
| |
| // Proto of preference value that is an int |
| message RangeValueProto { |
| // The lower bound (inclusive) of the range. unset means no lower bound. |
| optional int32 min = 1; |
| // The upper bound (inclusive) of the range. unset means no upper bound. |
| optional int32 max = 2; |
| // The increment step within the range. 0 or unset means step size is 1. |
| optional int32 step = 3; |
| } |
| |
| // Proto of android.content.Intent |
| message IntentProto { |
| // The action of the Intent. |
| optional string action = 1; |
| |
| // The data attribute of the Intent, expressed as a URI. |
| optional string data = 2; |
| |
| // The package attribute of the Intent, which may be set to force the |
| // detection of a particular application package that can handle the event. |
| optional string pkg = 3; |
| |
| // The component attribute of the Intent, which may be set to force the |
| // detection of a particular component (app). If present, this must be a |
| // package name followed by a '/' and then followed by the class name. |
| optional string component = 4; |
| |
| // Flags controlling how intent is handled. The value must be bitwise OR of |
| // intent flag constants defined by Android. |
| // http://developer.android.com/reference/android/content/Intent.html#setFlags(int) |
| optional int32 flags = 5; |
| |
| // Extended data from the intent. |
| optional BundleProto extras = 6; |
| |
| // The MIME type of the Intent (e.g. "text/plain"). |
| // |
| // For more information, see |
| // https://developer.android.com/reference/android/content/Intent#setType(java.lang.String). |
| optional string mime_type = 7; |
| } |
| |
| // Proto of android.os.Bundle |
| message BundleProto { |
| // Bundle data. Absent when `parcel_bytes` is provided. |
| map<string, BundleValue> values = 1; |
| // The byte array that this `Bundle` object is marshalled by `Parcel`. It is flexible to support |
| // unknown value types (e.g. `Parcelable`) but the data size is way larger than `values`. |
| bytes parcel_bytes = 2; |
| |
| message BundleValue { |
| // Bundle data value for the associated key name. |
| // Can be extended to support other types of bundled data. |
| oneof value { |
| string string_value = 1; |
| bytes bytes_value = 2; |
| int32 int_value = 3; |
| int64 long_value = 4; |
| bool boolean_value = 5; |
| double double_value = 6; |
| BundleProto bundle_value = 7; |
| } |
| } |
| } |
| |
| // Proto of set warning |
| message SetWarningProto { |
| repeated string preconditions = 1; |
| string warning = 2; |
| } |
| |
| // Proto of KeyParameters |
| message KeyParametersProto { |
| map<string, string> values = 1; |
| } |
| |
| // Proto of KeyParametersSchema |
| message KeyParametersSchemaProto { |
| map<string, ParameterDefinitionProto> parameters = 1; |
| } |
| |
| message ParameterDefinitionProto { |
| optional string purpose = 1; |
| optional bool required = 2; |
| optional PreferenceValueDescriptorProto value_descriptor = 3; |
| } |