getNetworkInfoFromBroadcast

open fun getNetworkInfoFromBroadcast(@NonNull cm: @NonNull ConnectivityManager, @NonNull intent: @NonNull Intent): @Nullable NetworkInfo(source)

Return the NetworkInfo that caused the given CONNECTIVITY_ACTION broadcast. This obtains the current state from ConnectivityManager instead of using the potentially-stale value from EXTRA_NETWORK_INFO. May be null.