Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)

Without this API we're more or less encouraging apps to have long running
processes (battery draining) to receive NetworkCallbacks for the stateful
NetworkCapabilities NET_CAPABILITIES_VALIDATED and
NET_CAPABILITIES_CAPTIVE_PORTAL.  With this API they can instead using
PendingIntents which outlive their apps.

Bug: 21343774
Change-Id: I168d0ac3757729acf7ca5546079846f575a0eedd
4 files changed