diff --git a/TEST_MAPPING b/TEST_MAPPING
index 32e32af..60b77c8 100644
--- a/TEST_MAPPING
+++ b/TEST_MAPPING
@@ -1,7 +1,8 @@
 {
   "presubmit": [
     {
-      "name": "QualifiedNetworksServiceTests"
+      "name": "QualifiedNetworksServiceTests",
+      "keywords": ["internal"]
     }
   ]
 }
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
index f77da91..44e5972 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkEvaluator.java
@@ -1251,11 +1251,21 @@
             }
         }
 
-        /* Check handover policy */
-        if (needHandoverPolicyCheck()) {
-            if (!moveTransportTypeAllowed()) {
-                log("Handover is not allowed. Skip this evaluation.");
-                return;
+        if (mDataConnectionStatusTracker.isActiveState()) {
+            /* Check handover policy */
+            if (isHandoverPolicyCheckAvailable()) {
+                if (!moveTransportTypeAllowed()) {
+                    log("Handover is not allowed. Skip this evaluation.");
+                    return;
+                }
+            } else {
+                if (specificReason == EVALUATE_SPECIFIC_REASON_IWLAN_DISABLE
+                        && !mCellularAvailable) {
+                    log("Allow evaluation without handover policy check");
+                } else {
+                    log("Handover policy check is not available. Skip this evaluation.");
+                    return;
+                }
             }
         }
 
@@ -1394,7 +1404,7 @@
     }
 
     @VisibleForTesting
-    boolean needHandoverPolicyCheck() {
+    boolean isHandoverPolicyCheckAvailable() {
         if (mDataConnectionStatusTracker.isActiveState()) {
             int srcTransportType = mDataConnectionStatusTracker.getLastTransportType();
             boolean targetNetworkAvailable =
@@ -1402,11 +1412,11 @@
                             ? mCellularAvailable
                             : mIwlanAvailable;
             if (srcTransportType == getLastQualifiedTransportType() && targetNetworkAvailable) {
-                log("Need to check handover policy for this evaluation.");
+                log(" handover policy check is available for this evaluation.");
                 return true;
             }
         }
-        log("No need to check handover policy for this evaluation.");
+        log("handover policy check is not available for this evaluation.");
         return false;
     }
 
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkSelectionPolicyBuilder.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkSelectionPolicyBuilder.java
index cae0c07..7b32183 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkSelectionPolicyBuilder.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/AccessNetworkSelectionPolicyBuilder.java
@@ -53,7 +53,7 @@
     static final int GUARDING_CELL = QnsConstants.GUARDING_CELLULAR;
     static final int GUARDING_WIFI = QnsConstants.GUARDING_WIFI;
 
-    static HashMap<AnspKey, String[]> sPolicyMap;
+    static final HashMap<AnspKey, String[]> sPolicyMap;
 
     static {
         // Default policy map
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/AnspImsPreferModePolicyBuilder.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/AnspImsPreferModePolicyBuilder.java
index fcfcd2d..01c3062 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/AnspImsPreferModePolicyBuilder.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/AnspImsPreferModePolicyBuilder.java
@@ -23,6 +23,7 @@
 
 class AnspImsPreferModePolicyBuilder extends AccessNetworkSelectionPolicyBuilder {
 
+    static final HashMap<AnspKey, String[]> sImsPreferModePolicyMap;
     AnspImsPreferModePolicyBuilder(
             QnsCarrierConfigManager configManager, int netCapability) {
         super(configManager, netCapability);
@@ -30,49 +31,49 @@
     }
 
     static {
-        sPolicyMap = new HashMap<>();
-        sPolicyMap.put(
+        sImsPreferModePolicyMap = new HashMap<>();
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, IDLE, WIFI_PREF), new String[] {"Condition:WIFI_AVAILABLE"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, IDLE, WIFI_PREF),
                 new String[] {"Condition:EUTRAN_TOLERABLE"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VOICE, WIFI_PREF), new String[] {"Condition:WIFI_GOOD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VOICE, WIFI_PREF),
                 new String[] {"Condition:WIFI_BAD,EUTRAN_TOLERABLE"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VIDEO, WIFI_PREF), new String[] {"Condition:WIFI_GOOD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VIDEO, WIFI_PREF),
                 new String[] {"Condition:WIFI_BAD,EUTRAN_TOLERABLE"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, IDLE, CELL_PREF, ROAM),
                 new String[] {"Condition:WIFI_GOOD,CELLULAR_BAD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, IDLE, CELL_PREF, ROAM),
                 new String[] {"Condition:CELLULAR_GOOD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VOICE, CELL_PREF, ROAM),
                 new String[] {"Condition:WIFI_GOOD,CELLULAR_BAD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VOICE, CELL_PREF, ROAM),
                 new String[] {"Condition:WIFI_BAD,EUTRAN_TOLERABLE"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VIDEO, CELL_PREF, ROAM),
                 new String[] {"Condition:WIFI_GOOD,CELLULAR_BAD"});
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VIDEO, CELL_PREF, ROAM),
                 new String[] {"Condition:WIFI_BAD,EUTRAN_TOLERABLE"});
         // Overridden rules to ims preference from cellular preference
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, IDLE, CELL_PREF, HOME),
                 new String[] {
                     "Condition:WIFI_GOOD,EUTRAN_BAD",
                     "Condition:WIFI_GOOD,UTRAN_AVAILABLE",
                     "Condition:WIFI_GOOD,GERAN_AVAILABLE"
                 });
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, IDLE, CELL_PREF, HOME),
                 new String[] {
                     "Condition:EUTRAN_GOOD",
@@ -80,14 +81,14 @@
                     "Condition:WIFI_BAD,UTRAN_GOOD",
                     "Condition:WIFI_BAD,GERAN_GOOD"
                 });
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VOICE, CELL_PREF, HOME),
                 new String[] {
                     "Condition:WIFI_GOOD,EUTRAN_BAD",
                     "Condition:WIFI_GOOD,UTRAN_AVAILABLE",
                     "Condition:WIFI_GOOD,GERAN_AVAILABLE"
                 });
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VOICE, CELL_PREF, HOME),
                 new String[] {
                     "Condition:EUTRAN_GOOD",
@@ -95,14 +96,14 @@
                     "Condition:WIFI_BAD,UTRAN_GOOD",
                     "Condition:WIFI_BAD,GERAN_GOOD"
                 });
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_IN, VIDEO, CELL_PREF, HOME),
                 new String[] {
                     "Condition:WIFI_GOOD,EUTRAN_BAD",
                     "Condition:WIFI_GOOD,UTRAN_AVAILABLE",
                     "Condition:WIFI_GOOD,GERAN_AVAILABLE"
                 });
