Skip to content

Commit

Permalink
Add Camera App HaTS Survey config
Browse files Browse the repository at this point in the history
This CL adds the feature and preferences for the camera app HaTS survey.
The trigger logic and the config to control the feature via Finch will
be added in follow-up CLs separately.

Design Doc: go/cros-camera:dd:cca-hats

Bug: b:237737023
Test: Manually tested with follow-up CLs
Change-Id: I29d750b4a3b14c00e7ee97f132a19bcaf01dfa2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3774290
Reviewed-by: Weilun Shi <sweilun@chromium.org>
Commit-Queue: Wei Lee <wtlee@chromium.org>
Reviewed-by: Hidehiko Abe <hidehiko@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1035002}
  • Loading branch information
Wei Lee authored and Chromium LUCI CQ committed Aug 15, 2022
1 parent c1c09e5 commit 8652b6a
Show file tree
Hide file tree
Showing 8 changed files with 34 additions and 0 deletions.
10 changes: 10 additions & 0 deletions chrome/browser/ash/hats/hats_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -157,4 +157,14 @@ const HatsConfig kHatsMediaAppPdfSurvey = {
prefs::kHatsMediaAppPdfCycleEndTs, // hatsCycleEndTimestampPrefName
};

// Camera App Survey -- shown after an user captured a photo/video or left the
// app with session > 15 seconds.
const HatsConfig kHatsCameraAppSurvey = {
::features::kHappinessTrackingSystemCameraApp, // feature
"Browser.ChromeOS.HatsSatisfaction.CameraApp", // histogram_name
base::Days(90), // new_device_threshold
prefs::kHatsCameraAppDeviceIsSelected, // is_selected_pref_name
prefs::kHatsCameraAppSurveyCycleEndTs, // cycle_end_timestamp_pref_name
};

} // namespace ash
1 change: 1 addition & 0 deletions chrome/browser/ash/hats/hats_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ extern const HatsConfig kHatsPersonalizationAvatarSurvey;
extern const HatsConfig kHatsPersonalizationScreensaverSurvey;
extern const HatsConfig kHatsPersonalizationWallpaperSurvey;
extern const HatsConfig kHatsMediaAppPdfSurvey;
extern const HatsConfig kHatsCameraAppSurvey;

} // namespace ash

Expand Down
4 changes: 4 additions & 0 deletions chrome/browser/ash/preferences.cc
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,10 @@ void Preferences::RegisterProfilePrefs(
registry->RegisterBooleanPref(::prefs::kHatsPerformanceDeviceIsSelected,
false);

registry->RegisterInt64Pref(::prefs::kHatsCameraAppSurveyCycleEndTs, 0);

registry->RegisterBooleanPref(::prefs::kHatsCameraAppDeviceIsSelected, false);

// Personalization HaTS survey prefs for avatar, screensaver, and wallpaper
// features.
registry->RegisterInt64Pref(
Expand Down
3 changes: 3 additions & 0 deletions chrome/common/chrome_features.cc
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,9 @@ const base::Feature kHappinessTrackingPersonalizationWallpaper{
// Enables the Happiness Tracking System for Media App PDF survey.
const base::Feature kHappinessTrackingMediaAppPdf{
"HappinessTrackingMediaAppPdf", base::FEATURE_DISABLED_BY_DEFAULT};
// Enables or disables the Happiness Tracking System for Camera App survey.
const base::Feature kHappinessTrackingSystemCameraApp{
"HappinessTrackingCameraApp", base::FEATURE_DISABLED_BY_DEFAULT};
#endif

// Hides the origin text from showing up briefly in WebApp windows.
Expand Down
3 changes: 3 additions & 0 deletions chrome/common/chrome_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,9 @@ extern const base::Feature kHappinessTrackingPersonalizationWallpaper;
COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingMediaAppPdf;

COMPONENT_EXPORT(CHROME_FEATURES)
extern const base::Feature kHappinessTrackingSystemCameraApp;

#endif

COMPONENT_EXPORT(CHROME_FEATURES)
Expand Down
10 changes: 10 additions & 0 deletions chrome/common/pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -879,6 +879,16 @@ const char kHatsMediaAppPdfCycleEndTs[] =
// survey.
const char kHatsMediaAppPdfIsSelected[] = "hats_media_app_pdf_is_selected";

// An int64 pref. This is the timestamp, microseconds after epoch, that
// indicates the end of the most recent Camera App survey cycle.
const char kHatsCameraAppSurveyCycleEndTs[] =
"hats_camera_app_cycle_end_timestamp";

// A boolean pref. Indicates if the device is selected for the Camera App
// survey.
const char kHatsCameraAppDeviceIsSelected[] =
"hats_camera_app_device_is_selected";

// A boolean pref. Indicates if we've already shown a notification to inform the
// current user about the quick unlock feature.
const char kPinUnlockFeatureNotificationShown[] =
Expand Down
2 changes: 2 additions & 0 deletions chrome/common/pref_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,8 @@ extern const char kHatsPersonalizationWallpaperSurveyCycleEndTs[];
extern const char kHatsPersonalizationWallpaperSurveyIsSelected[];
extern const char kHatsMediaAppPdfCycleEndTs[];
extern const char kHatsMediaAppPdfIsSelected[];
extern const char kHatsCameraAppDeviceIsSelected[];
extern const char kHatsCameraAppSurveyCycleEndTs[];
extern const char kEolStatus[];
extern const char kEndOfLifeDate[];
extern const char kEolNotificationDismissed[];
Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/metadata/browser/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ chromium-metrics-reviews@google.com.
<token key="Survey">
<variant name=".ArcGames"/>
<variant name=".Audio"/>
<variant name=".CameraApp"/>
<variant name=".Ent"/>
<variant name=".General"/>
<variant name=".MediaAppPdf"/>
Expand Down

0 comments on commit 8652b6a

Please sign in to comment.