Merge "Check the timeout only the reason is CF_REASON_NO_REPLY" into sc-qpr1-dev

This commit is contained in:
Calvin Pan
2021-09-14 14:06:59 +00:00
committed by Android (Google) Code Review

View File

@@ -14302,7 +14302,8 @@ public class TelephonyManager {
if (callForwardingInfo.getNumber() == null) {
throw new IllegalArgumentException("callForwarding number is null");
}
if (callForwardingInfo.getTimeoutSeconds() <= 0) {
if (callForwardingReason == CallForwardingInfo.REASON_NO_REPLY
&& callForwardingInfo.getTimeoutSeconds() <= 0) {
throw new IllegalArgumentException("callForwarding timeout isn't positive");
}
}