Sdílet prostřednictvím


ViewStructure.SetDataIsSensitive(Boolean) Method

Definition

Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc.

[Android.Runtime.Register("setDataIsSensitive", "(Z)V", "GetSetDataIsSensitive_ZHandler", ApiSince=26)]
public abstract void SetDataIsSensitive (bool sensitive);
[<Android.Runtime.Register("setDataIsSensitive", "(Z)V", "GetSetDataIsSensitive_ZHandler", ApiSince=26)>]
abstract member SetDataIsSensitive : bool -> unit

Parameters

sensitive
Boolean
Attributes

Remarks

Sets whether the data on this node is sensitive; if it is, then its content (text, autofill value, etc..) is striped before calls to android.service.autofill.AutofillService#onFillRequest(android.service.autofill.FillRequest, android.os.CancellationSignal, android.service.autofill.FillCallback).

By default, all nodes are assumed to be sensitive, and only nodes that does not have PII (Personally Identifiable Information - sensitive data such as email addresses, credit card numbers, passwords, etc...) should be marked as non-sensitive; a good rule of thumb is to mark as non-sensitive nodes whose value were statically set from resources.

Notice that the content of even sensitive nodes are sent to the service (through the android.service.autofill.AutofillService#onSaveRequest(android.service.autofill.SaveRequest, android.service.autofill.SaveCallback) call) when the user consented to save thedata, so it is important to set the content of sensitive nodes as well, but mark them as sensitive.

Should only be set when the node is used for autofill purposes - it will be ignored when used for Assist.

Java documentation for android.view.ViewStructure.setDataIsSensitive(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to