public static final class TriggerInfo.Builder extends Object
TriggerInfo objects.SystemCapability.Notification#ANS| 构造器 | 说明 |
|---|---|
Builder() |
Default constructor used to create a
Builder instance. |
| 限定符和类型 | 方法 | 说明 |
|---|---|---|
TriggerInfo |
build() |
Creates a
TriggerInfo object using all of the settings. |
TriggerInfo.Builder |
setCode(int code) |
Sets the result code provided for the target of the
IntentAgent. |
TriggerInfo.Builder |
setIntent(Intent intent) |
Sets a custom
Intent. |
TriggerInfo.Builder |
setIntentParams(IntentParams params) |
Sets custom data.
|
TriggerInfo.Builder |
setPermission(String permission) |
Sets the permission that the
IntentAgent recipient must have. |
public TriggerInfo.Builder setPermission(String permission)
IntentAgent recipient must have.permission - Indicates the permission to set. This parameter is valid only when the IntentAgent
to trigger is intended to send a common event.Builder object with the specified permission.public TriggerInfo.Builder setIntentParams(IntentParams params)
params - Indicates the custom data to set.Builder object with the custom data.public TriggerInfo.Builder setIntent(Intent intent)
Intent.intent - Indicates the custom Intent to set. If the member variable flags of the
IntentAgentInfo contains IntentAgentConstant.Flags#CONSTANT_FLAG, this parameter does not
take effect. If flags contains IntentAgentConstant.Flags#REPLACE_ELEMENT,
IntentAgentConstant.Flags#REPLACE_ACTION, IntentAgentConstant.Flags#REPLACE_URI,
IntentAgentConstant.Flags#REPLACE_ENTITIES, and IntentAgentConstant.Flags#REPLACE_BUNDLE,
the element, action, uri, entities, and bundleName attributes of the
Intent specified in this parameter will be used to replace the corresponding
attributes in the original Intent, respectively. If this parameter is null, the
original Intent remains unchanged.Builder object with the custom Intent.public TriggerInfo.Builder setCode(int code)
IntentAgent.code - Indicates the result code provided for the target of the IntentAgent.Builder object with the specified result code.public TriggerInfo build()
TriggerInfo object using all of the settings.TriggerInfo object.