Skip to content

fix: exclude onboard from privacy FileAndFolder app list#2926

Merged
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wyu71:master
Jan 7, 2026
Merged

fix: exclude onboard from privacy FileAndFolder app list#2926
deepin-bot[bot] merged 1 commit into
linuxdeepin:masterfrom
wyu71:master

Conversation

@wyu71

@wyu71 wyu71 commented Jan 6, 2026

Copy link
Copy Markdown
Contributor
  • Added onboard and onboard-settings to s_excludeApp list to prevent screen keyboard from appearing in camera and file/folder permission lists.

Log: exclude onboard from privacy FileAndFolder app list
pms: BUG-346135

Summary by Sourcery

Bug Fixes:

  • Exclude onboard and onboard-settings from privacy FileAndFolder application lists so the on-screen keyboard does not appear for camera and file/folder permission dialogs.

@sourcery-ai

sourcery-ai Bot commented Jan 6, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the privacy security worker to exclude the onboard virtual keyboard and its settings application from the displayed application list when managing privacy permissions, preventing them from appearing in camera and file/folder permission UIs.

Class diagram for PrivacySecurityWorker exclude app list update

classDiagram
  class PrivacySecurityWorker {
    +addAppItem(int dataIndex) ApplicationItem
    -m_ddeAmModel
  }

  class AppItemModel {
    <<enum>>
    +NoDisplayRole
  }

  class ApplicationItem

  PrivacySecurityWorker --> ApplicationItem : creates
  PrivacySecurityWorker --> AppItemModel : uses

  class ExcludeAppList {
    <<static_config>>
    +s_excludeApp : QStringList
  }

  PrivacySecurityWorker --> ExcludeAppList : consults

  note for ExcludeAppList "s_excludeApp includes dde_computer, org_deepin_dde_control_center, dde_file_manager, dde_trash, deepin_manual, deepin_terminal, onboard, onboard_settings"
Loading

File-Level Changes

Change Details Files
Exclude the onboard virtual keyboard and its settings app from the privacy permissions application list.
  • Extend the static s_excludeApp QStringList with "onboard" and "onboard-settings" entries used to filter applications from privacy views
  • Ensure onboard-related apps are treated like other system utilities that are hidden from camera and file/folder permission lists
src/plugin-privacy/operation/privacysecurityworker.cpp

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

@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 left some high level feedback:

  • Consider adding a brief comment explaining why onboard and onboard-settings are excluded (e.g., virtual keyboard/UI-only), so future changes to the exclude list are easier to reason about.
  • If there are or may be other similar non-user-facing utility apps, it might be worth centralizing this exclusion list or deriving it from app metadata (e.g., a dedicated flag) rather than maintaining an ever-growing hardcoded list.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Consider adding a brief comment explaining why `onboard` and `onboard-settings` are excluded (e.g., virtual keyboard/UI-only), so future changes to the exclude list are easier to reason about.
- If there are or may be other similar non-user-facing utility apps, it might be worth centralizing this exclusion list or deriving it from app metadata (e.g., a dedicated flag) rather than maintaining an ever-growing hardcoded list.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@deepin-ci-robot

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: 18202781743, wyu71

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

@deepin-bot

deepin-bot Bot commented Jan 6, 2026

Copy link
Copy Markdown

TAG Bot

New tag: 6.1.66
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #2927

- Added onboard and onboard-settings to s_excludeApp list to prevent screen keyboard from appearing in camera and file/folder permission lists.

Log: exclude onboard from privacy FileAndFolder app list
pms: BUG-346135
@wyu71

wyu71 commented Jan 7, 2026

Copy link
Copy Markdown
Contributor Author

/forcemerge

@deepin-ci-robot

Copy link
Copy Markdown

deepin pr auto review

我来对这段代码进行审查分析:

  1. 代码逻辑分析:
    这段代码是在添加应用项时,定义了一个静态的排除应用列表s_excludeApp,新增了两个与屏幕键盘相关的应用:"onboard"和"onboard-settings"。这个修改是为了在隐私安全设置中排除这些应用。

  2. 代码质量建议:

  • 建议为s_excludeApp列表添加注释说明其用途
  • 可以考虑将排除列表配置化,而不是硬编码在代码中
  • 建议按照字母顺序排列应用名称,便于维护
  1. 代码性能:
  • 使用static const是好的实践,可以避免重复创建
  • 查找效率上,如果排除列表很长,建议使用QSet代替QStringList,因为QSet的查找时间复杂度是O(1),而QStringList是O(n)
  1. 代码安全:
  • 没有明显的安全隐患
  • 建议添加输入验证,确保dataIndex的有效性

改进建议代码:

// 需要在隐私安全设置中排除的系统应用列表
static const QSet<QString> s_excludeApp = {
    "dde-computer",
    "dde-file-manager",
    "dde-trash",
    "deepin-manual",
    "deepin-terminal",
    "onboard",
    "onboard-settings",
    "org.deepin.dde.control-center"
};

ApplicationItem *PrivacySecurityWorker::addAppItem(int dataIndex)
{
    // 添加输入验证
    if (dataIndex < 0 || dataIndex >= m_ddeAmModel->rowCount()) {
        return nullptr;
    }

    const auto &NoDisplay = m_ddeAmModel->data(m_ddeAmModel->index(dataIndex, 0), 
        DS_NAMESPACE::AppItemModel::NoDisplayRole).toBool();
    
    // 其他代码...
}

主要改进点:

  1. 添加了详细的注释说明
  2. 使用QSet替代QStringList提高查找效率
  3. 按字母顺序排列应用名称
  4. 添加了输入验证
  5. 改进了代码格式,提高可读性

@deepin-bot

deepin-bot Bot commented Jan 7, 2026

Copy link
Copy Markdown

This pr force merged! (status: blocked)

@deepin-bot deepin-bot Bot merged commit 3fa2fc4 into linuxdeepin:master Jan 7, 2026
14 of 18 checks passed
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