Repository navigation
Conversation
… visible…" This reverts commit 17bd7f2.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Ivy233 The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
CLA Assistant Lite bot: You can retrigger this bot by commenting recheck in this Pull Request |
Reviewer's GuideThis PR reverts the previous camera privacy and camera-not-enabled behavior: status enums, documentation, privacy monitoring, DBus queries, watchdog detection, and deduplication are removed; camera failures again report generic exceptions, while face capability is determined by watching /dev/ for video devices. Flow diagram for camera capability detection and failure reportingflowchart TD
Init["DriverManger::init"] --> Watch["QFileSystemWatcher watches /dev/"]
Watch --> Change["onDirectoryChanged"]
Change --> Video{Video device found}
Video -->|Yes| Face["setCharaType(FACECHARATYPE)"]
Video -->|No| Empty["setCharaType(EMPTYCHARATYPE)"]
Start["ErollThread::run or VerifyThread::run"] --> Camera["QMediaDevices::videoInputs"]
Camera --> Available{Camera available}
Available -->|Yes| Capture["Start capture"]
Available -->|No| Exception["processStatus(..., FaceEnrollException)"]
Capture --> Error["captureError"]
Error --> Exception
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto reviewAI 代码审查报告
总体评价
本次 PR 是对 PR #59 的 Revert 操作,撤销了"摄像头未开启状态报告和人脸入口可见性保持"功能,恢复到原始实现。Revert 操作本身目的明确,但恢复后的代码重新引入了原始版本中存在的空指针解引用缺陷:当摄像头设备不可用时, 漏洞对比统计:新增漏洞 0 个,减少漏洞 0 个,持平 0 个 四维度评分维度1: 语法逻辑 (0/25) ✕
问题列表:
维度2: 代码质量 (21/25) ✓
问题列表:
优点:
维度3: 代码性能 (20/20) ✓
分析:
维度4: 代码安全 (30/30) ✓
分析:
修改文件清单
改进建议建议修复代码示例修复 void ErollThread::Stop()
{
qDebug() << "ErollThread::Stop thread:" << QThread::currentThreadId();
// 增加空指针防护,避免摄像头未打开成功时崩溃
if (!m_imageCapture.isNull()) {
disconnect(m_imageCapture.data(), &QImageCapture::readyForCaptureChanged, this, &ErollThread::readyForCapture);
disconnect(m_imageCapture.data(), &QImageCapture::imageCaptured, this, &ErollThread::processCapturedImage);
disconnect(m_imageCapture.data(), QOverload<int, QImageCapture::Error, const QString &>::of(&QImageCapture::errorOccurred),
this, &ErollThread::captureError);
}
m_stopCapture = true;
if (!m_camera.isNull()) {
m_camera->stop();
}
m_camera.reset();
while (!m_checkDone) {
qDebug() << "wait check done thread:" << QThread::currentThreadId();
QThread::msleep(100);
continue;
}
qDebug() << "check done";
close(m_fileSocket);
}修复 void VerifyThread::Stop()
{
qDebug() << "VerifyThread::Stop thread:" << QThread::currentThreadId();
// 当关闭相机后, 会取消图片的抓取, 此时不需要去处理抓取的图片
if (!m_imageCapture.isNull()) {
disconnect(m_imageCapture.data(), &QImageCapture::imageCaptured, this, &VerifyThread::processCapturedImage);
}
if (!m_camera.isNull()) {
m_camera->stop();
}
for (int i = 0; i < m_charaDatas.size(); i++) {
if (m_charaDatas[i] != nullptr) {
free(m_charaDatas[i]);
}
}
m_camera.reset();
m_charaDatas.clear();
}修复 // VerifyThread::run() 中
// 修改前: Q_EMIT processStatus(m_actionId, FaceEnrollException);
// 修改后:
Q_EMIT processStatus(m_actionId, FaceVerifyException);
// VerifyThread::captureError() 中
// 修改前: Q_EMIT processStatus(m_actionId, FaceEnrollException);
// 修改后:
Q_EMIT processStatus(m_actionId, FaceVerifyException);审查结论本次 Revert PR 的目的是撤销 PR #59 中添加的摄像头隐私开关检测功能,恢复到原始实现。Revert 操作本身目的明确,代码变更与目的一致。但恢复后的代码重新引入了原始版本中存在的两个严重空指针解引用缺陷( 本报告由 AI 代码审查系统自动生成 |
|
邮箱不对、SPDX也不对,已经交给https://github.com/linuxdeepin/deepin-face/pull/63跟进。 |
|
TAG Bot New tag: 2.0.18 |
Reverts #59
Summary by Sourcery
Revert dedicated camera privacy and camera-not-enabled reporting behavior in favor of the previous face authentication flow.
Enhancements:
Documentation:
Chores: