Merge "Extension API: Use NetworkScore object in API surface"
diff --git a/api/system-current.txt b/api/system-current.txt
index 8630b36..78dc577 100755
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -7775,7 +7775,7 @@
   }
 
   public static interface WifiManager.ScoreChangeCallback {
-    method public void onStatusChange(int, boolean);
+    method public void onScoreChange(int, @NonNull android.net.NetworkScore);
     method public void onTriggerUpdateOfWifiUsabilityStats(int);
   }
 
diff --git a/wifi/java/android/net/wifi/IScoreChangeCallback.aidl b/wifi/java/android/net/wifi/IScoreChangeCallback.aidl
index fd23610..462a978 100644
--- a/wifi/java/android/net/wifi/IScoreChangeCallback.aidl
+++ b/wifi/java/android/net/wifi/IScoreChangeCallback.aidl
@@ -16,6 +16,8 @@
 
 package android.net.wifi;
 
+import android.net.NetworkScore;
+
 /**
  * Interface for Wi-Fi network score callback.
  *
@@ -23,7 +25,7 @@
  */
 oneway interface IScoreChangeCallback
 {
-    void onStatusChange(int sessionId, boolean exiting);
+    void onScoreChange(int sessionId, in NetworkScore score);
 
     void onTriggerUpdateOfWifiUsabilityStats(int sessionId);
 }
diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java
index 76f9716..da521ed 100644
--- a/wifi/java/android/net/wifi/WifiManager.java
+++ b/wifi/java/android/net/wifi/WifiManager.java
@@ -38,6 +38,7 @@
 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;
@@ -5948,10 +5949,11 @@
          *
          * @param sessionId The ID to indicate current Wi-Fi network connection obtained from
          *                  {@link WifiConnectedNetworkScorer#start(int)}.
-         * @param isUsable The bit to indicate whether current Wi-Fi network is usable or not.
-         *                 Populated by connected network scorer in applications.
+         * @param score The {@link android.net.NetworkScore} object representing the
+         *              characteristics of current Wi-Fi network. Populated by connected network
+         *              scorer in applications.
          */
-        void onStatusChange(int sessionId, boolean isUsable);
+        void onScoreChange(int sessionId, @NonNull NetworkScore score);
 
         /**
          * Called by applications to trigger an update of {@link WifiUsabilityStatsEntry}.
@@ -5977,9 +5979,9 @@
         }
 
         @Override
-        public void onStatusChange(int sessionId, boolean isUsable) {
+        public void onScoreChange(int sessionId, @NonNull NetworkScore score) {
             try {
-                mScoreChangeCallback.onStatusChange(sessionId, isUsable);
+                mScoreChangeCallback.onScoreChange(sessionId, score);
             } catch (RemoteException e) {
                 throw e.rethrowFromSystemServer();
             }