Handle null safety source id list in broadcast receiver.
Bug: 215515448 Test: atest SettingsUnitTests Change-Id: I5c8b24533c4ce39ff28f533fbfc7e386639f4983
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user