diff options
author | Zoey Chen <zoeychen@google.com> | 2021-03-19 09:28:41 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2021-03-19 09:28:41 +0000 |
commit | a805d392299a11699d008a4a73384e0060d8710e (patch) | |
tree | 991ff50398ab4e0d0f58d6e1c5625f2f91edce34 | |
parent | 544f3d52118434dc5ea4319a6f33d0e3c1645a80 (diff) | |
parent | 8eac3a3ff1db4467841f48119546abb0ee172647 (diff) |
Merge "[Telephony] Return if context is null when register TelephonyCallback"
-rw-r--r-- | telephony/java/android/telephony/TelephonyManager.java | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 99b5687ba20d..1ff450a5d6b9 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -14574,6 +14574,11 @@ public class TelephonyManager { */ public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor, @NonNull TelephonyCallback callback) { + + if (mContext == null) { + throw new IllegalStateException("telephony service is null."); + } + if (executor == null || callback == null) { throw new IllegalArgumentException("TelephonyCallback and executor must be non-null"); } |