use of com.android.internal.telephony.nitz.NitzSignalInputFilterPredicateFactory.NitzSignalInputFilterPredicateImpl in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method testNitzSignalInputFilterPredicateImpl_nullSecondArgumentRejected.
@Test
public void testNitzSignalInputFilterPredicateImpl_nullSecondArgumentRejected() {
Scenario scenario = UNIQUE_US_ZONE_SCENARIO1;
TimestampedValue<NitzData> nitzSignal = scenario.createNitzSignal(mFakeDeviceState.elapsedRealtime());
TrivalentPredicate[] triPredicates = {};
NitzSignalInputFilterPredicateImpl impl = new NitzSignalInputFilterPredicateImpl(triPredicates);
try {
impl.mustProcessNitzSignal(nitzSignal, null);
fail();
} catch (NullPointerException expected) {
}
}
use of com.android.internal.telephony.nitz.NitzSignalInputFilterPredicateFactory.NitzSignalInputFilterPredicateImpl in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method testNitzSignalInputFilterPredicateImpl_trueIsHonored.
@Test
public void testNitzSignalInputFilterPredicateImpl_trueIsHonored() {
Scenario scenario = UNIQUE_US_ZONE_SCENARIO1;
TimestampedValue<NitzData> nitzSignal = scenario.createNitzSignal(mFakeDeviceState.elapsedRealtime());
TrivalentPredicate nullPredicate = (x, y) -> null;
TrivalentPredicate truePredicate = (x, y) -> true;
TrivalentPredicate exceptionPredicate = (x, y) -> {
throw new RuntimeException();
};
TrivalentPredicate[] triPredicates = { nullPredicate, truePredicate, exceptionPredicate };
NitzSignalInputFilterPredicateImpl impl = new NitzSignalInputFilterPredicateImpl(triPredicates);
assertTrue(impl.mustProcessNitzSignal(null, nitzSignal));
}
use of com.android.internal.telephony.nitz.NitzSignalInputFilterPredicateFactory.NitzSignalInputFilterPredicateImpl in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method testNitzSignalInputFilterPredicateImpl_defaultIsTrue.
@Test
public void testNitzSignalInputFilterPredicateImpl_defaultIsTrue() {
Scenario scenario = UNIQUE_US_ZONE_SCENARIO1;
TimestampedValue<NitzData> nitzSignal = scenario.createNitzSignal(mFakeDeviceState.elapsedRealtime());
NitzSignalInputFilterPredicateImpl impl = new NitzSignalInputFilterPredicateImpl(new TrivalentPredicate[0]);
assertTrue(impl.mustProcessNitzSignal(null, nitzSignal));
}
use of com.android.internal.telephony.nitz.NitzSignalInputFilterPredicateFactory.NitzSignalInputFilterPredicateImpl in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method testNitzSignalInputFilterPredicateImpl_falseIsHonored.
@Test
public void testNitzSignalInputFilterPredicateImpl_falseIsHonored() {
Scenario scenario = UNIQUE_US_ZONE_SCENARIO1;
TimestampedValue<NitzData> nitzSignal = scenario.createNitzSignal(mFakeDeviceState.elapsedRealtime());
TrivalentPredicate nullPredicate = (x, y) -> null;
TrivalentPredicate falsePredicate = (x, y) -> false;
TrivalentPredicate exceptionPredicate = (x, y) -> {
throw new RuntimeException();
};
TrivalentPredicate[] triPredicates = { nullPredicate, falsePredicate, exceptionPredicate };
NitzSignalInputFilterPredicateImpl impl = new NitzSignalInputFilterPredicateImpl(triPredicates);
assertFalse(impl.mustProcessNitzSignal(null, nitzSignal));
}
use of com.android.internal.telephony.nitz.NitzSignalInputFilterPredicateFactory.NitzSignalInputFilterPredicateImpl in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method testNitzSignalInputFilterPredicateImpl_nullIsIgnored.
@Test
public void testNitzSignalInputFilterPredicateImpl_nullIsIgnored() {
Scenario scenario = UNIQUE_US_ZONE_SCENARIO1;
TimestampedValue<NitzData> nitzSignal = scenario.createNitzSignal(mFakeDeviceState.elapsedRealtime());
TrivalentPredicate nullPredicate = (x, y) -> null;
TrivalentPredicate[] triPredicates = { nullPredicate };
NitzSignalInputFilterPredicateImpl impl = new NitzSignalInputFilterPredicateImpl(triPredicates);
assertTrue(impl.mustProcessNitzSignal(null, nitzSignal));
}
Aggregations