Commit a31c6b96 authored by Regan Hsu's avatar Regan Hsu Committed by Commit Bot

[CrOS MultiDevice] Fix crash when password entered on SL sign-in.

When smart lock is enabled, but the lock screen is disabled on the host,
the smart lock metrics recorder crashes as the user enters their
password.  This is because the case PHONE_NOT_LOCKABLE -- which details
this event -- in the ScreenlockState is not considered in the function
which records these metrics, defaulting in a NOTREACHED().

Bug: 915981
Change-Id: If5a022fcea78e6a46739612e3e101a3eec38a399
Reviewed-on: https://chromium-review.googlesource.com/c/1383201Reviewed-by: default avatarRyan Hansberry <hansberry@chromium.org>
Reviewed-by: default avatarSteven Holte <holte@chromium.org>
Commit-Queue: Regan Hsu <hsuregan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#620017}
parent 11f1e33f
...@@ -645,6 +645,9 @@ EasyUnlockService::GetSmartUnlockPasswordAuthEvent() const { ...@@ -645,6 +645,9 @@ EasyUnlockService::GetSmartUnlockPasswordAuthEvent() const {
case ScreenlockState::PASSWORD_REAUTH: case ScreenlockState::PASSWORD_REAUTH:
return SmartLockMetricsRecorder::SmartLockAuthEventPasswordState:: return SmartLockMetricsRecorder::SmartLockAuthEventPasswordState::
kForcedReauth; kForcedReauth;
case ScreenlockState::PHONE_NOT_LOCKABLE:
return SmartLockMetricsRecorder::SmartLockAuthEventPasswordState::
kPhoneNotLockable;
default: default:
NOTREACHED(); NOTREACHED();
return SmartLockMetricsRecorder::SmartLockAuthEventPasswordState:: return SmartLockMetricsRecorder::SmartLockAuthEventPasswordState::
......
...@@ -72,7 +72,8 @@ class SmartLockMetricsRecorder { ...@@ -72,7 +72,8 @@ class SmartLockMetricsRecorder {
kPhoneLockedAndRssiTooLow = 15, kPhoneLockedAndRssiTooLow = 15,
kForcedReauth = 16, kForcedReauth = 16,
kRequiredForLogin = 17, kRequiredForLogin = 17,
kMaxValue = kRequiredForLogin kPhoneNotLockable = 18,
kMaxValue = kPhoneNotLockable
}; };
static void RecordSmartLockUnlockAuthMethodChoice( static void RecordSmartLockUnlockAuthMethodChoice(
......
...@@ -48257,9 +48257,10 @@ Called by update_net_trust_anchors.py.--> ...@@ -48257,9 +48257,10 @@ Called by update_net_trust_anchors.py.-->
<int value="12" label="Sign-in failed"/> <int value="12" label="Sign-in failed"/>
<int value="13" label="Pairing added"/> <int value="13" label="Pairing added"/>
<int value="14" label="No screenlock state handler"/> <int value="14" label="No screenlock state handler"/>
<int value="15" label="RSSI too low"/> <int value="15" label="Phone locked and RSSI too low"/>
<int value="16" label="Forced Reauthentication"/> <int value="16" label="Forced Reauthentication"/>
<int value="17" label="Required for login"/> <int value="17" label="Required for login"/>
<int value="18" label="Phone not lockable"/>
</enum> </enum>
<enum name="SmartLockAuthMethodChoice"> <enum name="SmartLockAuthMethodChoice">
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