NotificationManager.UpdateAutomaticZenRule(String, AutomaticZenRule) 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
更新給定的禪原則。
[Android.Runtime.Register("updateAutomaticZenRule", "(Ljava/lang/String;Landroid/app/AutomaticZenRule;)Z", "GetUpdateAutomaticZenRule_Ljava_lang_String_Landroid_app_AutomaticZenRule_Handler", ApiSince=24)]
public virtual bool UpdateAutomaticZenRule(string? id, Android.App.AutomaticZenRule? automaticZenRule);
[<Android.Runtime.Register("updateAutomaticZenRule", "(Ljava/lang/String;Landroid/app/AutomaticZenRule;)Z", "GetUpdateAutomaticZenRule_Ljava_lang_String_Landroid_app_AutomaticZenRule_Handler", ApiSince=24)>]
abstract member UpdateAutomaticZenRule : string * Android.App.AutomaticZenRule -> bool
override this.UpdateAutomaticZenRule : string * Android.App.AutomaticZenRule -> bool
參數
- id
- String
字串:更新規則的 ID
- automaticZenRule
- AutomaticZenRule
AutomaticZenRule:更新規則。
傳回
規則是否成功更新。
- 屬性
備註
更新給定的禪原則。 在Build.VERSION_CODES之前。VANILLA_ICE_CREAM,更新未被 ConditionProviderService 支援的規則,若該規則先前有效,則會將其停用。 從Build.VERSION_CODES開始。VANILLA_ICE_CREAM,只有當規則定義真正改變時,這才會發生。 若未授予此套件政策存取權限,則會拋出 SecurityException。 請參見 isNotificationPolicyAccessGranted()。 來電者只能更新他們擁有的規則。 請參見 AutomaticZenRule.getOwner。
本頁內容與程式碼範例受內容授權條款所規範。 Java 和 OpenJDK 是 Oracle 和/或其關係企業的商標或注冊商標。
最後更新於 2026-08-03 UTC。
Android 參考資料。android.app.NotificationManager.updateAutomaticZenRule
本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。