Search code examples
androidpasswordsandroid-source

Looking for the AOSP Settings class to set the PIN


In the AOSP source code for the Settings app, there are several classes pertaining to the lock screen, i.e. ChooseLockPassword.java. However, I cannot find any comments or any documentation regarding which class actually pertains to the PIN.

This is for an Android application I'm writing, in which I'd like to clone the Settings "set PIN" UI and functionality.

I can find ChooseLockPassword (for passwords containing letters), ChooseLockPattern (for Android lock patterns), and ChooseLockGeneric (which simply seems to determine which one to display at the given moment).

Unfortunately, I'm unable to find any classes that would allow you to set a PIN, only a pattern and a password.


Solution

  • ChooseLockPassword.java File handles Password and PIN both.

    Based on Input selection PIN the numeric keyboard (mPasswordEntry.getInputType()) is presented and input is converted to String and passed for validation of the password. Method validatePassword(String password)`