Extension API: Replace NetworkScore object with integer in API surface

NetworkScore object is removed as part of punting the network selection refoundation feature out of Android 11.

Test: atest android.net.wifi
Bug: 135573686, 122133502, 136312816, 135572156

Change-Id: Ib4226a4d66ab29fc4b31226d5ece8ad14a14d1e1
Signed-off-by: Mingguang Xu <mingguangxu@google.com>
(cherry picked from commit 705d110d85)
This commit is contained in:
Mingguang Xu
2020-02-20 23:52:20 -08:00
parent 27f83cdbce
commit dea9593d23
3 changed files with 7 additions and 11 deletions

View File

@@ -7528,7 +7528,7 @@ package android.net.wifi {
}
public static interface WifiManager.ScoreChangeCallback {
method public void onScoreChange(int, @NonNull android.net.NetworkScore);
method public void onScoreChange(int, int);
method public void onTriggerUpdateOfWifiUsabilityStats(int);
}

View File

@@ -16,16 +16,14 @@
package android.net.wifi;
import android.net.NetworkScore;
/**
* Interface for Wi-Fi network score callback.
* Interface for Wi-Fi score callback.
*
* @hide
*/
oneway interface IScoreChangeCallback
{
void onScoreChange(int sessionId, in NetworkScore score);
void onScoreChange(int sessionId, int score);
void onTriggerUpdateOfWifiUsabilityStats(int sessionId);
}

View File

@@ -39,7 +39,6 @@ import android.net.ConnectivityManager;
import android.net.DhcpInfo;
import android.net.MacAddress;
import android.net.Network;
import android.net.NetworkScore;
import android.net.NetworkStack;
import android.net.wifi.hotspot2.IProvisioningCallback;
import android.net.wifi.hotspot2.OsuProvider;
@@ -5986,11 +5985,10 @@ public class WifiManager {
*
* @param sessionId The ID to indicate current Wi-Fi network connection obtained from
* {@link WifiConnectedNetworkScorer#start(int)}.
* @param score The {@link android.net.NetworkScore} object representing the
* characteristics of current Wi-Fi network. Populated by connected network
* scorer in applications.
* @param score The score representing link quality of current Wi-Fi network connection.
* Populated by connected network scorer in applications..
*/
void onScoreChange(int sessionId, @NonNull NetworkScore score);
void onScoreChange(int sessionId, int score);
/**
* Called by applications to trigger an update of {@link WifiUsabilityStatsEntry}.
@@ -6016,7 +6014,7 @@ public class WifiManager {
}
@Override
public void onScoreChange(int sessionId, @NonNull NetworkScore score) {
public void onScoreChange(int sessionId, int score) {
try {
mScoreChangeCallback.onScoreChange(sessionId, score);
} catch (RemoteException e) {