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() { ...@@ -136,19 +136,29 @@ LoginAuthRecorder::~LoginAuthRecorder() {
void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) { void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) {
DCHECK_NE(method, AuthMethod::kNothing); DCHECK_NE(method, AuthMethod::kNothing);
if (session_manager::SessionManager::Get()->session_state() !=
session_manager::SessionState::LOCKED) { 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; 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(); const bool is_tablet_mode = ash::TabletMode::Get()->InTabletMode();
std::string used_metric_name;
if (is_tablet_mode) { if (is_tablet_mode) {
base::UmaHistogramEnumeration("Ash.Login.Lock.AuthMethod.Used.TabletMode", base::UmaHistogramEnumeration(prefix + "Used.TabletMode", method);
method);
} else { } else {
base::UmaHistogramEnumeration( base::UmaHistogramEnumeration(prefix + "Used.ClamShellMode", method);
"Ash.Login.Lock.AuthMethod.Used.ClamShellMode", method);
} }
if (last_auth_method_ != method) { if (last_auth_method_ != method) {
...@@ -156,8 +166,7 @@ void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) { ...@@ -156,8 +166,7 @@ void LoginAuthRecorder::RecordAuthMethod(AuthMethod method) {
const base::Optional<AuthMethodSwitchType> switch_type = const base::Optional<AuthMethodSwitchType> switch_type =
FindSwitchType(last_auth_method_, method); FindSwitchType(last_auth_method_, method);
if (switch_type) { if (switch_type) {
base::UmaHistogramEnumeration("Ash.Login.Lock.AuthMethod.Switched", base::UmaHistogramEnumeration(prefix + "Switched", *switch_type);
*switch_type);
} }
last_auth_method_ = method; last_auth_method_ = method;
......
...@@ -1035,7 +1035,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1035,7 +1035,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>tellier@google.com</owner> <owner>tellier@google.com</owner>
<owner>cros-oac@google.com</owner> <owner>cros-oac@google.com</owner>
<summary> <summary>
The count of auth method switching actions in ChromeOS lock screen. The count of auth method switching actions on ChromeOS lock screen.
</summary> </summary>
</histogram> </histogram>
...@@ -1046,7 +1046,8 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1046,7 +1046,8 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>cros-oac@google.com</owner> <owner>cros-oac@google.com</owner>
<summary> <summary>
The usage of different auth methods (PIN / Password / Smartlock / 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> </summary>
</histogram> </histogram>
...@@ -1057,7 +1058,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1057,7 +1058,7 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
<owner>cros-oac@google.com</owner> <owner>cros-oac@google.com</owner>
<summary> <summary>
The usage of different auth methods (PIN / Password / Smartlock / 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> </summary>
</histogram> </histogram>
...@@ -1092,6 +1093,39 @@ reviews. Googlers can read more about this at go/gwsq-gerrit. ...@@ -1092,6 +1093,39 @@ reviews. Googlers can read more about this at go/gwsq-gerrit.
</summary> </summary>
</histogram> </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" <histogram name="Ash.Login.Login.MigrationBanner" enum="BooleanShown"
expires_after="2021-05-16"> expires_after="2021-05-16">
<owner>rsorokin@chromium.org</owner> <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