diff options
| author | 2020-02-05 00:36:39 +0000 | |
|---|---|---|
| committer | 2020-02-05 00:36:39 +0000 | |
| commit | 1b74411bc306aa9e3ea7d0c045f76b941deefd98 (patch) | |
| tree | 32733b28b6e44672047307da031ad901b7234637 | |
| parent | dad078cb284b857ee8406d819db5af260239dfe6 (diff) | |
| parent | 0e46cc88cd9b126d6a5c1156744bf027d85829f1 (diff) | |
Merge "Make autojoin consistent"
| -rw-r--r-- | api/current.txt | 2 | ||||
| -rwxr-xr-x | api/system-current.txt | 2 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/WifiManager.java | 22 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/WifiNetworkSuggestion.java | 18 | ||||
| -rw-r--r-- | wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java | 24 | ||||
| -rw-r--r-- | wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java | 16 | ||||
| -rw-r--r-- | wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java | 2 |
7 files changed, 43 insertions, 43 deletions
diff --git a/api/current.txt b/api/current.txt index 6f0a495a92e5..9b2e6d42b56f 100644 --- a/api/current.txt +++ b/api/current.txt @@ -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); diff --git a/api/system-current.txt b/api/system-current.txt index 61910676e34d..cdcef536892b 100755 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -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(); } diff --git a/wifi/java/android/net/wifi/WifiManager.java b/wifi/java/android/net/wifi/WifiManager.java index 5c5471d5a1b2..1dc4a069fe2f 100644 --- a/wifi/java/android/net/wifi/WifiManager.java +++ b/wifi/java/android/net/wifi/WifiManager.java @@ -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(); } diff --git a/wifi/java/android/net/wifi/WifiNetworkSuggestion.java b/wifi/java/android/net/wifi/WifiNetworkSuggestion.java index 6085eae252ef..720149695abc 100644 --- a/wifi/java/android/net/wifi/WifiNetworkSuggestion.java +++ b/wifi/java/android/net/wifi/WifiNetworkSuggestion.java @@ -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() ); } diff --git a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java index 756d679b8f21..615331f65258 100644 --- a/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java +++ b/wifi/java/android/net/wifi/hotspot2/PasspointConfiguration.java @@ -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; diff --git a/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java b/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java index 15accc337429..af6fb5c1cd22 100644 --- a/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java +++ b/wifi/tests/src/android/net/wifi/WifiNetworkSuggestionTest.java @@ -105,7 +105,7 @@ public class WifiNetworkSuggestionTest { .setSsid(TEST_SSID) .setWpa2Passphrase(TEST_PRESHARED_KEY) .setIsUserInteractionRequired(true) - .setIsInitialAutoJoinEnabled(false) + .setIsInitialAutojoinEnabled(false) .setIsMetered(true) .build(); @@ -155,7 +155,7 @@ public class WifiNetworkSuggestionTest { .setSsid(TEST_SSID) .setWpa3Passphrase(TEST_PRESHARED_KEY) .setCredentialSharedWithUser(true) - .setIsInitialAutoJoinEnabled(false) + .setIsInitialAutojoinEnabled(false) .build(); assertEquals("\"" + TEST_SSID + "\"", suggestion.wifiConfiguration.SSID); @@ -732,20 +732,20 @@ public class WifiNetworkSuggestionTest { /** * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception - * when {@link WifiNetworkSuggestion.Builder#setIsInitialAutoJoinEnabled(boolean)} to + * when {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)} to * false on a open network suggestion. */ @Test(expected = IllegalStateException.class) public void testSetIsAutoJoinDisabledWithOpenNetwork() { new WifiNetworkSuggestion.Builder() .setSsid(TEST_SSID) - .setIsInitialAutoJoinEnabled(false) + .setIsInitialAutojoinEnabled(false) .build(); } /** * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception - * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutoJoinEnabled(boolean)} + * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)} * and {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} (boolean)} * to false on a network suggestion. */ @@ -755,7 +755,7 @@ public class WifiNetworkSuggestionTest { .setSsid(TEST_SSID) .setWpa2Passphrase(TEST_PRESHARED_KEY) .setCredentialSharedWithUser(false) - .setIsInitialAutoJoinEnabled(false) + .setIsInitialAutojoinEnabled(false) .build(); } @@ -808,7 +808,7 @@ public class WifiNetworkSuggestionTest { /** * Ensure {@link WifiNetworkSuggestion.Builder#build()} throws an exception - * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutoJoinEnabled(boolean)} + * when set both {@link WifiNetworkSuggestion.Builder#setIsInitialAutojoinEnabled(boolean)} * and {@link WifiNetworkSuggestion.Builder#setCredentialSharedWithUser(boolean)} (boolean)} * to false on a passpoint suggestion. */ @@ -818,7 +818,7 @@ public class WifiNetworkSuggestionTest { new WifiNetworkSuggestion.Builder() .setPasspointConfig(passpointConfiguration) .setCredentialSharedWithUser(false) - .setIsInitialAutoJoinEnabled(false) + .setIsInitialAutojoinEnabled(false) .build(); } } diff --git a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java index e78c5bf992f3..ce542c2bc4e9 100644 --- a/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java +++ b/wifi/tests/src/android/net/wifi/hotspot2/PasspointConfigurationTest.java @@ -174,7 +174,7 @@ public class PasspointConfigurationTest { assertFalse(config.validate()); assertFalse(config.validateForR2()); - assertTrue(config.isAutoJoinEnabled()); + assertTrue(config.isAutojoinEnabled()); assertTrue(config.isMacRandomizationEnabled()); assertTrue(config.getMeteredOverride() == METERED_OVERRIDE_NONE); } |