Skip to content

fix: Add WiFi password input flag for lock screen and login interface#515

Merged
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
ut003640:master
Mar 6, 2026
Merged

fix: Add WiFi password input flag for lock screen and login interface#515
deepin-bot[bot] merged 2 commits intolinuxdeepin:masterfrom
ut003640:master

Conversation

@ut003640
Copy link
Contributor

@ut003640 ut003640 commented Mar 5, 2026

Added a flag to the NetManagerFlag enum in nettype.h to enable WiFi password input functionality on lock screen and login interface. When the lock screen or login interface detects this flag, it will display a WiFi password input dialog, allowing users to enter WiFi passwords to connect to networks. This addresses the issue where users couldn't connect to WiFi networks from lock screen or login screen due to missing password input capability.

The bug was caused by the lack of proper flag configuration in the Net_LockFlags and Net_GreeterFlags enum values, which prevented the WiFi password input dialog from being triggered in lock screen and login scenarios.

Log: Added new flag configuration to enable WiFi password input functionality for lock screen and login interface scenarios.
PMG: BUG-350613

fix: 为锁屏和登录界面添加WiFi密码输入标记

在nettype.h文件的NetManagerFlag枚举中添加了标记,用于在锁屏和登录界面启用WiFi密码输入功能。当锁屏或登录界面检测到此标记时,将显示WiFi密码输入对话框,允许用户输入WiFi密码来连接网络。这解决了用户在锁屏或登录界面无法连接WiFi网络的问题。

该bug的原因是Net_LockFlags和Net_GreeterFlags枚举值中缺少适当的标记配置,导致在锁屏和登录场景下无法触发WiFi密码输入对话框。

Log: 添加新的标记配置,启用锁屏和登录界面的WiFi密码输入功能。

Summary by Sourcery

Bug Fixes:

  • Allow WiFi password input dialogs to appear on lock screen and login interfaces by adding the missing Net_autoUpdateHiddenConfig flag to Net_LockFlags and Net_GreeterFlags.

Added a flag to the NetManagerFlag enum in nettype.h to enable WiFi password input functionality on lock screen and login interface. When the lock screen or login interface detects this flag, it will display a WiFi password input dialog, allowing users to enter WiFi passwords to connect to networks. This addresses the issue where users couldn't connect to WiFi networks from lock screen or login screen due to missing password input capability.

The bug was caused by the lack of proper flag configuration in the Net_LockFlags and Net_GreeterFlags enum values, which prevented the WiFi password input dialog from being triggered in lock screen and login scenarios.

Log: Added new flag configuration to enable WiFi password input functionality for lock screen and login interface scenarios.
PMG: BUG-350613

fix: 为锁屏和登录界面添加WiFi密码输入标记

在nettype.h文件的NetManagerFlag枚举中添加了标记,用于在锁屏和登录界面启用WiFi密码输入功能。当锁屏或登录界面检测到此标记时,将显示WiFi密码输入对话框,允许用户输入WiFi密码来连接网络。这解决了用户在锁屏或登录界面无法连接WiFi网络的问题。

该bug的原因是Net_LockFlags和Net_GreeterFlags枚举值中缺少适当的标记配置,导致在锁屏和登录场景下无法触发WiFi密码输入对话框。

Log: 添加新的标记配置,启用锁屏和登录界面的WiFi密码输入功能。
@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: ut003640

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

@sourcery-ai
Copy link

sourcery-ai bot commented Mar 5, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates lock screen and greeter (login) network manager flag sets to include the hidden WiFi configuration/update capability so that WiFi password input dialogs are available in those contexts.

Sequence diagram for WiFi password prompt on lock screen

