Skip to content

type-c-service/ucsi: Fix excessive OPM notification#851

Open
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:v0.2.0from
RobertZ2011:ucsi-fix-battery-charge-notification
Open

type-c-service/ucsi: Fix excessive OPM notification#851
RobertZ2011 wants to merge 1 commit into
OpenDevicePartnership:v0.2.0from
RobertZ2011:ucsi-fix-battery-charge-notification

Conversation

@RobertZ2011
Copy link
Copy Markdown
Contributor

The existing implementation will always notify the OPM on PSU connect/disconnect even if the OPM hasn't enabled the corresponding notification.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the Type-C service’s UCSI integration to avoid notifying the OS Policy Manager (OPM) about PSU connect/disconnect events when the relevant UCSI notification isn’t enabled, reducing unnecessary OPM wakeups/processing.

Changes:

  • Gate PSU connect/disconnect-driven UCSI pending notifications on the “battery charge change” notification enable bit.
  • Broaden visibility of internal UCSI State fields to allow cross-module access from the power-policy event handler.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
type-c-service/src/service/ucsi.rs Makes UCSI State fields publicly accessible within the parent module to support notification gating logic elsewhere.
type-c-service/src/service/power.rs Avoids pended UCSI notifications on PSU connect/disconnect unless the corresponding UCSI notification is enabled.

Comment thread type-c-service/src/service/ucsi.rs
Comment thread type-c-service/src/service/power.rs
@RobertZ2011 RobertZ2011 marked this pull request as ready for review May 19, 2026 17:03
@RobertZ2011 RobertZ2011 requested a review from a team as a code owner May 19, 2026 17:03
The existing implementation will always notify the OPM on PSU
connect/disconnect even if the OPM hasn't enabled the corresponding
notification.
@RobertZ2011 RobertZ2011 force-pushed the ucsi-fix-battery-charge-notification branch from b10570c to 6ff117d Compare May 19, 2026 20:05
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