[eche] Disabling blocked apps in the mini-launcher.
A new field is added to the App and AppMetaData in order to keep the streamability of an app. When the app is blocked we gray out the icon and the text. Test: As a test, I randomly made the apps disabled or enbled and here is the result: https://drive.google.com/file/d/1woFeqvCZYJyedAyX4o6xI04q6L3F6kli/view?usp=share_link Video: https://drive.google.com/file/d/1-Fp8lNA3XNmKiQn1fQQ1h_ywJx80sKuN/view?usp=share_link Bug: b/261053219, b/261053219 Change-Id: I0097e1e83e492dcb5594dd2f0f867ba9a1b40046 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4081211 Auto-Submit: Abbas Nayebi <nayebi@google.com> Commit-Queue: Abbas Nayebi <nayebi@google.com> Reviewed-by: Jon Mann <jonmann@chromium.org> Cr-Commit-Position: refs/heads/main@{#1082041}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
158bdc80d5
commit
b6ad3ccd9f
ash
ash_strings.grd
ash_strings_grd
IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED.png.sha1IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED_BY_APP.png.sha1
system
chrome/browser/ui/webui/ash/multidevice_internals
chromeos/ash/components/phonehub
app_stream_launcher_data_model_unittest.ccnotification.ccnotification.hnotification_interaction_handler_impl_unittest.ccnotification_manager_impl_unittest.ccnotification_processor.ccnotification_processor_unittest.ccphone_model_test_util.ccphone_status_processor.cc
proto
recent_apps_interaction_handler_impl_unittest.cc@ -1633,6 +1633,12 @@ Style notes:
|
||||
<message name="IDS_ASH_PHONE_HUB_APP_STREAM_LAUNCHER_TITLE" desc="Title for the launcher that displays apps from your phone.">
|
||||
Apps from your phone
|
||||
</message>
|
||||
<message name="IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED" desc="Tooltip text for the apps that cannot be streamed.">
|
||||
Not supported
|
||||
</message>
|
||||
<message name="IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED_BY_APP" desc="Tooltip text for the apps that cannot be streamed due to exclusion by the developer.">
|
||||
Not supported by app
|
||||
</message>
|
||||
<message name="IDS_ASH_PHONE_HUB_APPS_OPT_IN_DESCRIPTION" desc="Description for the apps opt in view.">
|
||||
View your phone's apps on your <ph name="DEVICE_TYPE">$1<ex>Chromebook</ex></ph>
|
||||
</message>
|
||||
|
@ -0,0 +1 @@
|
||||
df6ed8e7916a851e2595509e8a428088646a04e8
|
@ -0,0 +1 @@
|
||||
e84377266b2457c3d8d9312407feb1d879accbb8
|
@ -4,7 +4,14 @@
|
||||
|
||||
#include "ash/system/phonehub/app_stream_launcher_item.h"
|
||||
|
||||
#include "ash/strings/grit/ash_strings.h"
|
||||
#include "base/hash/hash.h"
|
||||
#include "base/strings/string_piece_forward.h"
|
||||
#include "base/strings/utf_string_conversions.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
#include "ui/gfx/image/image_skia_operations.h"
|
||||
#include "ui/gfx/text_constants.h"
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/button/label_button.h"
|
||||
@ -21,6 +28,7 @@ constexpr gfx::Size kEcheAppItemSize(kEcheAppItemWidth, kEcheAppItemHeight);
|
||||
constexpr int kEcheAppItemSpacing = 4;
|
||||
constexpr int kEcheAppNameLabelLineHeight = 14;
|
||||
constexpr int kEcheAppNameLabelFontSize = 11;
|
||||
constexpr double kAlphaValueForInhibitedIconOpacity = 0.3;
|
||||
|
||||
void ConfigureLabel(views::Label* label, int line_height, int font_size) {
|
||||
label->SetLineHeight(line_height);
|
||||
@ -62,11 +70,43 @@ AppStreamLauncherItem::AppStreamLauncherItem(
|
||||
layout->set_cross_axis_alignment(
|
||||
views::BoxLayout::CrossAxisAlignment::kCenter);
|
||||
|
||||
const bool enabled = app_metadata.app_streamability_status ==
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE;
|
||||
gfx::Image image = app_metadata.icon;
|
||||
if (!enabled) {
|
||||
// Fade the image in order to make it look like grayed out.
|
||||
// TODO(b/261916553): Make grayed out icons "gray" in
|
||||
// addition to 30% transparent.
|
||||
image = gfx::Image(gfx::ImageSkiaOperations::CreateTransparentImage(
|
||||
image.AsImageSkia(), kAlphaValueForInhibitedIconOpacity));
|
||||
}
|
||||
|
||||
std::u16string accessible_name;
|
||||
switch (app_metadata.app_streamability_status) {
|
||||
case phonehub::proto::STREAMABLE:
|
||||
accessible_name = app_metadata.visible_app_name;
|
||||
break;
|
||||
case phonehub::proto::BLOCKED_BY_APP:
|
||||
accessible_name = l10n_util::GetStringUTF16(
|
||||
IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED_BY_APP);
|
||||
break;
|
||||
case phonehub::proto::BLOCK_LISTED:
|
||||
default:
|
||||
accessible_name =
|
||||
l10n_util::GetStringUTF16(IDS_ASH_PHONE_HUB_STREAM_NOT_SUPPORTED);
|
||||
break;
|
||||
}
|
||||
recent_app_button_ = AddChildView(std::make_unique<PhoneHubRecentAppButton>(
|
||||
app_metadata.icon, app_metadata.visible_app_name, callback));
|
||||
image, app_metadata.visible_app_name, callback));
|
||||
recent_app_button_->SetAccessibleName(accessible_name);
|
||||
recent_app_button_->SetTooltipText(accessible_name);
|
||||
recent_app_button_->SetEnabled(enabled);
|
||||
|
||||
label_ = AddChildView(
|
||||
std::make_unique<AppNameLabel>(callback, app_metadata.visible_app_name));
|
||||
label_->SetEnabled(enabled);
|
||||
label_->SetAccessibleName(accessible_name);
|
||||
label_->SetTooltipText(accessible_name);
|
||||
}
|
||||
|
||||
AppStreamLauncherItem::~AppStreamLauncherItem() = default;
|
||||
|
@ -116,7 +116,8 @@ TEST_F(AppStreamLauncherViewTest, AddItems) {
|
||||
|
||||
auto app1 = phonehub::Notification::AppMetadata(
|
||||
app_visible_name, package_name, CreateTestImage(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id);
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE);
|
||||
std::vector<phonehub::Notification::AppMetadata> apps;
|
||||
apps.push_back(app1);
|
||||
|
||||
@ -139,7 +140,8 @@ TEST_F(AppStreamLauncherViewTest, RemoveItem) {
|
||||
|
||||
auto app1 = phonehub::Notification::AppMetadata(
|
||||
app_visible_name, package_name, CreateTestImage(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id);
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE);
|
||||
std::vector<phonehub::Notification::AppMetadata> apps;
|
||||
apps.push_back(app1);
|
||||
|
||||
@ -170,7 +172,8 @@ TEST_F(AppStreamLauncherViewTest, ClickOnItem) {
|
||||
|
||||
auto app1 = phonehub::Notification::AppMetadata(
|
||||
app_visible_name, package_name, CreateTestImage(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id);
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE);
|
||||
std::vector<phonehub::Notification::AppMetadata> apps;
|
||||
apps.push_back(app1);
|
||||
|
||||
@ -188,6 +191,8 @@ TEST_F(AppStreamLauncherViewTest, ClickOnItem) {
|
||||
GetRootWindow(app_stream_launcher_view()->GetWidget()));
|
||||
|
||||
EXPECT_TRUE(GetItemView(0)->GetVisible());
|
||||
EXPECT_TRUE(GetItemView(0)->GetIconForTest()->GetEnabled());
|
||||
EXPECT_TRUE(GetItemView(0)->GetLabelForTest()->GetEnabled());
|
||||
|
||||
gfx::Point cursor_location =
|
||||
GetItemView(0)->GetIconForTest()->GetBoundsInScreen().CenterPoint();
|
||||
@ -199,4 +204,36 @@ TEST_F(AppStreamLauncherViewTest, ClickOnItem) {
|
||||
->HandledRecentAppsCount(package_name));
|
||||
}
|
||||
|
||||
TEST_F(AppStreamLauncherViewTest, DisabledItem) {
|
||||
const int64_t user_id = 1;
|
||||
const char16_t app_visible_name[] = u"Fake App";
|
||||
const char package_name[] = "com.fakeapp";
|
||||
|
||||
auto app1 = phonehub::Notification::AppMetadata(
|
||||
app_visible_name, package_name, CreateTestImage(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, user_id,
|
||||
phonehub::proto::AppStreamabilityStatus::BLOCK_LISTED);
|
||||
std::vector<phonehub::Notification::AppMetadata> apps;
|
||||
apps.push_back(app1);
|
||||
|
||||
phonehub::AppStreamLauncherDataModel* data_model =
|
||||
fake_phone_hub_manager()->fake_app_stream_launcher_data_model();
|
||||
data_model->SetAppList(apps);
|
||||
widget()->LayoutRootViewIfNecessary();
|
||||
|
||||
EXPECT_EQ(1U, app_stream_launcher_view()
|
||||
->items_container_for_test()
|
||||
->children()
|
||||
.size());
|
||||
|
||||
ui::test::EventGenerator generator(
|
||||
GetRootWindow(app_stream_launcher_view()->GetWidget()));
|
||||
|
||||
EXPECT_TRUE(GetItemView(0)->GetVisible());
|
||||
EXPECT_FALSE(GetItemView(0)->GetIconForTest()->GetEnabled());
|
||||
EXPECT_FALSE(GetItemView(0)->GetLabelForTest()->GetEnabled());
|
||||
EXPECT_EQ(u"Not supported",
|
||||
GetItemView(0)->GetIconForTest()->GetTooltipText());
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
|
@ -60,7 +60,8 @@ phonehub::Notification CreateNotification(int64_t id) {
|
||||
id,
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName, /*icon=*/gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply,
|
||||
@ -75,7 +76,8 @@ phonehub::Notification CreateIncomingCallNotification(int64_t id) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kIncomingCall,
|
||||
{{phonehub::Notification::ActionType::kInlineReply,
|
||||
@ -163,7 +165,8 @@ TEST_F(PhoneHubNotificationControllerTest, UpdateNotifications) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -194,7 +197,8 @@ TEST_F(PhoneHubNotificationControllerTest, UpdateNotificationsNewIconType) {
|
||||
kPhoneHubNotificationId1,
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName, /*icon=*/gfx::Image(), iconColor,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -214,7 +218,8 @@ TEST_F(PhoneHubNotificationControllerTest, UpdateNotificationsNewIconType) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/false, kUserId),
|
||||
/*icon_is_monochrome =*/false, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -336,7 +341,8 @@ TEST_F(PhoneHubNotificationControllerTest, NotificationDataAndImages) {
|
||||
kPhoneHubNotificationId0,
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName, icon, /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
timestamp, phonehub::Notification::Importance::kHigh,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -443,7 +449,8 @@ TEST_F(PhoneHubNotificationControllerTest, DoNotShowOldNotification) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
old_timestamp, phonehub::Notification::Importance::kHigh,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -472,7 +479,8 @@ TEST_F(PhoneHubNotificationControllerTest, DoNotShowOldNotification) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kHigh,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -503,7 +511,8 @@ TEST_F(PhoneHubNotificationControllerTest, MinPriorityNotification) {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kMin,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
@ -533,7 +542,8 @@ TEST_F(PhoneHubNotificationControllerTest,
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), phonehub::Notification::Importance::kDefault,
|
||||
phonehub::Notification::Category::kConversation,
|
||||
{{phonehub::Notification::ActionType::kInlineReply, 0}},
|
||||
|
@ -62,7 +62,8 @@ class RecentAppButtonsViewTest : public AshTestBase {
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(), /*icon_color =*/absl::nullopt,
|
||||
/*icon_is_monochrome =*/true, kUserId),
|
||||
/*icon_is_monochrome =*/true, kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now());
|
||||
}
|
||||
|
||||
|
@ -21,6 +21,7 @@
|
||||
#include "chromeos/ash/components/phonehub/fake_phone_hub_manager.h"
|
||||
#include "chromeos/ash/components/phonehub/notification.h"
|
||||
#include "chromeos/ash/components/phonehub/pref_names.h"
|
||||
#include "chromeos/ash/components/phonehub/proto/phonehub_api.pb.h"
|
||||
#include "components/prefs/pref_service.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "third_party/skia/include/core/SkBitmap.h"
|
||||
@ -92,7 +93,8 @@ phonehub::Notification::AppMetadata DictToAppMetadata(
|
||||
|
||||
return phonehub::Notification::AppMetadata(
|
||||
visible_app_name, *package_name, icon, /*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/false, user_id);
|
||||
/*icon_is_monochrome=*/false, user_id,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE);
|
||||
}
|
||||
|
||||
void TryAddingMetadata(
|
||||
|
@ -109,9 +109,11 @@ TEST_F(AppStreamLauncherDataModelTest, ResetState) {
|
||||
TEST_F(AppStreamLauncherDataModelTest, SetAppsList) {
|
||||
std::vector<Notification::AppMetadata> apps_list;
|
||||
apps_list.emplace_back(Notification::AppMetadata(
|
||||
u"b_app", "com.fakeapp1", gfx::Image(), absl::nullopt, true, 1));
|
||||
u"b_app", "com.fakeapp1", gfx::Image(), absl::nullopt, true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
apps_list.emplace_back(Notification::AppMetadata(
|
||||
u"a_app", "com.fakeapp2", gfx::Image(), absl::nullopt, true, 1));
|
||||
u"a_app", "com.fakeapp2", gfx::Image(), absl::nullopt, true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
SetAppList(apps_list);
|
||||
EXPECT_TRUE(IsObserverAppListChanged());
|
||||
EXPECT_EQ(GetAppsList()->size(), 2u);
|
||||
@ -122,4 +124,4 @@ TEST_F(AppStreamLauncherDataModelTest, SetAppsList) {
|
||||
EXPECT_EQ(GetAppsListSortedByName()->at(1).visible_app_name, u"b_app");
|
||||
}
|
||||
} // namespace phonehub
|
||||
} // namespace ash
|
||||
} // namespace ash
|
||||
|
@ -19,24 +19,28 @@ namespace phonehub {
|
||||
const char kVisibleAppName[] = "visible_app_name";
|
||||
const char kPackageName[] = "package_name";
|
||||
const char kUserId[] = "user_id";
|
||||
const char kAppStreamabilityStatus[] = "app_streamability_status";
|
||||
const char kIcon[] = "icon";
|
||||
const char kIconColorR[] = "icon_color_r";
|
||||
const char kIconColorG[] = "icon_color_g";
|
||||
const char kIconColorB[] = "icon_color_b";
|
||||
const char kIconIsMonochrome[] = "icon_is_monochrome";
|
||||
|
||||
Notification::AppMetadata::AppMetadata(const std::u16string& visible_app_name,
|
||||
const std::string& package_name,
|
||||
const gfx::Image& icon,
|
||||
const absl::optional<SkColor> icon_color,
|
||||
bool icon_is_monochrome,
|
||||
int64_t user_id)
|
||||
Notification::AppMetadata::AppMetadata(
|
||||
const std::u16string& visible_app_name,
|
||||
const std::string& package_name,
|
||||
const gfx::Image& icon,
|
||||
const absl::optional<SkColor> icon_color,
|
||||
bool icon_is_monochrome,
|
||||
int64_t user_id,
|
||||
proto::AppStreamabilityStatus app_streamability_status)
|
||||
: visible_app_name(visible_app_name),
|
||||
package_name(package_name),
|
||||
icon(icon),
|
||||
icon_color(icon_color),
|
||||
icon_is_monochrome(icon_is_monochrome),
|
||||
user_id(user_id) {}
|
||||
user_id(user_id),
|
||||
app_streamability_status(app_streamability_status) {}
|
||||
|
||||
Notification::AppMetadata::AppMetadata(const AppMetadata& other) = default;
|
||||
|
||||
@ -67,6 +71,8 @@ base::Value Notification::AppMetadata::ToValue() const {
|
||||
val.SetIntKey(kIconColorG, SkColorGetG(*icon_color));
|
||||
val.SetIntKey(kIconColorB, SkColorGetB(*icon_color));
|
||||
}
|
||||
val.SetIntKey(kAppStreamabilityStatus,
|
||||
static_cast<int>(app_streamability_status));
|
||||
return val;
|
||||
}
|
||||
|
||||
@ -113,10 +119,14 @@ Notification::AppMetadata Notification::AppMetadata::FromValue(
|
||||
gfx::Image decode_icon = gfx::Image::CreateFrom1xPNGBytes(
|
||||
base::MakeRefCounted<base::RefCountedString>(std::move(icon_str)));
|
||||
|
||||
return Notification::AppMetadata(visible_app_name_string_value,
|
||||
*(value.FindStringPath(kPackageName)),
|
||||
decode_icon, icon_color, icon_is_monochrome,
|
||||
*(value.FindDoublePath(kUserId)));
|
||||
return Notification::AppMetadata(
|
||||
visible_app_name_string_value, *(value.FindStringPath(kPackageName)),
|
||||
decode_icon, icon_color, icon_is_monochrome,
|
||||
*(value.FindDoublePath(kUserId)),
|
||||
static_cast<proto::AppStreamabilityStatus>(
|
||||
value.FindIntPath(kAppStreamabilityStatus)
|
||||
.value_or(static_cast<int>(
|
||||
proto::AppStreamabilityStatus::STREAMABLE))));
|
||||
}
|
||||
|
||||
Notification::Notification(
|
||||
|
@ -13,6 +13,7 @@
|
||||
#include "base/containers/flat_map.h"
|
||||
#include "base/time/time.h"
|
||||
#include "base/values.h"
|
||||
#include "chromeos/ash/components/phonehub/proto/phonehub_api.pb.h"
|
||||
#include "third_party/abseil-cpp/absl/types/optional.h"
|
||||
#include "ui/gfx/image/image.h"
|
||||
|
||||
@ -34,7 +35,9 @@ class Notification {
|
||||
const gfx::Image& icon,
|
||||
const absl::optional<SkColor> icon_color,
|
||||
bool icon_is_monochrome,
|
||||
int64_t user_id);
|
||||
int64_t user_id,
|
||||
proto::AppStreamabilityStatus app_streamability_status =
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
AppMetadata(const AppMetadata& other);
|
||||
AppMetadata& operator=(const AppMetadata& other);
|
||||
|
||||
@ -52,6 +55,7 @@ class Notification {
|
||||
// Whether the icon image is just a mask used to generate a monochrome icon.
|
||||
bool icon_is_monochrome;
|
||||
int64_t user_id;
|
||||
proto::AppStreamabilityStatus app_streamability_status;
|
||||
};
|
||||
|
||||
// Interaction behavior for integration with other features.
|
||||
|
@ -97,7 +97,7 @@ TEST_F(NotificationInteractionHandlerImplTest,
|
||||
auto expected_app_metadata = Notification::AppMetadata(
|
||||
expected_app_visible_name, expected_package_name, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id);
|
||||
expected_user_id, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
handler().HandleNotificationClicked(expected_id, expected_app_metadata);
|
||||
|
||||
|
@ -34,10 +34,12 @@ enum class NotificationState { kAdded, kUpdated, kRemoved };
|
||||
Notification CreateNotification(int64_t id) {
|
||||
return phonehub::Notification(
|
||||
id,
|
||||
phonehub::Notification::AppMetadata(kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, kUserId),
|
||||
phonehub::Notification::AppMetadata(
|
||||
kAppName, kPackageName,
|
||||
/*icon=*/gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, kUserId,
|
||||
proto::AppStreamabilityStatus::STREAMABLE),
|
||||
base::Time::Now(), Notification::Importance::kDefault,
|
||||
Notification::Category::kConversation,
|
||||
{{Notification::ActionType::kInlineReply, /*action_id=*/0}},
|
||||
|
@ -153,7 +153,8 @@ Notification CreateInternalNotification(const proto::Notification& proto,
|
||||
Notification::AppMetadata(
|
||||
base::UTF8ToUTF16(proto.origin_app().visible_name()),
|
||||
proto.origin_app().package_name(), icon, icon_color,
|
||||
icon_is_monochrome, proto.origin_app().user_id()),
|
||||
icon_is_monochrome, proto.origin_app().user_id(),
|
||||
proto.origin_app().app_streamability_status()),
|
||||
base::Time::FromJsTime(proto.epoch_time_millis()),
|
||||
GetNotificationImportanceFromProto(proto.importance()),
|
||||
category, action_id_map, behavior, title, text_content,
|
||||
|
@ -3,6 +3,7 @@
|
||||
// found in the LICENSE file.
|
||||
|
||||
#include "chromeos/ash/components/phonehub/notification_processor.h"
|
||||
#include <string>
|
||||
|
||||
#include "ash/constants/ash_features.h"
|
||||
#include "base/memory/ptr_util.h"
|
||||
@ -152,9 +153,12 @@ class NotificationProcessorTest : public testing::Test {
|
||||
std::string shared_image = std::string(),
|
||||
std::string contact_image = std::string(),
|
||||
Notification::InteractionBehavior behavior =
|
||||
Notification::InteractionBehavior::kNone) {
|
||||
Notification::InteractionBehavior::kNone,
|
||||
proto::AppStreamabilityStatus app_streamability_status =
|
||||
proto::AppStreamabilityStatus::STREAMABLE) {
|
||||
auto origin_app = std::make_unique<proto::App>();
|
||||
origin_app->set_icon(icon);
|
||||
origin_app->set_app_streamability_status(app_streamability_status);
|
||||
|
||||
proto::Notification notification;
|
||||
notification.set_id(notification_id);
|
||||
@ -430,6 +434,22 @@ TEST_F(NotificationProcessorTest, ImageFieldPopulatedCorrectly) {
|
||||
gfx::test::AreImagesEqual(*notification->contact_image(), TestImage()));
|
||||
}
|
||||
|
||||
TEST_F(NotificationProcessorTest, StreamabilityStatus) {
|
||||
std::vector<proto::Notification> first_set_of_notifications;
|
||||
|
||||
first_set_of_notifications.emplace_back(CreateNewInlineReplyableNotification(
|
||||
kNotificationIdA, kInlineReplyIdA, kIconDataA, std::string(),
|
||||
std::string(), Notification::InteractionBehavior::kNone,
|
||||
proto::AppStreamabilityStatus::BLOCK_LISTED));
|
||||
notification_processor()->AddNotifications(first_set_of_notifications);
|
||||
image_decoder_delegate()->RunAllCallbacks();
|
||||
|
||||
const Notification* notification =
|
||||
fake_notification_manager()->GetNotification(kNotificationIdA);
|
||||
EXPECT_EQ(proto::AppStreamabilityStatus::BLOCK_LISTED,
|
||||
notification->app_metadata().app_streamability_status);
|
||||
}
|
||||
|
||||
TEST_F(NotificationProcessorTest, AddRemoveClearWithoutRace) {
|
||||
// Add 2 notifications with all images populated.
|
||||
std::vector<proto::Notification> first_set_of_notifications;
|
||||
|
@ -79,8 +79,13 @@ const base::flat_map<Notification::ActionType, int64_t> kFakeActionIdMap = {
|
||||
|
||||
const Notification::AppMetadata& CreateFakeAppMetadata() {
|
||||
static const base::NoDestructor<Notification::AppMetadata> fake_app_metadata{
|
||||
kFakeAppVisibleName, kFakeAppPackageName, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true, kUserId};
|
||||
kFakeAppVisibleName,
|
||||
kFakeAppPackageName,
|
||||
gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true,
|
||||
kUserId,
|
||||
phonehub::proto::AppStreamabilityStatus::STREAMABLE};
|
||||
return *fake_app_metadata;
|
||||
}
|
||||
|
||||
|
@ -449,7 +449,7 @@ void PhoneStatusProcessor::GenerateAppListWithIcons(
|
||||
absl::nullopt,
|
||||
app.icon_styling() ==
|
||||
proto::NotificationIconStyling::ICON_STYLE_MONOCHROME_SMALL_ICON,
|
||||
app.user_id()));
|
||||
app.user_id(), app.app_streamability_status()));
|
||||
std::string key = app.package_name() + base::NumberToString(app.user_id());
|
||||
decoding_data_list->emplace_back(
|
||||
IconDecoder::DecodingData(str_hash(key), app.icon()));
|
||||
|
@ -63,6 +63,12 @@ enum NotificationIconStyling {
|
||||
ICON_STYLE_MONOCHROME_SMALL_ICON = 1;
|
||||
}
|
||||
|
||||
enum AppStreamabilityStatus {
|
||||
STREAMABLE = 0;
|
||||
BLOCK_LISTED = 1;
|
||||
BLOCKED_BY_APP = 2;
|
||||
}
|
||||
|
||||
enum ChargingState {
|
||||
NOT_CHARGING = 0;
|
||||
CHARGING_AC = 1;
|
||||
@ -245,6 +251,8 @@ message App {
|
||||
// Optionally used only when icon_styling is ICON_STYLE_MONOCHROME_SMALL_ICON.
|
||||
// When unset, the ChromeOS side uses the system theme's default color.
|
||||
ColorRgb icon_color = 6;
|
||||
|
||||
AppStreamabilityStatus app_streamability_status = 7;
|
||||
}
|
||||
|
||||
message CrosState {
|
||||
|
@ -85,7 +85,7 @@ class RecentAppsInteractionHandlerTest : public testing::Test {
|
||||
auto app_metadata1 = Notification::AppMetadata(
|
||||
app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/kIconColor, /*icon_is_monochrome=*/true,
|
||||
expected_user_id1);
|
||||
expected_user_id1, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name2[] = u"Fake App2";
|
||||
const char package_name2[] = "com.fakeapp2";
|
||||
@ -93,7 +93,7 @@ class RecentAppsInteractionHandlerTest : public testing::Test {
|
||||
auto app_metadata2 = Notification::AppMetadata(
|
||||
app_visible_name2, package_name2, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/false,
|
||||
expected_user_id2);
|
||||
expected_user_id2, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
base::Value::List app_metadata_value_list;
|
||||
app_metadata_value_list.Append(app_metadata1.ToValue());
|
||||
@ -111,7 +111,7 @@ class RecentAppsInteractionHandlerTest : public testing::Test {
|
||||
Notification::AppMetadata(
|
||||
app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/kIconColor, /*icon_is_monochrome=*/false,
|
||||
expected_user_id1)
|
||||
expected_user_id1, proto::AppStreamabilityStatus::STREAMABLE)
|
||||
.ToValue();
|
||||
|
||||
// Simulate an un-migrated preference without new fields.
|
||||
@ -201,14 +201,14 @@ class RecentAppsInteractionHandlerTest : public testing::Test {
|
||||
auto app_metadata1 = Notification::AppMetadata(
|
||||
app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id1);
|
||||
expected_user_id1, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
const char16_t app_visible_name2[] = u"Fake App2";
|
||||
const char package_name2[] = "com.fakeapp2";
|
||||
const int64_t expected_user_id2 = 2;
|
||||
auto app_metadata2 = Notification::AppMetadata(
|
||||
app_visible_name2, package_name2, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id2);
|
||||
expected_user_id2, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata2, now);
|
||||
}
|
||||
@ -221,13 +221,13 @@ class RecentAppsInteractionHandlerTest : public testing::Test {
|
||||
auto app_metadata1 = Notification::AppMetadata(
|
||||
app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id);
|
||||
expected_user_id, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
const char16_t app_visible_name2[] = u"Fake App2";
|
||||
const char package_name2[] = "com.fakeapp2";
|
||||
auto app_metadata2 = Notification::AppMetadata(
|
||||
app_visible_name2, package_name2, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id);
|
||||
expected_user_id, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata2, now);
|
||||
}
|
||||
@ -250,7 +250,7 @@ TEST_F(RecentAppsInteractionHandlerTest, RecentAppsClicked) {
|
||||
auto expected_app_metadata = Notification::AppMetadata(
|
||||
expected_app_visible_name, expected_package_name, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt, /*icon_is_monochrome=*/true,
|
||||
expected_user_id);
|
||||
expected_user_id, proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
handler().NotifyRecentAppClicked(
|
||||
expected_app_metadata,
|
||||
@ -266,7 +266,8 @@ TEST_F(RecentAppsInteractionHandlerTest, RecentAppsUpdated) {
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name2[] = u"Fake App2";
|
||||
const char package_name2[] = "com.fakeapp2";
|
||||
@ -274,7 +275,8 @@ TEST_F(RecentAppsInteractionHandlerTest, RecentAppsUpdated) {
|
||||
auto app_metadata2 =
|
||||
Notification::AppMetadata(app_visible_name2, package_name2, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id2);
|
||||
/*icon_is_monochrome=*/true, expected_user_id2,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
const base::Time now = base::Time::Now();
|
||||
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
@ -299,11 +301,13 @@ TEST_F(RecentAppsInteractionHandlerTest, SetStreamableApps) {
|
||||
streamable_apps.emplace_back(
|
||||
Notification::AppMetadata(u"App1", "com.fakeapp1", gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, 1));
|
||||
/*icon_is_monochrome=*/true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
streamable_apps.emplace_back(
|
||||
Notification::AppMetadata(u"App2", "com.fakeapp2", gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, 1));
|
||||
/*icon_is_monochrome=*/true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
|
||||
handler().SetStreamableApps(streamable_apps);
|
||||
|
||||
@ -324,11 +328,13 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
streamable_apps.emplace_back(
|
||||
Notification::AppMetadata(u"App1", "com.fakeapp1", gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, 1));
|
||||
/*icon_is_monochrome=*/true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
streamable_apps.emplace_back(
|
||||
Notification::AppMetadata(u"App2", "com.fakeapp2", gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, 1));
|
||||
/*icon_is_monochrome=*/true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
|
||||
handler().SetStreamableApps(streamable_apps);
|
||||
|
||||
@ -346,7 +352,8 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
streamable_apps2.emplace_back(
|
||||
Notification::AppMetadata(u"App3", "com.fakeapp3", gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, 1));
|
||||
/*icon_is_monochrome=*/true, 1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE));
|
||||
|
||||
handler().SetStreamableApps(streamable_apps2);
|
||||
|
||||
@ -372,7 +379,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name2[] = u"Fake App2";
|
||||
const char package_name2[] = "com.fakeapp2";
|
||||
@ -380,7 +388,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata2 =
|
||||
Notification::AppMetadata(app_visible_name2, package_name2, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id2);
|
||||
/*icon_is_monochrome=*/true, expected_user_id2,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name3[] = u"Fake App3";
|
||||
const char package_name3[] = "com.fakeapp3";
|
||||
@ -388,7 +397,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata3 =
|
||||
Notification::AppMetadata(app_visible_name3, package_name3, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id3);
|
||||
/*icon_is_monochrome=*/true, expected_user_id3,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const base::Time now = base::Time::Now();
|
||||
const base::Time next_minute = base::Time::Now() + base::Minutes(1);
|
||||
@ -416,7 +426,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata4 =
|
||||
Notification::AppMetadata(app_visible_name4, package_name4, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id4);
|
||||
/*icon_is_monochrome=*/true, expected_user_id4,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name5[] = u"Fake App5";
|
||||
const char package_name5[] = "com.fakeapp5";
|
||||
@ -424,7 +435,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata5 =
|
||||
Notification::AppMetadata(app_visible_name5, package_name5, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id5);
|
||||
/*icon_is_monochrome=*/true, expected_user_id5,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const char16_t app_visible_name6[] = u"Fake App6";
|
||||
const char package_name6[] = "com.fakeapp6";
|
||||
@ -432,7 +444,8 @@ TEST_F(RecentAppsInteractionHandlerTest, FetchRecentAppMetadataList) {
|
||||
auto app_metadata6 =
|
||||
Notification::AppMetadata(app_visible_name6, package_name6, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id6);
|
||||
/*icon_is_monochrome=*/true, expected_user_id6,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
const base::Time next_two_hour = base::Time::Now() + base::Hours(2);
|
||||
const base::Time next_three_hour = base::Time::Now() + base::Hours(3);
|
||||
@ -516,7 +529,8 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
SetEcheFeatureState(FeatureState::kDisabledByUser);
|
||||
@ -583,7 +597,8 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
SetAppsAccessStatus(true);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
SetEcheFeatureState(FeatureState::kEnabledByUser);
|
||||
@ -601,7 +616,8 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
|
||||
SetAppsAccessStatus(true);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
@ -648,7 +664,8 @@ TEST_F(RecentAppsInteractionHandlerTest,
|
||||
auto app_metadata1 =
|
||||
Notification::AppMetadata(app_visible_name1, package_name1, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id1);
|
||||
/*icon_is_monochrome=*/true, expected_user_id1,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata1, now);
|
||||
|
||||
EXPECT_EQ(RecentAppsInteractionHandler::RecentAppsUiState::ITEMS_VISIBLE,
|
||||
@ -715,7 +732,8 @@ TEST_F(
|
||||
auto app_metadata =
|
||||
Notification::AppMetadata(app_visible_name, package_name, gfx::Image(),
|
||||
/*icon_color=*/absl::nullopt,
|
||||
/*icon_is_monochrome=*/true, expected_user_id);
|
||||
/*icon_is_monochrome=*/true, expected_user_id,
|
||||
proto::AppStreamabilityStatus::STREAMABLE);
|
||||
handler().NotifyRecentAppAddedOrUpdated(app_metadata, now);
|
||||
SetHostStatus(HostStatus::kHostSetButNotYetVerified);
|
||||
|
||||
|
Reference in New Issue
Block a user