Fix "Turn on phone calls" for guest user

Move "Turn on phone calls" from guest detail user screen to user screen.
Optimisation: Applying restrictions to default guest user has been moved
to UserManagerService -> setDefaultGuestRestrictions.

Following UX there is no need for confirmation dialog.

Bug: 191483069
Test: make RunSettingsRoboTests -j128 ROBOTEST_FILTER="com.android.settings.users.GuestTelephonyPreferenceControllerTest"
       make RunSettingsRoboTests -j128 ROBOTEST_FILTER="com.android.settings.users.UserSettingsTest"
Change-Id: Id7391d3f85954ea7f9c94791f24174105ec8073e
This commit is contained in:
Anna Bauza
2022-04-27 13:07:09 +00:00
parent 25fd957190
commit 935b735fb4
10 changed files with 286 additions and 100 deletions

View File

@@ -420,29 +420,6 @@ public class UserDetailsSettingsTest {
verify(mPhonePref).setChecked(true);
}
@Test
public void initialize_guestSelected_noCallRestriction_shouldSetPhonePreference() {
setupSelectedGuest();
mUserManager.setIsAdminUser(true);
mFragment.initialize(mActivity, mArguments);
verify(mPhonePref).setTitle(R.string.user_enable_calling);
verify(mPhonePref).setChecked(true);
}
@Test
public void initialize_guestSelected_callRestriction_shouldSetPhonePreference() {
setupSelectedGuest();
mUserManager.setIsAdminUser(true);
mUserManager.addGuestUserRestriction(UserManager.DISALLOW_OUTGOING_CALLS);
mFragment.initialize(mActivity, mArguments);
verify(mPhonePref).setTitle(R.string.user_enable_calling);
verify(mPhonePref).setChecked(false);
}
@Test
public void initialize_switchUserDisallowed_shouldSetAdminDisabledOnSwitchPreference() {
setupSelectedUser();