Add tests for guest user events
Also, move ACTION_USER_GUEST_EXIT_CONFIRMED so it is only logged after safety-check Test: ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest" m RunSettingsRoboTests Test: ROBOTEST_FILTER="com.android.settings.users.UserDetailsSettingsTest" m RunSettingsRoboTests Bug: 184200796 Change-Id: Id18aa914bbb262984d7c7cf4b8a4ffdde278fd23
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user