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

Commit eb9f8195 authored by Roshan Pius's avatar Roshan Pius Committed by Android (Google) Code Review
Browse files

Merge changes from topics "abort_network_request", "untrused_network",...

Merge changes from topics "abort_network_request", "untrused_network", "on_match_scan_results", "network_suggestions_impl"

* changes:
  WifiManager: Add abort callback for network request
  WifiNetworkAgentSpecifier: Allow satisfiedBy call for 2 instances
  WifiConfiguration: Add a field to mark network as trusted
  WifiManager: Send list of matching scan results for network request
  WifiManager: Implement network suggestion API
  wifi(API): Send directed broadcast post connection for suggestions
parents 9e12f816 7d18334f
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -28983,7 +28983,7 @@ package android.net.wifi {
  public class WifiManager {
    method public deprecated int addNetwork(android.net.wifi.WifiConfiguration);
    method public boolean addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>, android.app.PendingIntent);
    method public boolean addNetworkSuggestions(java.util.List<android.net.wifi.WifiNetworkSuggestion>);
    method public void addOrUpdatePasspointConfiguration(android.net.wifi.hotspot2.PasspointConfiguration);
    method public static int calculateSignalLevel(int, int);
    method public deprecated void cancelWps(android.net.wifi.WifiManager.WpsCallback);
@@ -29027,9 +29027,11 @@ package android.net.wifi {
    method public deprecated int updateNetwork(android.net.wifi.WifiConfiguration);
    field public static final java.lang.String ACTION_PICK_WIFI_NETWORK = "android.net.wifi.PICK_WIFI_NETWORK";
    field public static final java.lang.String ACTION_REQUEST_SCAN_ALWAYS_AVAILABLE = "android.net.wifi.action.REQUEST_SCAN_ALWAYS_AVAILABLE";
    field public static final java.lang.String ACTION_WIFI_NETWORK_SUGGESTION_POST_CONNECTION = "android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION";
    field public static final deprecated int ERROR_AUTHENTICATING = 1; // 0x1
    field public static final deprecated java.lang.String EXTRA_BSSID = "bssid";
    field public static final java.lang.String EXTRA_NETWORK_INFO = "networkInfo";
    field public static final java.lang.String EXTRA_NETWORK_SUGGESTION = "android.net.wifi.extra.NETWORK_SUGGESTION";
    field public static final java.lang.String EXTRA_NEW_RSSI = "newRssi";
    field public static final deprecated java.lang.String EXTRA_NEW_STATE = "newState";
    field public static final java.lang.String EXTRA_PREVIOUS_WIFI_STATE = "previous_wifi_state";
+1 −0
Original line number Diff line number Diff line
@@ -359,6 +359,7 @@
    <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_OSU_PROVIDERS_LIST" />
    <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_SUBSCRIPTION_REMEDIATION" />
    <protected-broadcast android:name="android.net.wifi.action.PASSPOINT_LAUNCH_OSU_VIEW" />
    <protected-broadcast android:name="android.net.wifi.action.WIFI_NETWORK_SUGGESTION_POST_CONNECTION" />
    <protected-broadcast android:name="android.net.wifi.supplicant.CONNECTION_CHANGE" />
    <protected-broadcast android:name="android.net.wifi.supplicant.STATE_CHANGE" />
    <protected-broadcast android:name="android.net.wifi.p2p.STATE_CHANGED" />
+4 −1
Original line number Diff line number Diff line
@@ -17,6 +17,7 @@
package android.net.wifi;

import android.net.wifi.INetworkRequestUserSelectionCallback;
import android.net.wifi.ScanResult;
import android.net.wifi.WifiConfiguration;

/**
@@ -28,7 +29,9 @@ oneway interface INetworkRequestMatchCallback
{
   void onUserSelectionCallbackRegistration(in INetworkRequestUserSelectionCallback userSelectionCallback);

   void onMatch(in List<WifiConfiguration> wificonfigurations);
   void onAbort();

   void onMatch(in List<ScanResult> scanResults);

   void onUserSelectionConnectSuccess(in WifiConfiguration wificonfiguration);

+5 −0
Original line number Diff line number Diff line
@@ -33,6 +33,7 @@ import android.net.wifi.ScanResult;
import android.net.wifi.WifiActivityEnergyInfo;
import android.net.wifi.WifiConfiguration;
import android.net.wifi.WifiInfo;
import android.net.wifi.WifiNetworkSuggestion;

import android.os.Messenger;
import android.os.ResultReceiver;
@@ -188,5 +189,9 @@ interface IWifiManager
    void registerNetworkRequestMatchCallback(in IBinder binder, in INetworkRequestMatchCallback callback, int callbackIdentifier);

    void unregisterNetworkRequestMatchCallback(int callbackIdentifier);

    boolean addNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName);

    boolean removeNetworkSuggestions(in List<WifiNetworkSuggestion> networkSuggestions, in String packageName);
}
+13 −1
Original line number Diff line number Diff line
@@ -761,6 +761,13 @@ public class WifiConfiguration implements Parcelable {
      return ephemeral;
    }

    /**
     * Indicate whther the network is trusted or not. Networks are considered trusted
     * if the user explicitly allowed this network connection.
     * @hide
     */
    public boolean trusted;

    /**
     * Indicates if the creator of this configuration has expressed that it
     * should be considered metered.
@@ -1638,6 +1645,7 @@ public class WifiConfiguration implements Parcelable {
        selfAdded = false;
        didSelfAdd = false;
        ephemeral = false;
        trusted = true; // Networks are considered trusted by default.
        meteredHint = false;
        meteredOverride = METERED_OVERRIDE_NONE;
        useExternalScores = false;
@@ -1747,10 +1755,11 @@ public class WifiConfiguration implements Parcelable {
        if (this.selfAdded) sbuf.append(" selfAdded");
        if (this.validatedInternetAccess) sbuf.append(" validatedInternetAccess");
        if (this.ephemeral) sbuf.append(" ephemeral");
        if (this.trusted) sbuf.append(" trusted");
        if (this.meteredHint) sbuf.append(" meteredHint");
        if (this.useExternalScores) sbuf.append(" useExternalScores");
        if (this.didSelfAdd || this.selfAdded || this.validatedInternetAccess
            || this.ephemeral || this.meteredHint || this.useExternalScores) {
                || this.ephemeral || this.trusted || this.meteredHint || this.useExternalScores) {
            sbuf.append("\n");
        }
        if (this.meteredOverride != METERED_OVERRIDE_NONE) {
@@ -2235,6 +2244,7 @@ public class WifiConfiguration implements Parcelable {
            validatedInternetAccess = source.validatedInternetAccess;
            isLegacyPasspointConfig = source.isLegacyPasspointConfig;
            ephemeral = source.ephemeral;
            trusted = source.trusted;
            meteredHint = source.meteredHint;
            meteredOverride = source.meteredOverride;
            useExternalScores = source.useExternalScores;
@@ -2310,6 +2320,7 @@ public class WifiConfiguration implements Parcelable {
        dest.writeInt(validatedInternetAccess ? 1 : 0);
        dest.writeInt(isLegacyPasspointConfig ? 1 : 0);
        dest.writeInt(ephemeral ? 1 : 0);
        dest.writeInt(trusted ? 1 : 0);
        dest.writeInt(meteredHint ? 1 : 0);
        dest.writeInt(meteredOverride);
        dest.writeInt(useExternalScores ? 1 : 0);
@@ -2379,6 +2390,7 @@ public class WifiConfiguration implements Parcelable {
                config.validatedInternetAccess = in.readInt() != 0;
                config.isLegacyPasspointConfig = in.readInt() != 0;
                config.ephemeral = in.readInt() != 0;
                config.trusted = in.readInt() != 0;
                config.meteredHint = in.readInt() != 0;
                config.meteredOverride = in.readInt();
                config.useExternalScores = in.readInt() != 0;
Loading