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

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

Merge changes from topic "wifi_api_to_receive_score"

* changes:
  Wifi usability: Add new entry into wifi.proto for metrics collection
  Wifi usability: Add @SystemApi to receive Wifi usability score
parents 48340af0 e7e344ab
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -4665,6 +4665,7 @@ package android.net.wifi {
    method @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void startSubscriptionProvisioning(android.net.wifi.hotspot2.OsuProvider, android.net.wifi.hotspot2.ProvisioningCallback, @Nullable android.os.Handler);
    method @RequiresPermission(anyOf={"android.permission.NETWORK_SETTINGS", android.Manifest.permission.NETWORK_SETUP_WIZARD}) public void stopEasyConnectSession();
    method @RequiresPermission("android.permission.NETWORK_SETTINGS") public void unregisterNetworkRequestMatchCallback(@NonNull android.net.wifi.WifiManager.NetworkRequestMatchCallback);
    method @RequiresPermission("android.permission.WIFI_UPDATE_USABILITY_STATS_SCORE") public void updateWifiUsabilityScore(int, int, int);
    field public static final int CHANGE_REASON_ADDED = 0; // 0x0
    field public static final int CHANGE_REASON_CONFIG_CHANGE = 2; // 0x2
    field public static final int CHANGE_REASON_REMOVED = 1; // 0x1
+12 −0
Original line number Diff line number Diff line
@@ -965,6 +965,10 @@ message StaEvent {

  // NetworkAgent Wifi usability score of connected wifi
  optional int32 last_wifi_usability_score = 15 [default = -1];

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 last_prediction_horizon_sec = 16 [default = -1];
}

// Wi-Fi Aware metrics
@@ -1682,6 +1686,10 @@ message WifiIsUnusableEvent {
  // NetworkAgent wifi usability score of connected wifi.
  // Defaults to -1 if the score was never set.
  optional int32 last_wifi_usability_score = 11 [default = -1];

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 last_prediction_horizon_sec = 12 [default = -1];
}

message PasspointProfileTypeCount {
@@ -1814,6 +1822,10 @@ message WifiUsabilityStatsEntry {

  // The total number of beacons received from the last radio chip reset
  optional int64 total_beacon_rx = 22;

  // Prediction horizon (in second) of Wifi usability score provided by external
  // system app
  optional int32 prediction_horizon_sec = 23;
}

message WifiUsabilityStats {
+2 −0
Original line number Diff line number Diff line
@@ -214,4 +214,6 @@ interface IWifiManager
        in IDppCallback callback);

    void stopDppSession();

    void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec);
}
+23 −1
Original line number Diff line number Diff line
@@ -4865,4 +4865,26 @@ public class WifiManager {
            throw e.rethrowFromSystemServer();
        }
    }

    /**
     * Provide a Wi-Fi usability score information to be recorded (but not acted upon) by the
     * framework. The Wi-Fi usability score is derived from {@link WifiUsabilityStatsListener}
     * where a score is matched to Wi-Fi usability statistics using the sequence number. The score
     * is used to quantify whether Wi-Fi is usable in a future time.
     *
     * @param seqNum Sequence number of the Wi-Fi usability score.
     * @param score The Wi-Fi usability score.
     * @param predictionHorizonSec Prediction horizon of the Wi-Fi usability score.
     *
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.WIFI_UPDATE_USABILITY_STATS_SCORE)
    public void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec) {
        try {
            mService.updateWifiUsabilityScore(seqNum, score, predictionHorizonSec);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
    }
}
 No newline at end of file
+5 −0
Original line number Diff line number Diff line
@@ -476,4 +476,9 @@ public class BaseWifiService extends IWifiManager.Stub {
    public void removeWifiUsabilityStatsListener(int listenerIdentifier) {
        throw new UnsupportedOperationException();
    }

    @Override
    public void updateWifiUsabilityScore(int seqNum, int score, int predictionHorizonSec) {
        throw new UnsupportedOperationException();
    }
}