Loading packages/SettingsLib/Graph/graph.proto +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ message PreferenceProto { 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; // Target of an Intent message ActionTarget { Loading packages/SettingsLib/Graph/src/com/android/settingslib/graph/PreferenceGraphBuilder.kt +2 −1 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ import com.android.settingslib.metadata.RangeValue import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.preference.PreferenceScreenFactory import com.android.settingslib.preference.PreferenceScreenProvider import java.util.Locale import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.util.Locale private const val TAG = "PreferenceGraphBuilder" Loading Loading @@ -387,6 +387,7 @@ fun PreferenceMetadata.toProto( } persistent = metadata.isPersistent(context) if (persistent) { if (metadata is PersistentPreference<*>) sensitivityLevel = metadata.sensitivityLevel if ( flags.includeValue() && enabled && Loading packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PersistentPreference.kt +17 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,19 @@ annotation class ReadWritePermit { } } /** Indicates how sensitive of the data. */ @Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.TYPE) annotation class SensitivityLevel { companion object { const val UNKNOWN_SENSITIVITY = 0 const val NO_SENSITIVITY = 1 const val LOW_SENSITIVITY = 2 const val MEDIUM_SENSITIVITY = 3 const val HIGH_SENSITIVITY = 4 } } /** Preference interface that has a value persisted in datastore. */ interface PersistentPreference<T> { Loading Loading @@ -86,6 +99,10 @@ interface PersistentPreference<T> { callingUid, this as PreferenceMetadata, ) /** The sensitivity level of the preference. */ val sensitivityLevel: @SensitivityLevel Int get() = SensitivityLevel.UNKNOWN_SENSITIVITY } /** Descriptor of values. */ Loading Loading
packages/SettingsLib/Graph/graph.proto +2 −0 Original line number Diff line number Diff line Loading @@ -79,6 +79,8 @@ message PreferenceProto { 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; // Target of an Intent message ActionTarget { Loading
packages/SettingsLib/Graph/src/com/android/settingslib/graph/PreferenceGraphBuilder.kt +2 −1 Original line number Diff line number Diff line Loading @@ -55,9 +55,9 @@ import com.android.settingslib.metadata.RangeValue import com.android.settingslib.metadata.ReadWritePermit import com.android.settingslib.preference.PreferenceScreenFactory import com.android.settingslib.preference.PreferenceScreenProvider import java.util.Locale import kotlinx.coroutines.Dispatchers import kotlinx.coroutines.withContext import java.util.Locale private const val TAG = "PreferenceGraphBuilder" Loading Loading @@ -387,6 +387,7 @@ fun PreferenceMetadata.toProto( } persistent = metadata.isPersistent(context) if (persistent) { if (metadata is PersistentPreference<*>) sensitivityLevel = metadata.sensitivityLevel if ( flags.includeValue() && enabled && Loading
packages/SettingsLib/Metadata/src/com/android/settingslib/metadata/PersistentPreference.kt +17 −0 Original line number Diff line number Diff line Loading @@ -42,6 +42,19 @@ annotation class ReadWritePermit { } } /** Indicates how sensitive of the data. */ @Retention(AnnotationRetention.SOURCE) @Target(AnnotationTarget.TYPE) annotation class SensitivityLevel { companion object { const val UNKNOWN_SENSITIVITY = 0 const val NO_SENSITIVITY = 1 const val LOW_SENSITIVITY = 2 const val MEDIUM_SENSITIVITY = 3 const val HIGH_SENSITIVITY = 4 } } /** Preference interface that has a value persisted in datastore. */ interface PersistentPreference<T> { Loading Loading @@ -86,6 +99,10 @@ interface PersistentPreference<T> { callingUid, this as PreferenceMetadata, ) /** The sensitivity level of the preference. */ val sensitivityLevel: @SensitivityLevel Int get() = SensitivityLevel.UNKNOWN_SENSITIVITY } /** Descriptor of values. */ Loading