Unlock non-secure users automatically (1/2)
...while moving apps or media content from internal storage to
adopted storage and vice-versa.
Currently, for FBE enabled devices, whenever move is triggered for
either app or media content, there is a prompt for user to enter their
lockscreen credential in order to unlock storage if the user has one.
But if the user does not have a lockscreen credential set and is not
running,the wizard page is stuck. This leads to a bad user experience.
This CL adds a new binder method
ILockSettings#unlockUserKeyIfUnsecured(int) which can be used for
unlocking users which do not have a lockscreen credential. This replaces
the LockSettingsInternal#unlockUserKeyIfUnsecured(int). This method is
used by LockPatternUtils#unlockUserKeyIfUnsecured instead of
LockSettingsInternal#unlockUserKeyIfUnsecured so that Settings app can
unlock users for the use-case explained above. This also modifies
SyntheticPasswordTests to use the binder method.
Bug: 305978187
Test: manual
Steps:
1. Create multiple users with atleast one user with an authentication
method setup and one without authentication (apart from system user)
2. Install same apps for all users and also add some content to the
media storage.
3. Format an SD Card as adopted.
4. Attempt to move content.
5. Check that the wizard is not stuck and it is prompting the locked
users to authenticate.
6. Reboot
7. After reboot, Go to Settings > All Apps > app_name
> Storage & Cache
8. Tap on "Change" under Storage and Select Adopted storage.
9. Check the same as Step#5
Also, ran atest com.android.server.locksettings and checked that the
all test cases are passing.
Change-Id: I34741c8e25cce256c2bfcc4dafb50e5d3e16f7ea
5 files changed