Skip to content

Commit

Permalink
[nemo-qml-plugin-devicelock] Report locked out status when max tries …
Browse files Browse the repository at this point in the history
…is exceeded. Contributes to JB#37380

Without this change both temporary (partially missing) and
permanently locked out entered to locked out state through IncorrectSecurityCode.
Thus, reported feedback looked like:

feedback: 15 remaining: -1
feedback: 12 remaining: 0
feedback: 15 remaining: -1

Even thou final state is correct this caused flickering. Further, I think
that there's no need to report last incorrect security code separately.
I'd rather consider all locked out cases implicitly incorrect security
code attempts on the user interface side if needed.
  • Loading branch information
rainemak committed Mar 20, 2017
1 parent 6388605 commit d40c0b7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/nemo-devicelock/host/hostdevicelock.cpp
Expand Up @@ -171,11 +171,12 @@ void HostDeviceLock::enterSecurityCode(const QString &code)
default: {
const int maximum = maximumAttempts();

if (maximum > 0) {
feedback(AuthenticationInput::IncorrectSecurityCode, qMax(0, maximum - result));

if (maximum > 0) {
if (result >= maximum) {
lockedOut();
} else {
feedback(AuthenticationInput::IncorrectSecurityCode, qMax(0, maximum - result));
}
} else {
feedback(AuthenticationInput::IncorrectSecurityCode, -1);
Expand Down

0 comments on commit d40c0b7

Please sign in to comment.