Ignore storage lock events if user does not exist
Storage lock events are relayed whenever CE storage corresponding to a
user is locked. If a user is removed immediately after locking the
storage, the storage events may be processed by LockSettingsService after
the user has been removed. With this change, we add a logic to catch the
IllegalArgumentExceptions sent by UserManager.getUserProperties whenever
it does not recognize the user id (or the user id has been removed), and
ignores the storage lock event in such cases.
Bug: 333615708
Test: atest CtsDevicePolicyTestCases
Ignore-AOSP-First: This change fixes a bug caused by a change that was merged
internally.
Change-Id: I75d7192b42cce62327edadc52af5f47c4e045945
1 file changed