sequenceDiagram
    actor User
    participant LockScreenUI
    participant NetManager
    participant SecretAgent

    User->>LockScreenUI: openWifiPanel()
    LockScreenUI->>NetManager: requestNetworks(contextLock, Net_LockFlags)
    NetManager-->>LockScreenUI: availableNetworks
    User->>LockScreenUI: selectNetwork(ssid)
    LockScreenUI->>NetManager: connectNetwork(ssid, contextLock, Net_LockFlags)
    NetManager->>NetManager: checkFlags(Net_LockFlags)
    NetManager->>NetManager: hasFlag(Net_autoUpdateHiddenConfig)
    NetManager->>SecretAgent: requestWifiCredentials(ssid)
    SecretAgent-->>User: showPasswordDialog(ssid)
    User->>SecretAgent: submitPassword(password)
    SecretAgent-->>NetManager: provideCredentials(ssid, password)
    NetManager-->>LockScreenUI: connectionResult(success)
    LockScreenUI-->>User: showConnectionStatus(success)
Loading

Class diagram for updated NetType flags

classDiagram
    class NetType {
        <<enumeration>>
        Net_Device
        Net_VPN
        Net_SysProxy
        Net_Airplane
        Net_AirplaneTips
        Net_VPNTips
        Net_ServiceNM
        Net_AutoAddConnection
        Net_UseSecretAgent
        Net_CheckPortal
        Net_8021xSendNotifyUnderConnect
        Net_autoUpdateHiddenConfig
        Net_LockFlags
        Net_GreeterFlags
    }

    NetType <|-- Net_LockFlags
    NetType <|-- Net_GreeterFlags
    NetType <|-- Net_autoUpdateHiddenConfig
Loading

Flow diagram for flag-based WiFi password dialog enabling

flowchart TD
    A[Context: lock_or_greeter_screen] --> B[Determine flag_set]
    B --> C{Context_is_lock_screen?}
    C -- Yes --> D[Use Net_LockFlags]
    C -- No --> E[Use Net_GreeterFlags]
    D --> F{Flag_set_contains Net_autoUpdateHiddenConfig?}
    E --> F
    F -- Yes --> G[Enable_WiFi_password_dialog]
    F -- No --> H[Do_not_show_password_dialog]
    G --> I[User_can_enter_password_and_connect]
    H --> J[User_cannot_connect_to_protected_WiFi]
Loading

File-Level Changes

Change Details Files
Enable WiFi password input/hidden config updates on lock screen and greeter by adjusting NetManagerFlag combinations.
  • Extend Net_LockFlags to include the Net_autoUpdateHiddenConfig flag alongside existing network-related flags.
  • Extend Net_GreeterFlags to include the Net_autoUpdateHiddenConfig flag alongside existing network-related flags.
net-view/operation/nettype.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

Copy link

@sourcery-ai sourcery-ai bot left a comment

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:

  • The three flag sets (Net_DockFlags, Net_LockFlags, Net_GreeterFlags) are very similar and now diverge by only a couple of bits; consider factoring shared combinations into named base masks or helper functions to make it harder to accidentally miss new flags in one of the variants in future changes.
  • If Net_autoUpdateHiddenConfig is now the switch that enables WiFi password entry on lock/greeter, consider either renaming it or adding a more focused flag so that the enum value’s name reflects its behavioral effect rather than overloading a seemingly unrelated configuration concept.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The three flag sets (Net_DockFlags, Net_LockFlags, Net_GreeterFlags) are very similar and now diverge by only a couple of bits; consider factoring shared combinations into named base masks or helper functions to make it harder to accidentally miss new flags in one of the variants in future changes.
- If Net_autoUpdateHiddenConfig is now the switch that enables WiFi password entry on lock/greeter, consider either renaming it or adding a more focused flag so that the enum value’s name reflects its behavioral effect rather than overloading a seemingly unrelated configuration concept.

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-bot
Copy link
Contributor

deepin-bot bot commented Mar 5, 2026

TAG Bot

New tag: 2.0.84
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #516

@deepin-ci-robot
Copy link

deepin pr auto review

这段代码修改主要涉及 NetType 类中三个标志位组合变量的定义变更。以下是对这段 diff 的审查意见,包括语法逻辑、代码质量、代码性能和代码安全方面的分析:

