Skip to content

Commit f7c452c

Browse files
committed
fix: Fix the biometric authentication refresh not being timely.
Fix the biometric authentication refresh not being timely. Log: Fix the biometric authentication refresh not being timely. pms: BUG-332419
1 parent b6099f4 commit f7c452c

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

src/plugin-authentication/operation/charamangerworker.cpp

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -243,6 +243,9 @@ void CharaMangerWorker::refreshDriverInfo()
243243
{
244244
auto driverInfo = m_charaMangerInter->driverInfo();
245245
predefineDriverInfo(driverInfo);
246+
247+
auto defaultDevice = m_charaMangerInter->defaultDevice();
248+
refreshFingerDriverStatus(defaultDevice);
246249
}
247250

248251
void CharaMangerWorker::entollStart(const QString &driverName, const int &charaType, const QString &charaName)
@@ -412,3 +415,19 @@ void CharaMangerWorker::renameFingerItem(const QString &userName, const QString
412415
m_charaMangerInter->RenameFinger(userName, finger, newName);
413416
refreshFingerEnrollList(userName);
414417
}
418+
419+
void CharaMangerWorker::refreshFingerDriverStatus(const QString &defaultDevice)
420+
{
421+
bool isFingerValid = !defaultDevice.isEmpty();
422+
m_model->setFingerVaild(isFingerValid);
423+
424+
if (isFingerValid) {
425+
struct passwd *pws;
426+
QString userId;
427+
pws = getpwuid(getuid());
428+
userId = QString(pws->pw_name);
429+
refreshFingerEnrollList(userId);
430+
} else {
431+
m_model->setThumbsList(QStringList());
432+
}
433+
}

src/plugin-authentication/operation/charamangerworker.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ public Q_SLOTS:
8181
void stopFingerEnroll(const QString& userName);
8282
void deleteFingerItem(const QString& userName, const QString& finger);
8383
void renameFingerItem(const QString& userName, const QString& finger, const QString& newName);
84+
void refreshFingerDriverStatus(const QString &defaultDevice);
8485

8586
private:
8687
CharaMangerModel *m_model;

0 commit comments

Comments
 (0)