Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c69d2c85 authored by Mingguang Xu's avatar Mingguang Xu Committed by Android (Google) Code Review
Browse files

Merge "Extension API: Use NetworkScore object in API surface"

parents 5f87e0df d5f4d2a6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -7775,7 +7775,7 @@ package android.net.wifi {
  }
  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);
  }
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.net.wifi;

import android.net.NetworkScore;

/**
 * Interface for Wi-Fi network score callback.
 *
@@ -23,7 +25,7 @@ package android.net.wifi;
 */
oneway interface IScoreChangeCallback
{
    void onStatusChange(int sessionId, boolean exiting);
    void onScoreChange(int sessionId, in NetworkScore score);

    void onTriggerUpdateOfWifiUsabilityStats(int sessionId);
}
+7 −5
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ 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;
@@ -5948,10 +5949,11 @@ public class WifiManager {
         *
         * @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 @@ public class WifiManager {
        }

        @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();
            }