diff options
author | Tyler Gunn <tgunn@google.com> | 2017-10-06 10:08:18 -0700 |
---|---|---|
committer | Tyler Gunn <tgunn@google.com> | 2017-10-06 13:14:08 -0700 |
commit | f4cc3112101d48b546464bfb8766e6d8d6e6ae14 (patch) | |
tree | 06f60a3ebca5a12f624713391f2ead649805364d /src | |
parent | ea9322395fa8977ea60793a6deb04a7a7cc7ab4d (diff) | |
download | android_packages_services_Telecomm-f4cc3112101d48b546464bfb8766e6d8d6e6ae14.tar.gz android_packages_services_Telecomm-f4cc3112101d48b546464bfb8766e6d8d6e6ae14.tar.bz2 android_packages_services_Telecomm-f4cc3112101d48b546464bfb8766e6d8d6e6ae14.zip |
Fix NPE in TelecomManager#isOutgoingCallAllowed
There is a potential for a NPE if "excludeCall" is null. Adding null
check and unit tests to verify operation of the isOutgoingCallAllowed API,
as well as basic outgoing self-managed calls (which rely on this API).
Test: Added unit tests.
Change-Id: Ia5e92a7cb418af0d131daa2ca88b7cd4d36ab057
Fixes: 67495237
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/server/telecom/CallsManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/com/android/server/telecom/CallsManager.java b/src/com/android/server/telecom/CallsManager.java index 6cb08b2b..3e8e3d05 100644 --- a/src/com/android/server/telecom/CallsManager.java +++ b/src/com/android/server/telecom/CallsManager.java @@ -2893,10 +2893,10 @@ public class CallsManager extends Call.ListenerBase // Only permit outgoing calls if there is no ongoing emergency calls and all other calls // are associated with the current PhoneAccountHandle. return !hasEmergencyCall() && ( - excludeCall.getHandoverSourceCall() != null || - (!hasMaximumSelfManagedCalls(excludeCall, phoneAccountHandle) && - !hasCallsForOtherPhoneAccount(phoneAccountHandle) && - !hasManagedCalls())); + (excludeCall != null && excludeCall.getHandoverSourceCall() != null) || ( + !hasMaximumSelfManagedCalls(excludeCall, phoneAccountHandle) + && !hasCallsForOtherPhoneAccount(phoneAccountHandle) + && !hasManagedCalls())); } } |