Skip to content

Harden active notification button indexing#7665

Open
AI-DEV-BOT wants to merge 1 commit into
Samsung:mainfrom
AI-DEV-BOT:codex/harden-active-notification-buttons
Open

Harden active notification button indexing#7665
AI-DEV-BOT wants to merge 1 commit into
Samsung:mainfrom
AI-DEV-BOT:codex/harden-active-notification-buttons

Conversation

@AI-DEV-BOT

@AI-DEV-BOT AI-DEV-BOT commented May 29, 2026

Copy link
Copy Markdown

Description of Change

Fix active notification button index assignment in NotificationActiveStyle.AddButtonAction().

When a ButtonAction is added with ButtonIndex.None, the method now assigns the first unused supported button slot from ButtonIndex.First through ButtonIndex.Third instead of deriving the index from buttonDictionary.Count. This avoids invalid indexes after three buttons and prevents duplicate-key failures when buttons have been removed.

Explicit button indexes are also validated so values outside the supported active notification button range fail with NotificationError.InvalidParameter.

Validation:

  • git diff --check

API Changes

  • ACR: N/A

None.

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request improves the button index assignment and validation logic in NotificationActiveStyle.cs by searching for the first available index within the valid range (First to Third) when no index is specified, and throwing appropriate exceptions for invalid or overflowing indices. There are no review comments, and I have no additional feedback to provide.

@JoonghyunCho

Copy link
Copy Markdown
Member

🤖 [AI Review]

Reviewed — no findings.

Scope checked:

  • Auto-assign path (button.Index == ButtonIndex.None) replaces (ButtonIndex)buttonDictionary.Count with a scan over First..Third for the first unused slot — correctly handles the post-remove gap case the old code mis-indexed.
  • New explicit-index validation upper-bounds at ButtonIndex.Third; values outside First..Third (previously silently inserted) now throw — consistent with ButtonIndex enum (None=-1, First=0, Second=1, Third=2, max 3 slots).
  • Both new throw sites use NotificationError.InvalidParameter, which NotificationErrorFactory.GetException maps to ArgumentException — already covered by the existing <exception cref="ArgumentException"> doc tag, so no new XML tag required.
  • Public method signature unchanged (public void AddButtonAction(ButtonAction)); existing <summary>, <param>, <since_tizen> remain accurate.
  • Loop termination is guaranteed: at most 3 iterations (First..Third inclusive), and return exits as soon as a slot is found.

No 🔴 critical issues, no 🟡 suggestions to flag.


Automated review — final merge decision rests with human reviewers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants