diff options
author | Roshan Pius <rpius@google.com> | 2019-01-24 13:34:49 -0800 |
---|---|---|
committer | Roshan Pius <rpius@google.com> | 2019-01-25 12:28:41 -0800 |
commit | 30c7a37cf069670fd217216110ec4cd790e99b58 (patch) | |
tree | 7828daad82b8c23044fdb1c5a3fbbe4e24819275 /service/java/com/android | |
parent | d7bded006fe5c923f6e4b9df60f54fa2bcba230c (diff) | |
download | android_frameworks_opt_net_wifi-30c7a37cf069670fd217216110ec4cd790e99b58.tar.gz android_frameworks_opt_net_wifi-30c7a37cf069670fd217216110ec4cd790e99b58.tar.bz2 android_frameworks_opt_net_wifi-30c7a37cf069670fd217216110ec4cd790e99b58.zip |
WifiNetworkFactory: Don't bypass user approval if user forgets
The "forget" button in the wifi picker for the connected network invokes
WifiManager.disableEphemeralNetwork() for ephemeral networks.
Use the same blacklist to disallow user approval bypass for previously
approved networks for app requests. This would result in the user
getting the pop-up to approve the request even if the app makes
a specific request (exact SSID + BSSID) and it was previously approved.
Note: There are some improvements planned regarding ephemeral
network blacklist tracked by b/123360912.
Bug: 122621582
Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Test: Aded a new acts test for the scenario.
act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest
Change-Id: I9d42d14d3cdfd631d55e449cbf9498ba9728d5b1
Diffstat (limited to 'service/java/com/android')
-rw-r--r-- | service/java/com/android/server/wifi/WifiNetworkFactory.java | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/service/java/com/android/server/wifi/WifiNetworkFactory.java b/service/java/com/android/server/wifi/WifiNetworkFactory.java index 1bd93c635..5f327e553 100644 --- a/service/java/com/android/server/wifi/WifiNetworkFactory.java +++ b/service/java/com/android/server/wifi/WifiNetworkFactory.java @@ -226,7 +226,15 @@ public class WifiNetworkFactory extends NetworkFactory { approvedScanResult = findUserApprovedAccessPointForActiveRequestFromActiveMatchedScanResults(); } - if (approvedScanResult == null) { + if (approvedScanResult != null + && !mWifiConfigManager.wasEphemeralNetworkDeleted( + ScanResultUtil.createQuotedSSID(approvedScanResult.SSID))) { + Log.v(TAG, "Approved access point found in matching scan results. " + + "Triggering connect " + approvedScanResult); + handleConnectToNetworkUserSelectionInternal( + ScanResultUtil.createNetworkFromScanResult(approvedScanResult)); + // TODO (b/122658039): Post notification. + } else { if (mVerboseLoggingEnabled) { Log.v(TAG, "No approved access points found in matching scan results. " + "Sending match callback"); @@ -234,12 +242,6 @@ public class WifiNetworkFactory extends NetworkFactory { sendNetworkRequestMatchCallbacksForActiveRequest(matchedScanResults); // Didn't find an approved match, schedule the next scan. scheduleNextPeriodicScan(); - } else { - Log.v(TAG, "Approved access point found in matching scan results. " - + "Triggering connect " + approvedScanResult); - handleConnectToNetworkUserSelectionInternal( - ScanResultUtil.createNetworkFromScanResult(approvedScanResult)); - // TODO (b/122658039): Post notification. } } |