summaryrefslogtreecommitdiffstats
path: root/service/java/com/android/server/wifi/WifiNetworkFactory.java
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2019-02-11 08:37:37 -0800
committerRoshan Pius <rpius@google.com>2019-02-11 12:48:12 -0800
commit12b119b9962852d94c57132f691a851ac854c3c9 (patch)
tree053a0efd814202519e8bdab3954875295b2a21b3 /service/java/com/android/server/wifi/WifiNetworkFactory.java
parentdfb1f2f95aafcd8a8bcbfda80267d0b84df8810f (diff)
downloadandroid_frameworks_opt_net_wifi-12b119b9962852d94c57132f691a851ac854c3c9.tar.gz
android_frameworks_opt_net_wifi-12b119b9962852d94c57132f691a851ac854c3c9.tar.bz2
android_frameworks_opt_net_wifi-12b119b9962852d94c57132f691a851ac854c3c9.zip
WifiNetworkFactory: Use credentials from app's request
Don't use the WifiConfiguration object passed in via the UI for initiating network connection. Use the credentials from the app's request and then copy over the SSID from the UI callback. Bug: 124220879 Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkRequestTest (Passes with the modified test). Test: Manual CTS verification. Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ie7319f8e845ffd0717fda8a53471eaa5684b551d
Diffstat (limited to 'service/java/com/android/server/wifi/WifiNetworkFactory.java')
-rw-r--r--service/java/com/android/server/wifi/WifiNetworkFactory.java18
1 files changed, 11 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java
index ee43845df..38d36f82f 100644
--- a/service/java/com/android/server/wifi/WifiNetworkFactory.java
+++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java
@@ -701,22 +701,26 @@ public class WifiNetworkFactory extends NetworkFactory {
// Disable Auto-join so that NetworkFactory can take control of the network connection.
mWifiConnectivityManager.setSpecificNetworkRequestInProgress(true);
+ // Copy over the credentials from the app's request and then copy the ssid from user
+ // selection.
+ WifiConfiguration networkToConnect =
+ new WifiConfiguration(mActiveSpecificNetworkRequestSpecifier.wifiConfiguration);
+ networkToConnect.SSID = network.SSID;
// If the request is for a specific SSID and BSSID, then set WifiConfiguration.BSSID field
// to prevent roaming.
if (isActiveRequestForSingleAccessPoint()) {
- network.BSSID =
+ networkToConnect.BSSID =
mActiveSpecificNetworkRequestSpecifier.bssidPatternMatcher.first.toString();
}
-
// Mark the network ephemeral so that it's automatically removed at the end of connection.
- network.ephemeral = true;
- network.fromWifiNetworkSpecifier = true;
+ networkToConnect.ephemeral = true;
+ networkToConnect.fromWifiNetworkSpecifier = true;
// Store the user selected network.
- mUserSelectedNetwork = network;
+ mUserSelectedNetwork = networkToConnect;
// Trigger connection to the network.
- connectToNetwork(network);
+ connectToNetwork(networkToConnect);
}
private void handleConnectToNetworkUserSelection(WifiConfiguration network) {
@@ -729,7 +733,7 @@ public class WifiNetworkFactory extends NetworkFactory {
handleConnectToNetworkUserSelectionInternal(network);
// Add the network to the approved access point map for the app.
- addNetworkToUserApprovedAccessPointMap(network);
+ addNetworkToUserApprovedAccessPointMap(mUserSelectedNetwork);
}
private void handleRejectUserSelection() {