use of com.android.internal.telephony.nitz.NitzStateMachineTestSupport.FakeDeviceState in project android_frameworks_opt_telephony by LineageOS.
the class NitzStateMachineImplTest method setUp.
@Before
public void setUp() throws Exception {
TelephonyTest.logd("NitzStateMachineImplTest +Setup!");
super.setUp("NitzStateMachineImplTest");
// In tests we use a fake impls for NewTimeServiceHelper and DeviceState.
mFakeDeviceState = new FakeDeviceState();
mFakeTimeServiceHelper = new FakeTimeServiceHelper(mFakeDeviceState);
// In tests we disable NITZ signal input filtering. The real NITZ signal filter is tested
// independently. This makes constructing test data simpler: we can be sure the signals
// won't be filtered for reasons like rate-limiting.
NitzSignalInputFilterPredicate mFakeNitzSignalInputFilter = (oldSignal, newSignal) -> true;
// In tests a real TimeZoneSuggesterImpl is used with the real TimeZoneLookupHelper and real
// country time zone data. A fake device state is used (which allows tests to fake the
// system clock / user settings). The tests can perform the expected lookups and confirm the
// state machine takes the correct action. Picking real examples from the past is easier
// than inventing countries / scenarios and configuring fakes.
TimeZoneLookupHelper timeZoneLookupHelper = new TimeZoneLookupHelper();
mRealTimeZoneSuggester = new TimeZoneSuggesterImpl(mFakeDeviceState, timeZoneLookupHelper);
mNitzStateMachineImpl = new NitzStateMachineImpl(SLOT_INDEX, mFakeNitzSignalInputFilter, mRealTimeZoneSuggester, mFakeTimeServiceHelper);
TelephonyTest.logd("NewNitzStateMachineImplTest -Setup!");
}
use of com.android.internal.telephony.nitz.NitzStateMachineTestSupport.FakeDeviceState in project android_frameworks_opt_telephony by LineageOS.
the class TimeZoneSuggesterImplTest method setUp.
@Before
public void setUp() throws Exception {
TelephonyTest.logd("TimeZoneSuggesterImplTest +Setup!");
super.setUp("TimeZoneSuggesterImplTest");
// In tests a fake impl is used for DeviceState, which allows historic data to be used.
mFakeDeviceState = new FakeDeviceState();
// In tests the real TimeZoneLookupHelper implementation is used: this makes it easy to
// construct tests using known historic examples.
TimeZoneLookupHelper timeZoneLookupHelper = new TimeZoneLookupHelper();
mTimeZoneSuggester = new TimeZoneSuggesterImpl(mFakeDeviceState, timeZoneLookupHelper);
TelephonyTest.logd("TimeZoneSuggesterImplTest -Setup!");
}
use of com.android.internal.telephony.nitz.NitzStateMachineTestSupport.FakeDeviceState in project android_frameworks_opt_telephony by LineageOS.
the class NitzSignalInputFilterPredicateFactoryTest method setUp.
@Before
public void setUp() throws Exception {
super.setUp("NitzSignalInputFilterPredicateFactoryTest");
mFakeDeviceState = new FakeDeviceState();
}
Aggregations