Merge "Disable Enhanced notifications setting when default NAS is not available"

This commit is contained in:
Chloris Kuo
2022-10-13 16:27:05 +00:00
committed by Android (Google) Code Review
2 changed files with 14 additions and 1 deletions

View File

@@ -226,4 +226,14 @@ public class NotificationAssistantPreferenceControllerTest {
.setNASMigrationDoneAndResetDefault(eq(10), anyBoolean());
}
@Test
public void testNASUnavailable_settingDisabled() throws Exception {
when(mBackend.getDefaultNotificationAssistant()).thenReturn(null);
mPreferenceController.getDefaultNASIntent();
mPreferenceController.updateState(mPreference);
verify(mPreference, times(1)).setSwitchEnabled(eq(false));
assertFalse(mPreference.isEnabled());
}
}