Skip to content

Revert "fix: report camera-not-enabled status and keep the face entry… - #63

Merged
Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/revert-pull-59
Oct 16, 2026
Merged

Ivy233 merged 1 commit into
linuxdeepin:masterfrom
Ivy233:fix/revert-pull-59

Conversation

@Ivy233

@Ivy233 Ivy233 commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

… visible (#59)"

This reverts commit 17bd7f2.

The change removed the /dev video-node watcher and always reported FACECHARATYPE, so the control center still showed the face entry on machines without a camera (BUG-379893). Revert it and restore the previous behavior.

  1. Remove FaceEnrollCameraNotEnabled / FaceVerifyCameraNotEnabled (15) from the status enums, the corresponding status messages and the service interface documentation.
  2. Remove the camera privacy DConfig watch, the 1-second runtime watchdog in the enroll/verify threads, the queryCameraPrivacy()/ GetCameraPrivacy checks and the camera-not-enabled reporting paths; restore the previous captureError handling and Stop() behavior in ErollThread/VerifyThread.
  3. Restore the /dev video-node watcher in DriverManger::init(); CharaType again follows the camera device presence, so the face entry is hidden when the camera is switched off.

Log: revert camera-not-enabled status reporting and restore the /dev watcher

Influence:

  1. Camera FN key off: the face entry is hidden again as before the change; enrollment/verification with the camera off restore the previous generic error handling.
  2. Camera on: enrollment and verification work normally.
  3. Machines without a camera: the face entry is hidden again (the restored /dev watcher sets EMPTYCHARATYPE).

Revert "fix: 摄像头未开启上报专用状态码并保持人脸入口始终展示"

此提交回退 17bd7f2。

该提交移除了 /dev 视频节点监听并恒上报 FACECHARATYPE,导致无摄像头
机型控制中心仍展示人脸入口(BUG-379893)。现回退该改动,恢复原有
行为。

  1. 从状态枚举、状态文案及服务接口文档中移除 FaceEnrollCameraNotEnabled / FaceVerifyCameraNotEnabled(15)。
  2. 移除相机隐私 DConfig 监听、录入/验证线程的 1 秒看门狗、 queryCameraPrivacy()/GetCameraPrivacy 查询及“摄像头未开启”上报 路径;ErollThread/VerifyThread 的 captureError 处理与 Stop() 行为 恢复原有实现。
  3. 恢复 DriverManger::init() 中的 /dev 视频节点监听,CharaType 重新 跟随摄像头设备状态,摄像头关闭时人脸入口恢复隐藏。

Log: 回退摄像头未开启状态码上报并恢复 /dev 视频节点监听

Influence:

  1. 摄像头FN键关闭:人脸入口恢复隐藏(与改动前一致);摄像头未开启 时录入/验证恢复原有通用错误处理。
  2. 摄像头正常:录入、验证流程正常工作。
  3. 无摄像头机型:人脸入口恢复隐藏(恢复的 /dev 监听会置为 EMPTYCHARATYPE)。

PMS: BUG-379893

Summary by Sourcery

Restore the previous camera-device availability behavior and remove dedicated camera-not-enabled status reporting.

Bug Fixes:

  • Restore hiding the face-authentication entry when no camera device is present or the camera is disabled.
  • Restore generic enrollment and verification error handling when camera capture is unavailable.

Enhancements:

  • Restore monitoring of /dev video nodes to determine face-authentication availability.
  • Remove dedicated camera-not-enabled statuses and the associated privacy-switch reporting and runtime watchdog behavior.

Documentation:

  • Update the biometric authentication service interface documentation to remove the camera-not-enabled status values.

@sourcery-ai

sourcery-ai Bot commented Oct 16, 2026

Copy link
Copy Markdown

Reviewer's Guide

Reverts the camera-not-enabled reporting implementation by removing its status/API and privacy-watchdog machinery, restoring generic capture failures and prior cleanup behavior, and reinstating /dev video-node monitoring so face capability follows camera presence.

Sequence diagram for restored camera capture error handling

sequenceDiagram
    participant Client
    participant DriverManger
    participant CaptureThread
    participant QCamera

    Client->>DriverManger: enrollStart()
    DriverManger->>CaptureThread: Start()
    CaptureThread->>QCamera: start()
    QCamera-->>CaptureThread: captureError()
    CaptureThread->>DriverManger: processStatus(FaceEnrollException)
    DriverManger-->>Client: generic capture failure

    Client->>DriverManger: verifyStart()
    DriverManger->>CaptureThread: Start()
    CaptureThread->>QCamera: start()
    QCamera-->>CaptureThread: captureError()
    CaptureThread->>DriverManger: processStatus(FaceVerifyException)
    DriverManger-->>Client: generic capture failure
Loading

File-Level Changes

Change Details Files
Revert dedicated camera-not-enabled status reporting and return enrollment/verification to generic exception handling.
  • Removed camera-not-enabled values from enrollment and verification enums, status messages, and service documentation.
  • Removed camera privacy D-Bus/DConfig checks, runtime availability watchdogs, and unavailable-camera reporting paths.
  • Restored prior capture-error handling and camera stop/cleanup behavior in both worker threads.
definehead.h
doc/uos-biometric-authentication-service-interface.md
workmodule.cpp
workmodule.h
Restore camera presence as the source of face capability state so the face entry is hidden when no video device is available.
  • Reintroduced QFileSystemWatcher monitoring of /dev and initialized the capability from the current directory contents.
  • Set CharaType to FACECHARATYPE when a video node is found and EMPTYCHARATYPE otherwise.
  • Removed privacy-reporting deduplication state and related initialization hooks.
drivermanger.cpp
drivermanger.h

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

… visible (linuxdeepin#59)"

This reverts commit 17bd7f2.

The change removed the /dev video-node watcher and always reported
FACECHARATYPE, so the control center still showed the face entry on
machines without a camera (BUG-379893). Revert it and restore the
previous behavior.

1. Remove FaceEnrollCameraNotEnabled / FaceVerifyCameraNotEnabled (15)
   from the status enums, the corresponding status messages and the
   service interface documentation.
2. Remove the camera privacy DConfig watch, the 1-second runtime
   watchdog in the enroll/verify threads, the queryCameraPrivacy()/
   GetCameraPrivacy checks and the camera-not-enabled reporting paths;
   restore the previous captureError handling and Stop() behavior in
   ErollThread/VerifyThread.
3. Restore the /dev video-node watcher in DriverManger::init();
   CharaType again follows the camera device presence, so the face
   entry is hidden when the camera is switched off.

Log: revert camera-not-enabled status reporting and restore the /dev watcher

Influence:
1. Camera FN key off: the face entry is hidden again as before the
   change; enrollment/verification with the camera off restore the
   previous generic error handling.
2. Camera on: enrollment and verification work normally.
3. Machines without a camera: the face entry is hidden again (the
   restored /dev watcher sets EMPTYCHARATYPE).

Revert "fix: 摄像头未开启上报专用状态码并保持人脸入口始终展示"

此提交回退 17bd7f2。

该提交移除了 /dev 视频节点监听并恒上报 FACECHARATYPE,导致无摄像头
机型控制中心仍展示人脸入口(BUG-379893)。现回退该改动,恢复原有
行为。

1. 从状态枚举、状态文案及服务接口文档中移除
   FaceEnrollCameraNotEnabled / FaceVerifyCameraNotEnabled(15)。
2. 移除相机隐私 DConfig 监听、录入/验证线程的 1 秒看门狗、
   queryCameraPrivacy()/GetCameraPrivacy 查询及“摄像头未开启”上报
   路径;ErollThread/VerifyThread 的 captureError 处理与 Stop() 行为
   恢复原有实现。
3. 恢复 DriverManger::init() 中的 /dev 视频节点监听,CharaType 重新
   跟随摄像头设备状态,摄像头关闭时人脸入口恢复隐藏。

Log: 回退摄像头未开启状态码上报并恢复 /dev 视频节点监听

Influence:
1. 摄像头FN键关闭:人脸入口恢复隐藏(与改动前一致);摄像头未开启
   时录入/验证恢复原有通用错误处理。
2. 摄像头正常:录入、验证流程正常工作。
3. 无摄像头机型:人脸入口恢复隐藏(恢复的 /dev 监听会置为
   EMPTYCHARATYPE)。

PMS: BUG-379893
@Ivy233
Ivy233 force-pushed the fix/revert-pull-59 branch from ce41cdb to c6dd251 Compare October 16, 2026 09:29

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've found 1 issue

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="drivermanger.cpp" line_range="77" />
<code_context>
 }
 void DriverManger::init()
 {
</code_context>
<issue_to_address>
**Privacy toggle leaves capture active**

When a user enables the camera privacy switch during an active enroll or verify session while the V4L2 node remains present and available, the privacy-state checks no longer report the switch change, while `processCapturedImage` continues capturing and processing frames; enrollment also sends frames over its socket to the client, which continues receiving camera data after privacy is enabled.

Retain privacy-state monitoring and stop the active capture session when the camera privacy switch is enabled.

Also at `workmodule.cpp:249`, `workmodule.cpp:548`.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread drivermanger.cpp Resolved
@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: fly602, Ivy233

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Ivy233
Ivy233 merged commit dc22a69 into linuxdeepin:master Oct 16, 2026
5 of 6 checks passed
@Ivy233
Ivy233 deleted the fix/revert-pull-59 branch October 16, 2026 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants