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

Commit 6df0e8bf authored by Nate Jiang's avatar Nate Jiang
Browse files

[Suggestion] API to set carrier merged network

Create a new API to set carrier merged network suggestion

Bug: 172867186
Test: atest android.net.wifi
Change-Id: I5ddbc8b15e361e44c508e40dac10211cbd39ab10
parent 5d1ebbbb
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -31858,6 +31858,7 @@ package android.net.wifi {
    method @Nullable public String getSsid();
    method public int getSubscriptionId();
    method public boolean isAppInteractionRequired();
    method public boolean isCarrierMerged();
    method public boolean isCredentialSharedWithUser();
    method public boolean isEnhancedOpen();
    method public boolean isHiddenSsid();
@@ -31873,6 +31874,7 @@ package android.net.wifi {
    ctor public WifiNetworkSuggestion.Builder();
    method @NonNull public android.net.wifi.WifiNetworkSuggestion build();
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setBssid(@NonNull android.net.MacAddress);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierMerged(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCredentialSharedWithUser(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedMacRandomizationEnabled(boolean);
+2 −0
Original line number Diff line number Diff line
@@ -499,6 +499,7 @@ package android.net.wifi {
    method @Nullable public String getSsid();
    method public int getSubscriptionId();
    method public boolean isAppInteractionRequired();
    method public boolean isCarrierMerged();
    method public boolean isCredentialSharedWithUser();
    method public boolean isEnhancedOpen();
    method public boolean isHiddenSsid();
@@ -514,6 +515,7 @@ package android.net.wifi {
    ctor public WifiNetworkSuggestion.Builder();
    method @NonNull public android.net.wifi.WifiNetworkSuggestion build();
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setBssid(@NonNull android.net.MacAddress);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCarrierMerged(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setCredentialSharedWithUser(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedMacRandomizationEnabled(boolean);
+2 −0
Original line number Diff line number Diff line
@@ -345,6 +345,7 @@ package android.net.wifi {
    field @Deprecated public static final int RECENT_FAILURE_REFUSED_TEMPORARILY = 1002; // 0x3ea
    field @Deprecated public boolean allowAutojoin;
    field @Deprecated public int carrierId;
    field @Deprecated public boolean carrierMerged;
    field @Deprecated public String creatorName;
    field @Deprecated public int creatorUid;
    field @Deprecated public boolean fromWifiNetworkSpecifier;
@@ -428,6 +429,7 @@ package android.net.wifi {
    method public int getScore();
    method public double getSuccessfulRxPacketsPerSecond();
    method public double getSuccessfulTxPacketsPerSecond();
    method public boolean isCarrierMerged();
    method public boolean isEphemeral();
    method public boolean isOemPaid();
    method public boolean isOemPrivate();
+2 −0
Original line number Diff line number Diff line
@@ -7,5 +7,7 @@ MissingNullability: android.net.wifi.rtt.RangingRequest.Builder#addResponder(and



MutableBareField: android.net.wifi.WifiConfiguration#carrierMerged:

MutableBareField: android.net.wifi.WifiConfiguration#subscriptionId:
    Bare field subscriptionId must be marked final, or moved behind accessors if mutable
+15 −1
Original line number Diff line number Diff line
@@ -1052,6 +1052,15 @@ public class WifiConfiguration implements Parcelable {
     */
    public boolean oemPrivate;

    /**
     * Indicate whether or not the network is a carrier merged network.
     * This bit can only be used by suggestion network, see
     * {@link WifiNetworkSuggestion.Builder#setCarrierMerged(boolean)}
     * @hide
     */
    @SystemApi
    public boolean carrierMerged;

    /**
     * True if this Wifi configuration is created from a {@link WifiNetworkSuggestion},
     * false otherwise.
@@ -2283,6 +2292,7 @@ public class WifiConfiguration implements Parcelable {
        trusted = true; // Networks are considered trusted by default.
        oemPaid = false;
        oemPrivate = false;
        carrierMerged = false;
        fromWifiNetworkSuggestion = false;
        fromWifiNetworkSpecifier = false;
        meteredHint = false;
@@ -2407,12 +2417,13 @@ public class WifiConfiguration implements Parcelable {
        if (this.trusted) sbuf.append(" trusted");
        if (this.oemPaid) sbuf.append(" oemPaid");
        if (this.oemPrivate) sbuf.append(" oemPrivate");
        if (this.carrierMerged) sbuf.append(" carrierMerged");
        if (this.fromWifiNetworkSuggestion) sbuf.append(" fromWifiNetworkSuggestion");
        if (this.fromWifiNetworkSpecifier) sbuf.append(" fromWifiNetworkSpecifier");
        if (this.meteredHint) sbuf.append(" meteredHint");
        if (this.useExternalScores) sbuf.append(" useExternalScores");
        if (this.validatedInternetAccess || this.ephemeral || this.trusted || this.oemPaid
                || this.oemPrivate || this.fromWifiNetworkSuggestion
                || this.oemPrivate || this.carrierMerged || this.fromWifiNetworkSuggestion
                || this.fromWifiNetworkSpecifier || this.meteredHint || this.useExternalScores) {
            sbuf.append("\n");
        }
@@ -2980,6 +2991,7 @@ public class WifiConfiguration implements Parcelable {
            trusted = source.trusted;
            oemPaid = source.oemPaid;
            oemPrivate = source.oemPrivate;
            carrierMerged = source.carrierMerged;
            fromWifiNetworkSuggestion = source.fromWifiNetworkSuggestion;
            fromWifiNetworkSpecifier = source.fromWifiNetworkSpecifier;
            meteredHint = source.meteredHint;
@@ -3062,6 +3074,7 @@ public class WifiConfiguration implements Parcelable {
        dest.writeInt(trusted ? 1 : 0);
        dest.writeInt(oemPaid ? 1 : 0);
        dest.writeInt(oemPrivate ? 1 : 0);
        dest.writeInt(carrierMerged ? 1 : 0);
        dest.writeInt(fromWifiNetworkSuggestion ? 1 : 0);
        dest.writeInt(fromWifiNetworkSpecifier ? 1 : 0);
        dest.writeInt(meteredHint ? 1 : 0);
@@ -3141,6 +3154,7 @@ public class WifiConfiguration implements Parcelable {
                config.trusted = in.readInt() != 0;
                config.oemPaid = in.readInt() != 0;
                config.oemPrivate = in.readInt() != 0;
                config.carrierMerged = in.readInt() != 0;
                config.fromWifiNetworkSuggestion =  in.readInt() != 0;
                config.fromWifiNetworkSpecifier =  in.readInt() != 0;
                config.meteredHint = in.readInt() != 0;
Loading