-        sPolicyMap.put(
+        sImsPreferModePolicyMap.put(
                 new AnspKey(ROVE_OUT, VIDEO, CELL_PREF, HOME),
                 new String[] {
                     "Condition:EUTRAN_GOOD",
@@ -117,11 +118,11 @@
             @QnsConstants.RoveDirection int direction,
             AccessNetworkSelectionPolicy.PreCondition preCondition) {
         if (preCondition.getPreference() == WIFI_PREF) {
-            return sPolicyMap.get(
+            return sImsPreferModePolicyMap.get(
                     new AnspKey(
                             direction, preCondition.getCallType(), preCondition.getPreference()));
         }
-        return sPolicyMap.get(
+        return sImsPreferModePolicyMap.get(
                 new AnspKey(
                         direction,
                         preCondition.getCallType(),
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
index cc1f194..eb2f231 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/QnsCallStatusTracker.java
@@ -649,7 +649,7 @@
                 return QnsConstants.INVALID_VALUE;
             }
             long qualityLevel = sumDownLinkQualityLevelVolume / totalDuration;
-            Log.d(mLogTag, "getDownLinkQualityLevel for [" + AccessNetworkConstants
+            Log.d(mLogTag, "getDownLinkQualityLevel for [" + QnsConstants
                     .transportTypeToString(transportType) + "] totalQualityVolume: "
                     + sumDownLinkQualityLevelVolume + ", totalDuration: " + totalDuration
                     + " level:" + qualityLevel);
@@ -907,9 +907,9 @@
         for (CallState cs : mCallStates) {
             if (cs.getImsCallServiceType() == ImsCallProfile.SERVICE_TYPE_NORMAL
                     && cs.getImsCallType() == ImsCallProfile.CALL_TYPE_VT
-                    && (cs.getCallState() != PreciseCallState.PRECISE_CALL_STATE_ALERTING
-                    && cs.getCallState() != PreciseCallState.PRECISE_CALL_STATE_DIALING
-                    && cs.getCallState() != PreciseCallState.PRECISE_CALL_STATE_INCOMING)) {
+                    && (cs.getCallState() == PreciseCallState.PRECISE_CALL_STATE_DISCONNECTING
+                            || cs.getCallState() == PreciseCallState.PRECISE_CALL_STATE_HOLDING
+                            || cs.getCallState() == PreciseCallState.PRECISE_CALL_STATE_ACTIVE)) {
                 return true;
             }
         }
diff --git a/services/QualifiedNetworksService/src/com/android/telephony/qns/RestrictManager.java b/services/QualifiedNetworksService/src/com/android/telephony/qns/RestrictManager.java
index 21eaf7c..aefa469 100644
--- a/services/QualifiedNetworksService/src/com/android/telephony/qns/RestrictManager.java
+++ b/services/QualifiedNetworksService/src/com/android/telephony/qns/RestrictManager.java
@@ -139,6 +139,8 @@
     private static final int[] ignorableRestrictionsOnSingleRat =
             new int[] {
                 RESTRICT_TYPE_GUARDING,
+                //Ignore throttling restriction at single RAT, let FWK control throttling.
+                RESTRICT_TYPE_THROTTLING,
                 RESTRICT_TYPE_RTP_LOW_QUALITY,
                 RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL,
                 RESTRICT_TYPE_FALLBACK_TO_WWAN_IMS_REGI_FAIL,
@@ -320,7 +322,7 @@
 
     class LowRtpQualityRestriction extends Restriction{
         private int mReason;
-        LowRtpQualityRestriction(int type, int[] releaseEvents, int restrictTime, int reason) {
+        LowRtpQualityRestriction(int type, int[] releaseEvents, long restrictTime, int reason) {
             super(type, releaseEvents, restrictTime);
             mReason = reason;
         }
@@ -373,6 +375,15 @@
             }
         }
 
+        boolean isRestrictionExpired(long elapsedRealTime) {
+            if (mReleaseTime != 0 && (mReleaseTime - elapsedRealTime < 0)) {
+                Log.d(mLogTag, restrictTypeToString(mRestrictType) + " was expired."
+                        + "release time:" + mReleaseTime + ", now:" + elapsedRealTime);
+                return true;
+            }
+            return false;
+        }
+
         @Override
         public String toString() {
             StringBuilder builder = new StringBuilder();
@@ -397,20 +408,28 @@
 
     class RestrictInfo {
         private int mTransportMode; // AccessNetworkConstants.TRANSPORT_TYPE_WWAN;
-        private HashMap<Integer, Restriction> mRestrictionMap = new HashMap<>();
+        private Map<Integer, Restriction> mRestrictionMap = new ConcurrentHashMap<>();
 
         RestrictInfo(int transportMode) {
             mTransportMode = transportMode;
         }
 
-        HashMap<Integer, Restriction> getRestrictionMap() {
+        Map<Integer, Restriction> getRestrictionMap() {
             return mRestrictionMap;
         }
 
         boolean isRestricted() {
+            checkUpExpirationTime();
             return mRestrictionMap.size() != 0;
         }
 
+        private void checkUpExpirationTime() {
+            if (mRestrictionMap.size() > 0) {
+                long now = QnsUtils.getSystemElapsedRealTime();
+                mRestrictionMap.entrySet().removeIf(e -> e.getValue().isRestrictionExpired(now));
+            }
+        }
+
         /**
          * This method returns if the restriction info has given restriction type.
          *
@@ -673,7 +692,7 @@
                 if ((reason & 1 << QnsConstants.RTP_LOW_QUALITY_REASON_NO_RTP) != 0) {
                     releaseRestriction(QnsUtils.getOtherTransportType(mTransportType),
                             RESTRICT_TYPE_GUARDING, true);
-                    HashMap<Integer, Restriction> restrictionMap = mRestrictInfos
+                    Map<Integer, Restriction> restrictionMap = mRestrictInfos
                             .get(QnsUtils.getOtherTransportType(mTransportType))
                             .getRestrictionMap();
                     Restriction restrictionOtherSide = restrictionMap.get(
@@ -751,6 +770,7 @@
         clearInitialPdnConnectionFailFallbackRestriction();
 
         checkIfCancelNonPreferredRestriction(QnsUtils.getOtherTransportType(transportType));
+        releaseRestriction(transportType, RESTRICT_TYPE_THROTTLING, true);
         if (mNetCapability == NetworkCapabilities.NET_CAPABILITY_IMS) {
             if (mLastEvaluatedTransportType == AccessNetworkConstants.TRANSPORT_TYPE_INVALID
                     || transportType == mLastEvaluatedTransportType) {
@@ -1133,7 +1153,7 @@
         int currGuardingTransport = QnsUtils.getOtherTransportType(mTransportType);
         if (mRestrictInfos.get(currGuardingTransport) == null) return;
 
-        HashMap<Integer, Restriction> restrictionMap =
+        Map<Integer, Restriction> restrictionMap =
                 mRestrictInfos.get(currGuardingTransport).getRestrictionMap();
         Restriction restriction = restrictionMap.get(RESTRICT_TYPE_GUARDING);
 
@@ -1191,7 +1211,7 @@
 
     void addRestriction(int transport, Restriction restrictObj, long timeMillis) {
         boolean needNotify = false;
-        HashMap<Integer, Restriction> restrictionMap =
+        Map<Integer, Restriction> restrictionMap =
                 mRestrictInfos.get(transport).getRestrictionMap();
         Restriction restriction = restrictionMap.get(restrictObj.mRestrictType);
         Log.d(
@@ -1235,7 +1255,7 @@
 
     void addRestriction(int transport, int type, int[] releaseEvents, long timeMillis) {
         boolean needNotify = false;
-        HashMap<Integer, Restriction> restrictionMap =
+        Map<Integer, Restriction> restrictionMap =
                 mRestrictInfos.get(transport).getRestrictionMap();
         Restriction restriction = restrictionMap.get(type);
         Log.d(
@@ -1283,7 +1303,7 @@
 
     void releaseRestriction(int transport, int type, boolean skipNotify) {
         boolean needNotify = false;
-        HashMap<Integer, Restriction> restrictionMap =
+        Map<Integer, Restriction> restrictionMap =
                 mRestrictInfos.get(transport).getRestrictionMap();
         Restriction restriction = restrictionMap.get(type);
         Log.d(
@@ -1311,7 +1331,7 @@
 
     void processReleaseEvent(int transportType, int event) {
         ArrayList<Integer> releaseList = new ArrayList<>();
-        HashMap<Integer, Restriction> restrictMap =
+        Map<Integer, Restriction> restrictMap =
                 mRestrictInfos.get(transportType).getRestrictionMap();
         Log.d(
                 mLogTag,
diff --git a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/AccessNetworkEvaluatorTest.java b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/AccessNetworkEvaluatorTest.java
index 9c59fd7..cb7a516 100644
--- a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/AccessNetworkEvaluatorTest.java
+++ b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/AccessNetworkEvaluatorTest.java
@@ -304,7 +304,7 @@
                 mMockQnsTelephonyListener.new QnsTelephonyInfoIms(info, true, true, false, false);
         mAne.onQnsTelephonyInfoChanged(infoIms);
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
-        assertFalse(mAne.needHandoverPolicyCheck());
+        assertFalse(mAne.isHandoverPolicyCheckAvailable());
         assertTrue(mAne.moveTransportTypeAllowed());
 
         info = mMockQnsTelephonyListener.new QnsTelephonyInfo();
@@ -316,7 +316,7 @@
         infoIms = mMockQnsTelephonyListener.new QnsTelephonyInfoIms(info, true, true, true, true);
         mAne.onQnsTelephonyInfoChanged(infoIms);
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertTrue(mAne.moveTransportTypeAllowed());
 
         info = mMockQnsTelephonyListener.new QnsTelephonyInfo();
@@ -328,7 +328,7 @@
         infoIms = mMockQnsTelephonyListener.new QnsTelephonyInfoIms(info, true, true, true, true);
         mAne.onQnsTelephonyInfoChanged(infoIms);
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertTrue(mAne.moveTransportTypeAllowed());
     }
 
@@ -367,7 +367,7 @@
         mAne.onQnsTelephonyInfoChanged(infoIms);
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
         mAne.onSetCallType(QnsConstants.CALL_TYPE_EMERGENCY);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertTrue(mAne.moveTransportTypeAllowed());
 
         when(mMockQnsConfigManager.isHandoverAllowedByPolicy(
@@ -388,19 +388,19 @@
         mAne.onSetCallType(QnsConstants.CALL_TYPE_VOICE);
         when(mMockQnsCallStatusTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_IMS))
                 .thenReturn(false);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertFalse(mAne.moveTransportTypeAllowed());
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
         mAne.onSetCallType(QnsConstants.CALL_TYPE_IDLE);
         when(mMockQnsCallStatusTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_IMS))
                 .thenReturn(true);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertTrue(mAne.moveTransportTypeAllowed());
         mAne.updateLastNotifiedQualifiedNetwork(accessNetworks);
         mAne.onSetCallType(QnsConstants.CALL_TYPE_EMERGENCY);
         when(mMockQnsCallStatusTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_IMS))
                 .thenReturn(false);
-        assertTrue(mAne.needHandoverPolicyCheck());
+        assertTrue(mAne.isHandoverPolicyCheckAvailable());
         assertFalse(mAne.moveTransportTypeAllowed());
     }
 
@@ -482,9 +482,9 @@
         when(mMockQnsConfigManager.getRatPreference(NetworkCapabilities.NET_CAPABILITY_IMS))
                 .thenReturn(QnsConstants.RAT_PREFERENCE_DEFAULT);
 
-        when(mDataConnectionStatusTracker.isActiveState()).thenReturn(true);
+        when(mDataConnectionStatusTracker.isActiveState()).thenReturn(false);
         when(mDataConnectionStatusTracker.isInactiveState()).thenReturn(true);
-        when(mDataConnectionStatusTracker.isHandoverState()).thenReturn(true);
+        when(mDataConnectionStatusTracker.isHandoverState()).thenReturn(false);
 
         when(mRestrictManager.isRestricted(anyInt())).thenReturn(true);
         when(mRestrictManager.isAllowedOnSingleTransport(anyInt())).thenReturn(true);
diff --git a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/QnsCallStatusTrackerTest.java b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/QnsCallStatusTrackerTest.java
index a9247f0..eed22f4 100644
--- a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/QnsCallStatusTrackerTest.java
+++ b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/QnsCallStatusTrackerTest.java
@@ -289,6 +289,21 @@
         mTestCallStateList.add(new CallState.Builder(PreciseCallState.PRECISE_CALL_STATE_ACTIVE)
                 .setImsCallType(ImsCallProfile.CALL_TYPE_VOICE)
                 .setImsCallServiceType(ImsCallProfile.SERVICE_TYPE_NORMAL).build());
+        mTestCallStateList.add(new CallState.Builder(PreciseCallState.PRECISE_CALL_STATE_WAITING)
+                .setImsCallType(ImsCallProfile.CALL_TYPE_VT)
+                .setImsCallServiceType(ImsCallProfile.SERVICE_TYPE_NORMAL).build());
+        mCallTracker.updateCallState(mTestCallStateList);
+        msg = mTestLooperListener.nextMessage();
+        // Video call is still in waiting state, QNS call type changed event should not be happened.
+        assertNull(msg);
+        assertFalse(mCallTracker.isCallIdle()); // for IMS calls only
+        assertTrue(mCallTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_EIMS));
+        assertFalse(mCallTracker.isCallIdle(NetworkCapabilities.NET_CAPABILITY_IMS));
+
+        mTestCallStateList.clear();
+        mTestCallStateList.add(new CallState.Builder(PreciseCallState.PRECISE_CALL_STATE_ACTIVE)
+                .setImsCallType(ImsCallProfile.CALL_TYPE_VOICE)
+                .setImsCallServiceType(ImsCallProfile.SERVICE_TYPE_NORMAL).build());
         mTestCallStateList.add(new CallState.Builder(PreciseCallState.PRECISE_CALL_STATE_HOLDING)
                 .setImsCallType(ImsCallProfile.CALL_TYPE_VT)
                 .setImsCallServiceType(ImsCallProfile.SERVICE_TYPE_NORMAL).build());
diff --git a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/RestrictManagerTest.java b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/RestrictManagerTest.java
index ddc193a..b63a950 100644
--- a/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/RestrictManagerTest.java
+++ b/services/QualifiedNetworksService/tests/src/com/android/telephony/qns/RestrictManagerTest.java
@@ -433,6 +433,79 @@
     }
 
     @Test
+    public void testCheckExpiredTime() {
+        assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
+        assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
+        long now = SystemClock.elapsedRealtime();
+        long throttleTime = now + 600000;
+        mRestrictManager.addRestriction(
+                AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                RESTRICT_TYPE_RTP_LOW_QUALITY,
+                sReleaseEventMap.get(RESTRICT_TYPE_RTP_LOW_QUALITY),
+                DEFAULT_RESTRICT_WITH_LOW_RTP_QUALITY_TIME);
+        mRestrictManager.notifyThrottling(
+                true, throttleTime, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                        RESTRICT_TYPE_RTP_LOW_QUALITY));
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                        RESTRICT_TYPE_THROTTLING));
+        lenient().when(QnsUtils.getSystemElapsedRealTime()).thenReturn(now + 3000);
+        assertTrue(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
+
+        lenient().when(QnsUtils.getSystemElapsedRealTime()).thenReturn(now + 100000);
+        assertTrue(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
+        assertFalse(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                        RESTRICT_TYPE_RTP_LOW_QUALITY));
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                        RESTRICT_TYPE_THROTTLING));
+        lenient().when(QnsUtils.getSystemElapsedRealTime()).thenReturn(now + 700000);
+        assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
+        assertFalse(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
+                        RESTRICT_TYPE_THROTTLING));
+
+        mRestrictManager.addRestriction(
+                AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
+                RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL,
+                sReleaseEventMap.get(RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL),
+                0);
+        mRestrictManager.notifyThrottling(
+                true, throttleTime, AccessNetworkConstants.TRANSPORT_TYPE_WLAN);
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
+                        RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL));
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
+                        RESTRICT_TYPE_THROTTLING));
+        lenient().when(QnsUtils.getSystemElapsedRealTime()).thenReturn(now + 3000);
+        assertTrue(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WLAN));
+        lenient().when(QnsUtils.getSystemElapsedRealTime()).thenReturn(now + 700000);
+        assertTrue(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WLAN));
+        assertTrue(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
+                        RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL));
+        assertFalse(
+                mRestrictManager.hasRestrictionType(
+                        AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
+                        RESTRICT_TYPE_THROTTLING));
+        mRestrictManager.releaseRestriction(
+                AccessNetworkConstants.TRANSPORT_TYPE_WLAN, RESTRICT_TYPE_RESTRICT_IWLAN_IN_CALL);
+        assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WLAN));
+    }
+
+    @Test
     public void testWwanToWlanGuardingOnHandoverStart() {
         DataConnectionStatusTracker.DataConnectionChangedInfo dcInfo =
                 new DataConnectionStatusTracker.DataConnectionChangedInfo(
@@ -1178,8 +1251,8 @@
                 DEFAULT_GUARDING_TIME);
         mRestrictManager.addRestriction(
                 AccessNetworkConstants.TRANSPORT_TYPE_WWAN,
-                RESTRICT_TYPE_THROTTLING,
-                sReleaseEventMap.get(RESTRICT_TYPE_THROTTLING),
+                RESTRICT_TYPE_RESTRICT_IWLAN_CS_CALL,
+                sReleaseEventMap.get(RESTRICT_TYPE_RESTRICT_IWLAN_CS_CALL),
                 600000);
         mRestrictManager.addRestriction(
                 AccessNetworkConstants.TRANSPORT_TYPE_WLAN,
@@ -1209,6 +1282,8 @@
         mRestrictManager.notifyThrottling(false, 0, AccessNetworkConstants.TRANSPORT_TYPE_WWAN);
         mRestrictManager.processReleaseEvent(
                 AccessNetworkConstants.TRANSPORT_TYPE_WLAN, RELEASE_EVENT_DISCONNECT);
+        mRestrictManager.releaseRestriction(
+                AccessNetworkConstants.TRANSPORT_TYPE_WWAN, RESTRICT_TYPE_RESTRICT_IWLAN_CS_CALL);
         assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WLAN));
         assertFalse(mRestrictManager.isRestricted(AccessNetworkConstants.TRANSPORT_TYPE_WWAN));
     }
