Commit c14cfd31 authored by Thomas Tellier's avatar Thomas Tellier Committed by Chromium LUCI CQ

[CrOS] Replicate lock screen auth methods metrics on login screen

Bug: 1136092
Change-Id: Ibe736b6ad40c343c1a7b3d946328849916583a65
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2601374Reviewed-by: default avatarDenis Kuznetsov [CET] <antrim@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Thomas Tellier <tellier@google.com>
Cr-Commit-Position: refs/heads/master@{#842491}
parent 1779a9e0
......@@ -136,19 +136,29 @@ LoginAuthRecorder::~LoginAuthRecorder() {
void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) {
DCHECK_NE(method, AuthMethod::kNothing);
if (session_manager::SessionManager::Get()->session_state() !=
session_manager::SessionState::LOCKED) {
return;
bool is_locked;
switch (session_manager::SessionManager::Get()->session_state()) {
case session_manager::SessionState::LOGIN_PRIMARY:
case session_manager::SessionState::LOGIN_SECONDARY:
is_locked = false;
break;
case session_manager::SessionState::LOCKED:
is_locked = true;
break;
default:
return;
}
const std::string prefix =
is_locked ? "Ash.Login.Lock.AuthMethod." : "Ash.Login.Login.AuthMethod.";
// Record usage of the authentication method in lock screen.
// Record usage of the authentication method in login/lock screen.
const bool is_tablet_mode = ash::TabletMode::Get()->InTabletMode();
std::string used_metric_name;
if (is_tablet_mode) {
base::UmaHistogramEnumeration("Ash.Login.Lock.AuthMethod.Used.TabletMode",
method);
base::UmaHistogramEnumeration(prefix + "Used.TabletMode", method);
} else {
base::UmaHistogramEnumeration(
"Ash.Login.Lock.AuthMethod.Used.ClamShellMode", method);
base::UmaHistogramEnumeration(prefix + "Used.ClamShellMode", method);
}
if (last_auth_method_ != method) {
......@@ -156,8 +166,7 @@ void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) {
const base::Optional<AuthMethodSwitchType> switch_type =
FindSwitchType(last_auth_method_, method);
if (switch_type) {
base::UmaHistogramEnumeration("Ash.Login.Lock.AuthMethod.Switched",
*switch_type);
base::UmaHistogramEnumeration(prefix + "Switched", *switch_type);
}
last_auth_method_ = method;
......
......@@ -1035,7 +1035,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>tellier@google.com</owner>
<owner>cros-oac@google.com</owner>
<summary>
The count of auth method switching actions in ChromeOS lock screen.
The count of auth method switching actions on ChromeOS lock screen.
</summary>
</histogram>
......@@ -1046,7 +1046,8 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>cros-oac@google.com</owner>
<summary>
The usage of different auth methods (PIN / Password / Smartlock /
Fingerprint / Challenge response) in ChromeOS lock screen clamshell mode.
Fingerprint / Challenge response) on Chromebooks in clamshell mode and on
other form-factors.
</summary>
</histogram>
......@@ -1057,7 +1058,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>cros-oac@google.com</owner>
<summary>
The usage of different auth methods (PIN / Password / Smartlock /
Fingerprint / Challenge response) in ChromeOS lock screen tablet mode.
Fingerprint / Challenge response) on Chromebooks in tablet mode.
</summary>
</histogram>
......@@ -1092,6 +1093,39 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary>
</histogram>
<histogram name="Ash.Login.Login.AuthMethod.Switched"
enum="AuthMethodSwitchType" expires_after="2021-05-16">
<owner>rsorokin@chromium.org</owner>
<owner>tellier@google.com</owner>
<owner>cros-oac@google.com</owner>
<summary>
The count of auth method switching actions on ChromeOS login screen.
</summary>
</histogram>
<histogram name="Ash.Login.Login.AuthMethod.Used.ClamShellMode"
enum="AuthMethod" expires_after="2021-05-16">
<owner>rsorokin@chromium.org</owner>
<owner>tellier@google.com</owner>
<owner>cros-oac@google.com</owner>
<summary>
The usage of different auth methods (PIN / Password / Smartlock /
Fingerprint / Challenge response) on Chromebooks in clamshell mode and on
other form-factors.
</summary>
</histogram>
<histogram name="Ash.Login.Login.AuthMethod.Used.TabletMode" enum="AuthMethod"
expires_after="2021-05-16">
<owner>rsorokin@chromium.org</owner>
<owner>tellier@google.com</owner>
<owner>cros-oac@google.com</owner>
<summary>
The usage of different auth methods (PIN / Password / Smartlock /
Fingerprint / Challenge response) on Chromebooks in tablet mode.
</summary>
</histogram>
<histogram name="Ash.Login.Login.MigrationBanner" enum="BooleanShown"
expires_after="2021-05-16">
<owner>rsorokin@chromium.org</owner>
......
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