Jump to content

Directing user to set device PIN broken


Recommended Posts

There's a requirement in our product to have the user set a device PIN. Sadly, redirecting the user to the Android Set Device PIN screen is inconsistent and broken.   

In Android, you can test for device PIN / password using:


KeyguardManager keyguardManager = (KeyguardManager) unityActivityContext.getSystemService(Context.KEYGUARD_SERVICE);
bool isSet = keyguardManager.isKeyguardSecure();

You can then redirect the user to set a device PIN using:


Intent pinSetIntent = new Intent(DevicePolicyManager.ACTION_SET_NEW_PASSWORD);

We are experiencing the following issues:

  • sometimes keyboard does not show to allow user to enter PIN
  • sometimes a black screen is shown instead of the settings screen
  • if user already has a device PIN set, PIN cannot be changed as there is a crash after entering the current PIN to authorize the change
  • sometimes nothing happens at all

Can a member of VIVE support please:

  1. confirm the recommended way for an app to enforce a device PIN be set?
  2. confirm how to reliably redirect users to the 'Set device PIN' screen?

Thanks! @Corvus @Tony PH Lin @Dario

Link to comment
Share on other sites

  • 2 weeks later...

@HackPerception how is an app meant to direct or enforce the user set a device PIN? 

Are the standard Android APIs meant to be used or is there an alternative?

These are the steps a user can take to achieve it manually; but it'd be great if we could direct users there programmatically and check that the outcome is as required (PIN has been set):


Thanks @Tony PH Lin

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Create New...