[NS05] Feed network offer callbacks

The design is very simply expressed :
An offer is needed for a request if and only if that offer
might beat the satisfier for that request.

The implementation of "might beat" is NetworkRanker#mightBeat.

Test: FrameworksNetTests FrameworksWifiTests NetworkStackTests
Bug: 167544279
Merged-In: I3c2563d4ae4e3715d0c6270344ba8f7ef067872f
Merged-In: I0fe911eef2483ecbac48c733d56283b81538690a
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
  (cherry-picked from 7b6a33bd50)
This commit is contained in:
Chalard Jean
2021-01-12 10:58:56 +09:00
committed by Junyu Lai
parent 3c5921caea
commit 0354d8c7e0
11 changed files with 625 additions and 294 deletions

View File

@@ -3360,7 +3360,7 @@ public class ConnectivityManager {
* @param score The prospective score of the network.
* @param caps The prospective capabilities of the network.
* @param callback The callback to call when this offer is needed or unneeded.
* @hide
* @hide exposed via the NetworkProvider class.
*/
@RequiresPermission(anyOf = {
NetworkStack.PERMISSION_MAINLINE_NETWORK_STACK,
@@ -3383,7 +3383,7 @@ public class ConnectivityManager {
*
* @param callback The callback passed at registration time. This must be the same object
* that was passed to {@link #offerNetwork}
* @hide
* @hide exposed via the NetworkProvider class.
*/
public void unofferNetwork(@NonNull final INetworkOfferCallback callback) {
try {