Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9669549c authored by Eric Biggers's avatar Eric Biggers
Browse files

Split getHashFactorInternal() from getHashFactor()

Move the core of getHashFactor() into a new method
getHashFactorInternal().  Make updatePasswordHistory() call
getHashFactorInternal() instead of getHashFactor().  This follows the
best practice for service implementations by not re-entering the Binder
interface as part of the implementation of a different method in the
interface.  Specifically, it avoids a redundant permission check that is
needed only for incoming Binder calls.

(updatePasswordHistory() is part of the implementation of
ILockSettings#setLockCredential() and
LockSettingsInternal#setLockCredentialWithToken().
ILockSettings#setLockCredential() already does its own permission check
and clears the calling identity.  LockSettingsInternal methods are
callable only by system_server itself and are not expected to check
permissions; indeed, the only caller of setLockCredentialWithToken()
does its own permission check and clears the calling identity.)

No functional change other than removing redundant work.

Test: atest FrameworksServicesTests:com.android.server.locksettings
Bug: 320392352
Bug: 416768837
Flag: EXEMPT refactor
Change-Id: Iba3687cbe3db9cbbcb23f029111aa3208d4bd5a5
parent 9133f2f0
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment