summaryrefslogtreecommitdiff
path: root/telephony/java/android
diff options
context:
space:
mode:
authorCalvin Pan <calvinpan@google.com>2021-09-13 17:33:57 +0800
committerCalvin Pan <calvinpan@google.com>2021-09-13 10:16:54 +0000
commitf7e9afbea4d8ff41c97a6e8d1ff2f61365331c11 (patch)
tree9cd40e59605a6376ac2a63ec8ff25fa1fda74cdd /telephony/java/android
parent906b2ed5a1d47d9240f32237f7ef7bc3c90fd896 (diff)
Check the timeout only the reason is CF_REASON_NO_REPLY
The timeout in call forwarding is only valid for CF_REASON_NO_REPLY reason, so only check if reason is CF_REASON_NO_REPLY Bug: 194112447 Test: enable/disable call forwarding Change-Id: I290d5fa64f0a32ddcaf1f16c51b99f52e8e38913
Diffstat (limited to 'telephony/java/android')
-rw-r--r--telephony/java/android/telephony/TelephonyManager.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java
index abab426b3252..d5be4f36145a 100644
--- a/telephony/java/android/telephony/TelephonyManager.java
+++ b/telephony/java/android/telephony/TelephonyManager.java
@@ -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");
}
}