Loading src/java/com/android/internal/telephony/NetworkTypeController.java +4 −1 Original line number Diff line number Diff line Loading @@ -1314,6 +1314,7 @@ public class NetworkTypeController extends StateMachine { mRatchetedNrBands.addAll(nrBands); } else { if (mFeatureFlags.supportNrSaRrcIdle() && mDoesPccListIndicateIdle && anchorNrCellId != mLastAnchorNrCellId && isUsingPhysicalChannelConfigForRrcDetection() && !mPrimaryCellChangedWhileIdle && !isNrAdvancedForPccFields(nrBandwidths, nrBands)) { Loading Loading @@ -1352,11 +1353,13 @@ public class NetworkTypeController extends StateMachine { if (secondaryRule != null) { int secondaryDuration = secondaryRule.getSecondaryTimer(mSecondaryTimerState); long durationMillis = secondaryDuration * 1000L; if ((mSecondaryTimerExpireTimestamp - SystemClock.uptimeMillis()) > durationMillis) { long now = SystemClock.uptimeMillis(); if ((mSecondaryTimerExpireTimestamp - now) > durationMillis) { if (DBG) log("Due to PCI change, reduce the secondary timer to " + durationMillis); removeMessages(EVENT_SECONDARY_TIMER_EXPIRED); sendMessageDelayed(EVENT_SECONDARY_TIMER_EXPIRED, mSecondaryTimerState, durationMillis); mSecondaryTimerExpireTimestamp = now + durationMillis; } } else { loge("!! Secondary timer is active, but found no rule for " + mPrimaryTimerState); Loading tests/telephonytests/src/com/android/internal/telephony/NetworkTypeControllerTest.java +16 −1 Original line number Diff line number Diff line Loading @@ -1649,8 +1649,23 @@ public class NetworkTypeControllerTest extends TelephonyTest { mNetworkTypeController.getOverrideNetworkType()); assertTrue(mNetworkTypeController.areAnyTimersActive()); // the timer has been reduced from 20 - 6s(advance band) to 5s(regular). Suppose passed 1s, // a new PCC shouldn't affect the timer. moveTimeForward(1 * 1000); mNetworkTypeController.sendMessage(11 /* EVENT_PHYSICAL_CHANNEL_CONFIGS_CHANGED */, new AsyncResult(null, Collections.emptyList(), null)); mNetworkTypeController.sendMessage(11 /* EVENT_PHYSICAL_CHANNEL_CONFIGS_CHANGED */, new AsyncResult(null, List.of( new PhysicalChannelConfig.Builder() .setPhysicalCellId(3) .setNetworkType(TelephonyManager.NETWORK_TYPE_NR) .setCellConnectionStatus(CellInfo.CONNECTION_PRIMARY_SERVING) .build()), null)); processAllMessages(); // Verify the timer has been reduced from 20 - 6s(advance band) to 5s(regular). moveTimeForward(5 * 1000); moveTimeForward(4 * 1000); processAllMessages(); assertEquals("connected_rrc_idle", getCurrentState().getName()); Loading Loading
src/java/com/android/internal/telephony/NetworkTypeController.java +4 −1 Original line number Diff line number Diff line Loading @@ -1314,6 +1314,7 @@ public class NetworkTypeController extends StateMachine { mRatchetedNrBands.addAll(nrBands); } else { if (mFeatureFlags.supportNrSaRrcIdle() && mDoesPccListIndicateIdle && anchorNrCellId != mLastAnchorNrCellId && isUsingPhysicalChannelConfigForRrcDetection() && !mPrimaryCellChangedWhileIdle && !isNrAdvancedForPccFields(nrBandwidths, nrBands)) { Loading Loading @@ -1352,11 +1353,13 @@ public class NetworkTypeController extends StateMachine { if (secondaryRule != null) { int secondaryDuration = secondaryRule.getSecondaryTimer(mSecondaryTimerState); long durationMillis = secondaryDuration * 1000L; if ((mSecondaryTimerExpireTimestamp - SystemClock.uptimeMillis()) > durationMillis) { long now = SystemClock.uptimeMillis(); if ((mSecondaryTimerExpireTimestamp - now) > durationMillis) { if (DBG) log("Due to PCI change, reduce the secondary timer to " + durationMillis); removeMessages(EVENT_SECONDARY_TIMER_EXPIRED); sendMessageDelayed(EVENT_SECONDARY_TIMER_EXPIRED, mSecondaryTimerState, durationMillis); mSecondaryTimerExpireTimestamp = now + durationMillis; } } else { loge("!! Secondary timer is active, but found no rule for " + mPrimaryTimerState); Loading
tests/telephonytests/src/com/android/internal/telephony/NetworkTypeControllerTest.java +16 −1 Original line number Diff line number Diff line Loading @@ -1649,8 +1649,23 @@ public class NetworkTypeControllerTest extends TelephonyTest { mNetworkTypeController.getOverrideNetworkType()); assertTrue(mNetworkTypeController.areAnyTimersActive()); // the timer has been reduced from 20 - 6s(advance band) to 5s(regular). Suppose passed 1s, // a new PCC shouldn't affect the timer. moveTimeForward(1 * 1000); mNetworkTypeController.sendMessage(11 /* EVENT_PHYSICAL_CHANNEL_CONFIGS_CHANGED */, new AsyncResult(null, Collections.emptyList(), null)); mNetworkTypeController.sendMessage(11 /* EVENT_PHYSICAL_CHANNEL_CONFIGS_CHANGED */, new AsyncResult(null, List.of( new PhysicalChannelConfig.Builder() .setPhysicalCellId(3) .setNetworkType(TelephonyManager.NETWORK_TYPE_NR) .setCellConnectionStatus(CellInfo.CONNECTION_PRIMARY_SERVING) .build()), null)); processAllMessages(); // Verify the timer has been reduced from 20 - 6s(advance band) to 5s(regular). moveTimeForward(5 * 1000); moveTimeForward(4 * 1000); processAllMessages(); assertEquals("connected_rrc_idle", getCurrentState().getName()); Loading