Always send all available state when calling onAvailable().

The state that needs to be transferred includes:
    - NetworkCapabilities
    - LinkProperties
    - whether the network is currently suspended

Additionally:
    - Rename notifyNetworkCallback() to notifyNetworkAvailable()
      in order to clarify its real function.
    - fix previous copy/paste error in unittest

Test: as follows
    - built (bullhead)
    - flashed
    - booted
    - runtest frameworks-net passes
    - USB tethering with mobile and Wi-Fi upstream toggling
Bug: 32163131
Change-Id: Ib4460bcd5d08863a9feac9e8ab41a238897bb3ea
This commit is contained in:
Erik Kline 2017-02-15 19:59:17 +09:00
commit 99f301bdfd

View file

@ -1061,6 +1061,8 @@ public class ConnectivityManager {
* registerNetworkCallback() are not specific to any particular Network so
* do not cause any updates.
*
* TODO: Delete once callers are updated.
*
* @hide
*/
public void requestLinkProperties(NetworkCallback networkCallback) {
@ -1098,6 +1100,8 @@ public class ConnectivityManager {
* registerNetworkCallback() are not specific to any particular Network so
* do not cause any updates.
*
* TODO: Delete once callers are updated.
*
* @hide
*/
public void requestNetworkCapabilities(NetworkCallback networkCallback) {