Loading src/java/com/android/internal/telephony/NitzStateMachine.java +2 −16 Original line number Diff line number Diff line Loading @@ -98,15 +98,6 @@ public class NitzStateMachine { return ignoreNitz != null && ignoreNitz.equals("yes"); } /** * Returns true if the {@code telephony.test.ignore.nitz} system property is set to * 'y', 'yes', '1', 'true' or 'on' AND the current uptime is an odd number. */ public boolean getIgnoreNitzForTests() { return SystemProperties.getBoolean(TelephonyProperties.PROPERTY_IGNORE_NITZ, false) && ((SystemClock.uptimeMillis() & 1) == 0); } /** * Sets the {@code gsm.nitz.time} system property. */ Loading Loading @@ -595,17 +586,13 @@ public class NitzStateMachine { * @param iso Country code from network MCC */ public void updateTimeZoneByNetworkCountryCode(String iso) { // Test both paths if ignore nitz for tests is true boolean testOneUniqueOffsetPath = mDeviceState.getIgnoreNitzForTests(); List<String> uniqueZoneIds = TimeUtils.getTimeZoneIdsWithUniqueOffsets(iso); if ((uniqueZoneIds.size() == 1) || testOneUniqueOffsetPath) { if (uniqueZoneIds.size() == 1) { String zoneId = uniqueZoneIds.get(0); if (DBG) { Rlog.d(LOG_TAG, "updateTimeZoneByNetworkCountryCode: no nitz but one TZ for iso-cc=" + iso + " with zone.getID=" + zoneId + " testOneUniqueOffsetPath=" + testOneUniqueOffsetPath); + " with zone.getID=" + zoneId); } mTimeZoneLog.log("updateTimeZoneByNetworkCountryCode: set time zone=" + zoneId + " iso=" + iso); Loading @@ -615,7 +602,6 @@ public class NitzStateMachine { Rlog.d(LOG_TAG, "updateTimeZoneByNetworkCountryCode: there are " + uniqueZoneIds.size() + " unique offsets for iso-cc='" + iso + " testOneUniqueOffsetPath=" + testOneUniqueOffsetPath + "', do nothing"); } } Loading tests/telephonytests/src/com/android/internal/telephony/NitzStateMachineTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ public class NitzStateMachineTest extends TelephonyTest { // Configure device state when(mDeviceState.getIgnoreNitz()).thenReturn(false); when(mDeviceState.getIgnoreNitzForTests()).thenReturn(false); when(mDeviceState.getNitzUpdateDiffMillis()).thenReturn(2000); when(mDeviceState.getNitzUpdateSpacingMillis()).thenReturn(1000 * 60 * 10); when(mDeviceState.elapsedRealtime()).thenReturn(123456789L); Loading @@ -68,7 +67,6 @@ public class NitzStateMachineTest extends TelephonyTest { // Confirm all mDeviceState side effects were verified. We don't care about retrievals of // device state. verify(mDeviceState, atLeast(0)).getIgnoreNitz(); verify(mDeviceState, atLeast(0)).getIgnoreNitzForTests(); verify(mDeviceState, atLeast(0)).getNitzUpdateDiffMillis(); verify(mDeviceState, atLeast(0)).getNitzUpdateSpacingMillis(); verify(mDeviceState, atLeast(0)).elapsedRealtime(); Loading Loading
src/java/com/android/internal/telephony/NitzStateMachine.java +2 −16 Original line number Diff line number Diff line Loading @@ -98,15 +98,6 @@ public class NitzStateMachine { return ignoreNitz != null && ignoreNitz.equals("yes"); } /** * Returns true if the {@code telephony.test.ignore.nitz} system property is set to * 'y', 'yes', '1', 'true' or 'on' AND the current uptime is an odd number. */ public boolean getIgnoreNitzForTests() { return SystemProperties.getBoolean(TelephonyProperties.PROPERTY_IGNORE_NITZ, false) && ((SystemClock.uptimeMillis() & 1) == 0); } /** * Sets the {@code gsm.nitz.time} system property. */ Loading Loading @@ -595,17 +586,13 @@ public class NitzStateMachine { * @param iso Country code from network MCC */ public void updateTimeZoneByNetworkCountryCode(String iso) { // Test both paths if ignore nitz for tests is true boolean testOneUniqueOffsetPath = mDeviceState.getIgnoreNitzForTests(); List<String> uniqueZoneIds = TimeUtils.getTimeZoneIdsWithUniqueOffsets(iso); if ((uniqueZoneIds.size() == 1) || testOneUniqueOffsetPath) { if (uniqueZoneIds.size() == 1) { String zoneId = uniqueZoneIds.get(0); if (DBG) { Rlog.d(LOG_TAG, "updateTimeZoneByNetworkCountryCode: no nitz but one TZ for iso-cc=" + iso + " with zone.getID=" + zoneId + " testOneUniqueOffsetPath=" + testOneUniqueOffsetPath); + " with zone.getID=" + zoneId); } mTimeZoneLog.log("updateTimeZoneByNetworkCountryCode: set time zone=" + zoneId + " iso=" + iso); Loading @@ -615,7 +602,6 @@ public class NitzStateMachine { Rlog.d(LOG_TAG, "updateTimeZoneByNetworkCountryCode: there are " + uniqueZoneIds.size() + " unique offsets for iso-cc='" + iso + " testOneUniqueOffsetPath=" + testOneUniqueOffsetPath + "', do nothing"); } } Loading
tests/telephonytests/src/com/android/internal/telephony/NitzStateMachineTest.java +0 −2 Original line number Diff line number Diff line Loading @@ -53,7 +53,6 @@ public class NitzStateMachineTest extends TelephonyTest { // Configure device state when(mDeviceState.getIgnoreNitz()).thenReturn(false); when(mDeviceState.getIgnoreNitzForTests()).thenReturn(false); when(mDeviceState.getNitzUpdateDiffMillis()).thenReturn(2000); when(mDeviceState.getNitzUpdateSpacingMillis()).thenReturn(1000 * 60 * 10); when(mDeviceState.elapsedRealtime()).thenReturn(123456789L); Loading @@ -68,7 +67,6 @@ public class NitzStateMachineTest extends TelephonyTest { // Confirm all mDeviceState side effects were verified. We don't care about retrievals of // device state. verify(mDeviceState, atLeast(0)).getIgnoreNitz(); verify(mDeviceState, atLeast(0)).getIgnoreNitzForTests(); verify(mDeviceState, atLeast(0)).getNitzUpdateDiffMillis(); verify(mDeviceState, atLeast(0)).getNitzUpdateSpacingMillis(); verify(mDeviceState, atLeast(0)).elapsedRealtime(); Loading