mirror of
https://github.com/mudita/MuditaOS.git
synced 2026-01-02 19:08:54 -05:00
Fix of the issue that after blocking passcode from Center, Pure would still display passcode input popup; providing valid passcode there would result in phone entering invalid state, where it behaved as if it was unlocked, but with blocked passcode.
45 lines
1.1 KiB
C++
45 lines
1.1 KiB
C++
// Copyright (c) 2017-2023, Mudita Sp. z.o.o. All rights reserved.
|
|
// For licensing, see https://github.com/mudita/MuditaOS/LICENSE.md
|
|
|
|
#include "Lock.hpp"
|
|
|
|
namespace locks
|
|
{
|
|
void Lock::consumeState() noexcept
|
|
{
|
|
if (lockState == LockState::InputInvalid) {
|
|
lockState = LockState::InputRequired;
|
|
}
|
|
else if (lockState == LockState::NewInputInvalid) {
|
|
lockState = LockState::NewInputRequired;
|
|
}
|
|
else if (lockState == LockState::NewInputConfirmRequired) {
|
|
lockState = LockState::NewInputRequired;
|
|
}
|
|
}
|
|
|
|
void Lock::putNextChar(unsigned c)
|
|
{
|
|
if (maxInputSize > inputValue.size()) {
|
|
inputValue.push_back(c);
|
|
}
|
|
}
|
|
|
|
void Lock::popChar()
|
|
{
|
|
if (!inputValue.empty()) {
|
|
inputValue.pop_back();
|
|
}
|
|
}
|
|
|
|
void Lock::clearAttempt() noexcept
|
|
{
|
|
inputValue.clear();
|
|
}
|
|
|
|
void Lock::setNextUnlockAttemptFormattedTime(const std::string &time)
|
|
{
|
|
nextUnlockAttemptFormattedTime = time;
|
|
}
|
|
} // namespace locks
|