Merge "Handle null safety source id list in broadcast receiver."

This commit is contained in:
Marie Matheson
2022-02-15 13:30:04 +00:00
committed by Android (Google) Code Review
2 changed files with 19 additions and 7 deletions

View File

@@ -79,6 +79,16 @@ public class SafetySourceBroadcastReceiverTest {
verify(mSafetyCenterManagerWrapper, never()).sendSafetyCenterUpdate(any(), any());
}
@Test
public void sendSafetyData_whenSafetyCenterIsEnabled_withNullSourceIds_sendsNoData() {
when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true);
Intent intent = new Intent();
new SafetySourceBroadcastReceiver().onReceive(mApplicationContext, intent);
verify(mSafetyCenterManagerWrapper, never()).sendSafetyCenterUpdate(any(), any());
}
@Test
public void sendSafetyData_whenSafetyCenterIsEnabled_withNoSourceIds_sendsNoData() {
when(mSafetyCenterStatusHolder.isEnabled(mApplicationContext)).thenReturn(true);