[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
Change-Id: I0fe911eef2483ecbac48c733d56283b81538690a
This commit is contained in:
Chalard Jean
2021-01-12 10:58:56 +09:00
parent edf9d3f2d6
commit 428b913abd
4 changed files with 30 additions and 19 deletions

View File

@@ -3345,7 +3345,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,
@@ -3368,7 +3368,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 {