I tried to use the Android password expiration function using DeviceAdmin . When I call the setPasswordExpirationTimeout() API, it only sends a notification and does not actually force the user to change the password. It sends a notification only after a timeout:
V / DevicePolicyManagerService (662): Sending action notification password com.android.server.ACTION_EXPIRED_PASSWORD_NOTIFICATION
You should receive a callback in DeviceAdminReceiver in onPasswordExpired () to force the user to change the password.
Any specific reason was implemented this way (or is it just to give flexibility to the programmer)?
The only opportunity I could see was to start working with the intention ACTION_SET_NEW_PASSWORD in the callback in DeviceAdminReceiver , which the user can cancel by simply clicking the "Cancel" button.
How to 100% force password change?
source share