Fix Hotspot & tethering settings crash
- Cannot omit addPreferencesFromResource even if UI is restricted Bug: 287172382 Test: manual test atest -c WifiTetherSettingsTest Change-Id: I1f5c0215a635fddefe7eaa20c1d765634b505121
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user