Commit 4d930717 authored by Sammie Quon's avatar Sammie Quon Committed by Commit Bot

system: Partial revert add monitor notification.

We are getting some pushback from system services team. Disable for M86
:(.

Test: manual
Bug: 1111479
Change-Id: Ifce10b92081a7c162758273221fedfe8de76563b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2367118
Commit-Queue: Sammie Quon <sammiequon@chromium.org>
Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#800287}
parent 032255a6
...@@ -411,13 +411,7 @@ void ScreenLayoutObserver::CreateOrUpdateNotification( ...@@ -411,13 +411,7 @@ void ScreenLayoutObserver::CreateOrUpdateNotification(
base::BindRepeating(&OnNotificationClicked)), base::BindRepeating(&OnNotificationClicked)),
kNotificationScreenIcon, kNotificationScreenIcon,
message_center::SystemNotificationWarningLevel::NORMAL); message_center::SystemNotificationWarningLevel::NORMAL);
// With the reduce display notifications feature enabled, we only want to show notification->set_priority(message_center::SYSTEM_PRIORITY);
// an add display notification, and it should disappear after a couple
// seconds.
auto priority = features::IsReduceDisplayNotificationsEnabled()
? message_center::DEFAULT_PRIORITY
: message_center::SYSTEM_PRIORITY;
notification->set_priority(priority);
Shell::Get()->metrics()->RecordUserMetricsAction( Shell::Get()->metrics()->RecordUserMetricsAction(
UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED); UMA_STATUS_AREA_DISPLAY_NOTIFICATION_CREATED);
...@@ -468,17 +462,9 @@ void ScreenLayoutObserver::OnDisplayConfigurationChanged() { ...@@ -468,17 +462,9 @@ void ScreenLayoutObserver::OnDisplayConfigurationChanged() {
return; return;
} }
// Alerting user of display added and unassociated display are allowed even // Alerting user unassociated display are allowed even when suppressed.
// when suppressed.
const bool exited_mirror = old_display_mode_ == DisplayMode::MIRRORING &&
current_display_mode_ != DisplayMode::MIRRORING;
const bool display_added =
!exited_mirror && old_info.size() < display_info_.size();
const bool allowed_notifications =
display_added || should_notify_has_unassociated_display;
if (features::IsReduceDisplayNotificationsEnabled() && if (features::IsReduceDisplayNotificationsEnabled() &&
!allowed_notifications) { !should_notify_has_unassociated_display) {
return; return;
} }
......
...@@ -48,7 +48,6 @@ class ScreenLayoutObserverTest : public AshTestBase { ...@@ -48,7 +48,6 @@ class ScreenLayoutObserverTest : public AshTestBase {
void ClickNotification(); void ClickNotification();
base::string16 GetDisplayNotificationText() const; base::string16 GetDisplayNotificationText() const;
base::string16 GetDisplayNotificationAdditionalText() const; base::string16 GetDisplayNotificationAdditionalText() const;
int GetDisplayNotificationPriority() const;
base::string16 GetFirstDisplayName(); base::string16 GetFirstDisplayName();
...@@ -106,12 +105,6 @@ base::string16 ScreenLayoutObserverTest::GetDisplayNotificationAdditionalText() ...@@ -106,12 +105,6 @@ base::string16 ScreenLayoutObserverTest::GetDisplayNotificationAdditionalText()
return notification ? notification->message() : base::string16(); return notification ? notification->message() : base::string16();
} }
int ScreenLayoutObserverTest::GetDisplayNotificationPriority() const {
constexpr int kInvalidPriority = 71;
const message_center::Notification* notification = GetDisplayNotification();
return notification ? notification->priority() : kInvalidPriority;
}
base::string16 ScreenLayoutObserverTest::GetFirstDisplayName() { base::string16 ScreenLayoutObserverTest::GetFirstDisplayName() {
return base::UTF8ToUTF16(display_manager()->GetDisplayNameForId( return base::UTF8ToUTF16(display_manager()->GetDisplayNameForId(
display_manager()->first_display_id())); display_manager()->first_display_id()));
...@@ -315,11 +308,9 @@ TEST_F(ScreenLayoutObserverTest, DisplayNotificationsDisabled) { ...@@ -315,11 +308,9 @@ TEST_F(ScreenLayoutObserverTest, DisplayNotificationsDisabled) {
UpdateDisplay("400x400/r"); UpdateDisplay("400x400/r");
EXPECT_FALSE(IsNotificationShown()); EXPECT_FALSE(IsNotificationShown());
// Adding a display still shows a notification. // Adding a display.
UpdateDisplay("400x400,200x200"); UpdateDisplay("400x400,200x200");
EXPECT_TRUE(IsNotificationShown()); EXPECT_FALSE(IsNotificationShown());
EXPECT_EQ(message_center::DEFAULT_PRIORITY, GetDisplayNotificationPriority());
CloseNotification();
const int64_t first_display_id = const int64_t first_display_id =
display::Screen::GetScreen()->GetPrimaryDisplay().id(); display::Screen::GetScreen()->GetPrimaryDisplay().id();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment