Merge "Add tests for guest user events" into sc-dev

This commit is contained in:
TreeHugger Robot
2021-05-12 03:59:44 +00:00
committed by Android (Google) Code Review
3 changed files with 43 additions and 3 deletions

View File

@@ -829,13 +829,14 @@ public class UserSettings extends SettingsPreferenceFragment
/**
* Erase the current user (guest) and switch to another user.
*/
private void exitGuest() {
@VisibleForTesting
void exitGuest() {
// Just to be safe
mMetricsFeatureProvider.action(getActivity(),
SettingsEnums.ACTION_USER_GUEST_EXIT_CONFIRMED);
if (!isCurrentUserGuest()) {
return;
}
mMetricsFeatureProvider.action(getActivity(),
SettingsEnums.ACTION_USER_GUEST_EXIT_CONFIRMED);
removeThisUser();
}