Merge "[Telephony] Return if context is null when register TelephonyCallback"

This commit is contained in:
Zoey Chen
2021-03-19 09:28:41 +00:00
committed by Gerrit Code Review

View File

@@ -14574,6 +14574,11 @@ public class TelephonyManager {
*/ */
public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor, public void registerTelephonyCallback(@NonNull @CallbackExecutor Executor executor,
@NonNull TelephonyCallback callback) { @NonNull TelephonyCallback callback) {
if (mContext == null) {
throw new IllegalStateException("telephony service is null.");
}
if (executor == null || callback == null) { if (executor == null || callback == null) {
throw new IllegalArgumentException("TelephonyCallback and executor must be non-null"); throw new IllegalArgumentException("TelephonyCallback and executor must be non-null");
} }