Skip to content

Commit

Permalink
[M106] rgbkbd: show nudge only if device is supported
Browse files Browse the repository at this point in the history
Fix a bug where the nudge was shown incorrectly for the devices that do
not have rgb capability.

BUG=b/243435252
TEST=Manually

(cherry picked from commit 747e99b)

Change-Id: I9af89f66a00a0933bb66240e579076f9cfa181da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3848706
Reviewed-by: James Cook <jamescook@chromium.org>
Commit-Queue: Jason Thai <jasontt@chromium.org>
Auto-Submit: Jason Thai <jasontt@chromium.org>
Commit-Queue: James Cook <jamescook@chromium.org>
Quick-Run: Jason Thai <jasontt@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1038027}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3851661
Cr-Commit-Position: refs/branch-heads/5249@{#48}
Cr-Branched-From: 4f7bea5-refs/heads/main@{#1036826}
  • Loading branch information
Jason Thai authored and Chromium LUCI CQ committed Aug 23, 2022
1 parent b5c8fd5 commit 1055f36
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion ash/system/unified/unified_slider_bubble_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

#include "ash/bubble/bubble_constants.h"
#include "ash/constants/ash_features.h"
#include "ash/rgb_keyboard/rgb_keyboard_manager.h"
#include "ash/root_window_controller.h"
#include "ash/session/session_controller_impl.h"
#include "ash/shelf/shelf.h"
Expand Down Expand Up @@ -122,7 +123,8 @@ void UnifiedSliderBubbleController::OnKeyboardBrightnessChanged(
// User has made a brightness adjustment, or the KBL was made
// no-longer-forced-off implicitly in response to a user adjustment.
ShowBubble(SLIDER_TYPE_KEYBOARD_BRIGHTNESS);
if (features::IsRgbKeyboardEnabled()) {
if (features::IsRgbKeyboardEnabled() &&
Shell::Get()->rgb_keyboard_manager()->IsRgbKeyboardSupported()) {
// Show the education nudge to change the keyboard backlight color if
// applicable. |bubble_view_| is used as the anchor view.
Shell::Get()
Expand Down

0 comments on commit 1055f36

Please sign in to comment.