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

Commit 1b74411b authored by Nate Jiang's avatar Nate Jiang Committed by Android (Google) Code Review
Browse files

Merge "Make autojoin consistent"

parents dad078cb 0e46cc88
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -31426,7 +31426,7 @@ package android.net.wifi {
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsAppInteractionRequired(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsEnhancedOpen(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsHiddenSsid(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsInitialAutoJoinEnabled(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsInitialAutojoinEnabled(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsMetered(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setIsUserInteractionRequired(boolean);
    method @NonNull public android.net.wifi.WifiNetworkSuggestion.Builder setPasspointConfig(@NonNull android.net.wifi.hotspot2.PasspointConfiguration);
+1 −1
Original line number Diff line number Diff line
@@ -8046,7 +8046,7 @@ package android.net.wifi.hotspot2 {
  public final class PasspointConfiguration implements android.os.Parcelable {
    method public int getMeteredOverride();
    method public boolean isAutoJoinEnabled();
    method public boolean isAutojoinEnabled();
    method public boolean isMacRandomizationEnabled();
  }
+11 −11
Original line number Diff line number Diff line
@@ -4309,16 +4309,16 @@ public class WifiManager {
    }

    /**
     * Allows the OEM to enable/disable auto-join globally.
     * Enable/disable auto-join globally.
     *
     * @param choice true to allow autojoin, false to disallow autojoin
     * @param allowAutojoin true to allow auto-join, false to disallow auto-join
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
    public void allowAutojoinGlobal(boolean choice) {
    public void allowAutojoinGlobal(boolean allowAutojoin) {
        try {
            mService.allowAutojoinGlobal(choice);
            mService.allowAutojoinGlobal(allowAutojoin);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -4330,15 +4330,15 @@ public class WifiManager {
     * The updated choice will be made available through the updated config supplied by the
     * CONFIGURED_NETWORKS_CHANGED broadcast.
     *
     * @param netId the id of the network to allow/disallow autojoin for.
     * @param choice true to allow autojoin, false to disallow autojoin
     * @param netId the id of the network to allow/disallow auto-join for.
     * @param allowAutojoin true to allow auto-join, false to disallow auto-join
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
    public void allowAutojoin(int netId, boolean choice) {
    public void allowAutojoin(int netId, boolean allowAutojoin) {
        try {
            mService.allowAutojoin(netId, choice);
            mService.allowAutojoin(netId, allowAutojoin);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
@@ -4348,14 +4348,14 @@ public class WifiManager {
     * Configure auto-join settings for a Passpoint profile.
     *
     * @param fqdn the FQDN (fully qualified domain name) of the passpoint profile.
     * @param enableAutoJoin true to enable autojoin, false to disable autojoin.
     * @param allowAutojoin true to enable auto-join, false to disable auto-join.
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.NETWORK_SETTINGS)
    public void allowAutojoinPasspoint(@NonNull String fqdn, boolean enableAutoJoin) {
    public void allowAutojoinPasspoint(@NonNull String fqdn, boolean allowAutojoin) {
        try {
            mService.allowAutojoinPasspoint(fqdn, enableAutoJoin);
            mService.allowAutojoinPasspoint(fqdn, allowAutojoin);
        } catch (RemoteException e) {
            throw e.rethrowFromSystemServer();
        }
+9 −9
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ public final class WifiNetworkSuggestion implements Parcelable {
        /**
         * Whether this network is initialized with auto-join enabled (the default) or not.
         */
        private boolean mIsInitialAutoJoinEnabled;
        private boolean mIsInitialAutojoinEnabled;

        /**
         * Pre-shared key for use with WAPI-PSK networks.
@@ -159,7 +159,7 @@ public final class WifiNetworkSuggestion implements Parcelable {
            mIsMetered = false;
            mIsSharedWithUser = true;
            mIsSharedWithUserSet = false;
            mIsInitialAutoJoinEnabled = true;
            mIsInitialAutojoinEnabled = true;
            mPriority = UNASSIGNED_PRIORITY;
            mCarrierId = TelephonyManager.UNKNOWN_CARRIER_ID;
            mWapiPskPassphrase = null;
@@ -467,10 +467,10 @@ public final class WifiNetworkSuggestion implements Parcelable {
         *
         * @param enabled true for initializing with auto-join enabled (the default), false to
         *                initializing with auto-join disabled.
         * @return Instance of (@link {@link Builder} to enable chaining of the builder method.
         * @return Instance of {@link Builder} to enable chaining of the builder method.
         */
        public @NonNull Builder setIsInitialAutoJoinEnabled(boolean enabled) {
            mIsInitialAutoJoinEnabled = enabled;
        public @NonNull Builder setIsInitialAutojoinEnabled(boolean enabled) {
            mIsInitialAutojoinEnabled = enabled;
            return this;
        }

@@ -664,10 +664,10 @@ public final class WifiNetworkSuggestion implements Parcelable {
                    mIsSharedWithUser = false;
                }
            }
            if (!mIsSharedWithUser && !mIsInitialAutoJoinEnabled) {
            if (!mIsSharedWithUser && !mIsInitialAutojoinEnabled) {
                throw new IllegalStateException("Should have not a network with both "
                        + "setCredentialSharedWithUser and "
                        + "setIsAutoJoinEnabled set to false");
                        + "setIsAutojoinEnabled set to false");
            }
            if (mIsNetworkUntrusted) {
                if (mIsSharedWithUserSet && mIsSharedWithUser) {
@@ -683,7 +683,7 @@ public final class WifiNetworkSuggestion implements Parcelable {
                    mIsAppInteractionRequired,
                    mIsUserInteractionRequired,
                    mIsSharedWithUser,
                    mIsInitialAutoJoinEnabled,
                    mIsInitialAutojoinEnabled,
                    mIsNetworkUntrusted);
        }
    }
@@ -774,7 +774,7 @@ public final class WifiNetworkSuggestion implements Parcelable {
                            in.readBoolean(), // isAppInteractionRequired
                            in.readBoolean(), // isUserInteractionRequired
                            in.readBoolean(), // isSharedCredentialWithUser
                            in.readBoolean(),  // isAutoJoinEnabled
                            in.readBoolean(),  // isAutojoinEnabled
                            in.readBoolean()
                    );
                }
+12 −12
Original line number Diff line number Diff line
@@ -432,7 +432,7 @@ public final class PasspointConfiguration implements Parcelable {
     * considered for auto-connection. If true then yes, if false then it isn't considered as part
     * of auto-connection - but can still be manually connected to.
     */
    private boolean mIsAutoJoinEnabled = true;
    private boolean mIsAutojoinEnabled = true;

    /**
     * The mac randomization setting specifies whether a randomized or device MAC address will
@@ -459,11 +459,11 @@ public final class PasspointConfiguration implements Parcelable {
     * indicates that only manual connection will work - the framework will not auto-associate to
     * this Passpoint network.
     *
     * @param autoJoinEnabled true to be considered for framework auto-connection, false otherwise.
     * @param autojoinEnabled true to be considered for framework auto-connection, false otherwise.
     * @hide
     */
    public void setAutoJoinEnabled(boolean autoJoinEnabled) {
        mIsAutoJoinEnabled = autoJoinEnabled;
    public void setAutojoinEnabled(boolean autojoinEnabled) {
        mIsAutojoinEnabled = autojoinEnabled;
    }

    /**
@@ -499,8 +499,8 @@ public final class PasspointConfiguration implements Parcelable {
     * @hide
     */
    @SystemApi
    public boolean isAutoJoinEnabled() {
        return mIsAutoJoinEnabled;
    public boolean isAutojoinEnabled() {
        return mIsAutojoinEnabled;
    }

    /**
@@ -570,7 +570,7 @@ public final class PasspointConfiguration implements Parcelable {
        mServiceFriendlyNames = source.mServiceFriendlyNames;
        mAaaServerTrustedNames = source.mAaaServerTrustedNames;
        mCarrierId = source.mCarrierId;
        mIsAutoJoinEnabled = source.mIsAutoJoinEnabled;
        mIsAutojoinEnabled = source.mIsAutojoinEnabled;
        mIsMacRandomizationEnabled = source.mIsMacRandomizationEnabled;
        mMeteredOverride = source.mMeteredOverride;
    }
@@ -602,7 +602,7 @@ public final class PasspointConfiguration implements Parcelable {
                (HashMap<String, String>) mServiceFriendlyNames);
        dest.writeBundle(bundle);
        dest.writeInt(mCarrierId);
        dest.writeBoolean(mIsAutoJoinEnabled);
        dest.writeBoolean(mIsAutojoinEnabled);
        dest.writeBoolean(mIsMacRandomizationEnabled);
        dest.writeInt(mMeteredOverride);
    }
@@ -635,7 +635,7 @@ public final class PasspointConfiguration implements Parcelable {
                && mUsageLimitDataLimit == that.mUsageLimitDataLimit
                && mUsageLimitTimeLimitInMinutes == that.mUsageLimitTimeLimitInMinutes
                && mCarrierId == that.mCarrierId
                && mIsAutoJoinEnabled == that.mIsAutoJoinEnabled
                && mIsAutojoinEnabled == that.mIsAutojoinEnabled
                && mIsMacRandomizationEnabled == that.mIsMacRandomizationEnabled
                && mMeteredOverride == that.mMeteredOverride
                && (mServiceFriendlyNames == null ? that.mServiceFriendlyNames == null
@@ -648,7 +648,7 @@ public final class PasspointConfiguration implements Parcelable {
                mUpdateIdentifier, mCredentialPriority, mSubscriptionCreationTimeInMillis,
                mSubscriptionExpirationTimeInMillis, mUsageLimitUsageTimePeriodInMinutes,
                mUsageLimitStartTimeInMillis, mUsageLimitDataLimit, mUsageLimitTimeLimitInMinutes,
                mServiceFriendlyNames, mCarrierId, mIsAutoJoinEnabled, mIsMacRandomizationEnabled,
                mServiceFriendlyNames, mCarrierId, mIsAutojoinEnabled, mIsMacRandomizationEnabled,
                mMeteredOverride);
    }

@@ -703,7 +703,7 @@ public final class PasspointConfiguration implements Parcelable {
            builder.append("ServiceFriendlyNames: ").append(mServiceFriendlyNames);
        }
        builder.append("CarrierId:" + mCarrierId);
        builder.append("IsAutoJoinEnabled:" + mIsAutoJoinEnabled);
        builder.append("IsAutojoinEnabled:" + mIsAutojoinEnabled);
        builder.append("mIsMacRandomizationEnabled:" + mIsMacRandomizationEnabled);
        builder.append("mMeteredOverride:" + mMeteredOverride);
        return builder.toString();
@@ -811,7 +811,7 @@ public final class PasspointConfiguration implements Parcelable {
                        "serviceFriendlyNames");
                config.setServiceFriendlyNames(friendlyNamesMap);
                config.mCarrierId = in.readInt();
                config.mIsAutoJoinEnabled = in.readBoolean();
                config.mIsAutojoinEnabled = in.readBoolean();
                config.mIsMacRandomizationEnabled = in.readBoolean();
                config.mMeteredOverride = in.readInt();
                return config;
Loading