Merge "Fix Hotspot & tethering settings crash" into udc-d1-dev

This commit is contained in:
Treehugger Robot
2023-06-14 12:00:21 +00:00
committed by Android (Google) Code Review
2 changed files with 4 additions and 1 deletions

View File

@@ -131,10 +131,12 @@ public class TetherSettingsTest {
@Test
@Config(shadows = ShadowRestrictedSettingsFragment.class)
public void onCreate_isUiRestricted_doNotSetupViewModel() {
doNothing().when(mTetherSettings).addPreferencesFromResource(anyInt());
when(mTetherSettings.isUiRestricted()).thenReturn(true);
mTetherSettings.onCreate(null);
verify(mTetherSettings).addPreferencesFromResource(anyInt());
verify(mTetherSettings, never()).setupViewModel();
}