語言

DevicePolicyManager.SetPasswordHistoryLength(ComponentName, Int32) 方法

定義

由管理該裝置的應用程式呼叫來設定密碼歷史長度。

[Android.Runtime.Register("setPasswordHistoryLength", "(Landroid/content/ComponentName;I)V", "GetSetPasswordHistoryLength_Landroid_content_ComponentName_IHandler")]
public virtual void SetPasswordHistoryLength(Android.Content.ComponentName admin, int length);
[<Android.Runtime.Register("setPasswordHistoryLength", "(Landroid/content/ComponentName;I)V", "GetSetPasswordHistoryLength_Landroid_content_ComponentName_IHandler")>]
abstract member SetPasswordHistoryLength : Android.Content.ComponentName * int -> unit
override this.SetPasswordHistoryLength : Android.Content.ComponentName * int -> unit

參數

admin
ComponentName

這個請求就是和這個 DeviceAdminReceiver 問題有關的。

length
Int32

新的密碼紀錄長度。 值為 0 表示沒有限制。

屬性

備註

由管理該裝置的應用程式呼叫來設定密碼歷史長度。 設定後,使用者將無法輸入與歷史紀錄中任何密碼相同的新密碼。 請注意,目前的密碼會保留,直到使用者設定新密碼為止,因此更改不會立即生效。 要提示使用者輸入新密碼,請使用 #ACTION_SET_NEW_PASSWORD 或 #ACTION_SET_NEW_PARENT_PROFILE_PASSWORD 在設定此值後。

在不支援 PackageManager#FEATURE_SECURE_LOCK_SCREEN 此功能的裝置上,密碼歷史長度永遠為 0。

呼叫裝置管理員必須已申請能夠呼叫此方法;若未請求 DeviceAdminInfo#USES_POLICY_LIMIT_PASSWORD ,將拋出安全例外。

此方法可在回傳的#getParentProfileInstance(ComponentName)實例上呼叫DevicePolicyManager,以設定父設定檔的限制。

Java 文件 android.app.admin.DevicePolicyManager.setPasswordHistoryLength(android.content.ComponentName, int)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於