1. 语法逻辑

  • 正确性:修改后的代码在语法上是正确的。它使用了位或运算符 (|) 将多个枚举值组合在一起,这是定义标志位掩码的常规做法。
  • 一致性:修改将 Net_autoUpdateHiddenConfig 标志位添加到了 Net_LockFlagsNet_GreeterFlags 中,使其与 Net_DockFlags 保持了一致(Net_DockFlags 在此之前已经包含了该标志)。这表明逻辑意图是希望在锁屏和欢迎界面(Greeter)也具备自动更新隐藏配置的能力。

2. 代码质量

  • 可读性

    • 当前的写法将所有的标志位写在同一行,随着标志位的增加,行会变得非常长,不利于阅读和对比。
    • 建议:考虑将每个标志位单独写在一行,或者使用更合理的换行,这样在 Code Review 时更容易看出增加或减少了哪些标志。
    • 示例
      Net_LockFlags = Net_Device
                    | Net_VPN
                    | Net_SysProxy
                    // ...
                    | Net_autoUpdateHiddenConfig,
  • 命名规范

    • Net_autoUpdateHiddenConfig 使用了 autoUpdate 的小驼峰命名,而其他标志如 Net_DeviceNet_VPN 使用的是大驼峰(帕斯卡命名)。虽然这可能是历史遗留问题,但在新增代码时应尽量保持风格统一。如果可以,建议统一为 Net_AutoUpdateHiddenConfig

3. 代码性能

  • 编译期计算:这些标志位的组合都是常量表达式,会在编译期计算完成。因此,这种修改对程序的运行时性能没有任何影响。
  • 内存占用:由于只是增加了一个掩码位的定义,并没有增加新的数据成员或运行时逻辑,因此不会增加内存占用。

4. 代码安全

  • 逻辑安全性
    • 需要确认在 Net_LockFlags(锁屏界面)和 Net_GreeterFlags(欢迎/登录界面)中启用 Net_autoUpdateHiddenConfig 是否符合安全策略。
    • 通常锁屏和登录界面是受限环境。如果 Net_autoUpdateHiddenConfig 涉及到网络配置的自动更新或敏感操作,需要确保在这些受限状态下开启该功能不会导致权限提升或未授权的配置更改。
    • 建议:请确认业务逻辑,确保在用户未登录或锁屏状态下,自动更新隐藏配置的行为是预期且安全的。

总结与改进建议

这段代码修改本身没有语法错误,逻辑上主要是为了统一不同界面(Dock、Lock、Greeter)对 Net_autoUpdateHiddenConfig 的支持。

改进建议:

  1. 格式化:为了提高可维护性,建议将过长的位或运算表达式进行多行排版。
  2. 命名检查:检查 Net_autoUpdateHiddenConfig 的命名是否符合项目规范,如果不符,建议重命名以保持一致性。
  3. 安全审查:重点审查在锁屏和欢迎界面开启此功能的具体实现代码,确保没有安全漏洞。

改进后的代码示例(仅参考格式):

// 建议的多行写法,便于阅读和 Diff
Net_LockFlags = Net_Device 
              | Net_VPN 
              | Net_SysProxy 
              | Net_Airplane 
              | Net_AirplaneTips 
              | Net_VPNTips 
              | Net_UseSecretAgent 
              | Net_CheckPortal 
              | Net_8021xSendNotifyUnderConnect 
              | Net_autoUpdateHiddenConfig,

@ut003640
Copy link
Contributor Author

ut003640 commented Mar 6, 2026

/merge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 6, 2026

This pr cannot be merged! (status: unstable)

@ut003640
Copy link
Contributor Author

ut003640 commented Mar 6, 2026

/forcemerge

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 6, 2026

This pr force merged! (status: unstable)

@deepin-bot deepin-bot bot merged commit 5c44316 into linuxdeepin:master Mar 6, 2026
17 of 19 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