summaryrefslogtreecommitdiffstats
path: root/tests/wifitests/src/com/android/server/wifi/WifiNetworkSuggestionsManagerTest.java
Commit message (Collapse)AuthorAgeFilesLines
* Fix a bunch of multi-user API callsRoshan Pius2019-09-201-2/+4
| | | | | | | | | | | | To handle multi-user scenarios, pass in the corresponding app's user id to fetch app info. Bug: 140895783 Test: atest com.android.server.wifi Test: Ran presubmit ACTS tests Change-Id: I400bad75510b064ad405fae07f56671d2c211178 Merged-In: I400bad75510b064ad405fae07f56671d2c211178 (cherry-picked from a1bbebf25cb7b4e33a7b5abaa6ee6402de95ebc9)
* [NetworkSuggestion] change notification contentNate Jiang2019-08-221-2/+2
| | | | | | | | | Change the notification content of first time apply network suggestion Test: acts WifiNetworkSuggestionTest Bug: 139037269 Change-Id: I1e831b5322e12f030388c7ca81a6456ec77009ed
* [NetworkSuggestion] ask user approval when first time add suggestionsNate Jiang2019-08-131-14/+134
| | | | | | | | | | | | Post a user approval notification when App first time add suggestions. If user dismissal the notification, will post notification again when suggestion matched in scan result. Bug: 139037269 Test: atest android.net.wifi Test: atest com.android.server.wifi Test: acts WifiNetworkSuggestionTest Change-Id: I72deeefb90f43af97e8574e40ebadca5e16a35f8
* [NetworkSuggestion] add hidden network from network suggestionNate Jiang2019-08-091-0/+39
| | | | | | | | | | | | Add hidden network from network suggestion to the scan list, make it can be auto connected and appear in the scan result. Bug: 138975620 Test: atest android.net.wifi Test: atest com.android.server.wifi Test: acts WifiNetworkSuggestionTest Merged-In: Ib053b7b33ed01e7da2cff888b0f720f9d6cdb528 Change-Id: Ib4bc9c51ee6e28471aee34fb7737f3659152c7d3
* [NetworkSuggestion] remove all suggestion should trigger disconnectNate Jiang2019-07-161-0/+33
| | | | | | | | | | | | When App with "NETWORK_CARRIER_PROVISIONING" permission removes all suggestions, framework should disconnect connected network if suggested by this APP. Bug: 137597179 Test: atest android.net.wifi Test: atest com.android.server.wifi Test: acts WifiNetworkSuggestionTest Change-Id: I2e1193cdc6013028788b447e4da05d61cfa16e6d
* WifiNetworkSuggestionsManager: Persist user approval immediatelyRoshan Pius2019-07-031-0/+8
|\ | | | | | | | | | | am: 7abed5d4cf Change-Id: I54c3c9e22353d89f4f0d3dbc956ddca302ef13f5
| * WifiNetworkSuggestionsManager: Persist user approval immediatelyRoshan Pius2019-07-021-0/+8
| | | | | | | | | | | | | | | | | | | | | | User approval decisions are not currently triggering a disk persistence. If the app does not modify any of it's suggestions, then this approval bit may not get persisted. Bug: 136565650 Test: atest com.android.server.wifi Test: NetworkSuggestion ACTS test Change-Id: I8796132fa3cc6356b9f4d43c9d3ffcdd72f7c89a
* | WifiNetworkSuggestionsManager: remove suggestion when Apps remove thatNate Jiang2019-06-181-19/+72
|/ | | | | | | | | | | When carrier wifi removed the suggestion, framework should remove it. And trigger disconnect Test: atest android.net.wifi Test: atest com.android.server.wifi Test: ACTS WifiNetworkSuggestionTest Bug: 135204977 Change-Id: I89c2d20003f4d58164bade3a010e7d9811ff167b
* WifiNetworkSuggestionsManager: Auto approve carrier provisioning appRoshan Pius2019-03-291-74/+181
| | | | | | | | | | | | Auto approve app with carrier provisioning permission to allow them to manage suggestions from the carrier. Also, pass in the uid of the calling app from WifiService to WifiNetworkSuggestionsManager.add(). Bug: 129401919 Test: atest com.android.server.wifi Change-Id: Ie7dad0c25f989c5d20a44766efc0136a99a42615
* Merge "Revert "WifiConfigManager: Temporarily blacklist on disconnect""Roshan Pius2019-03-251-5/+5
|\
| * Revert "WifiConfigManager: Temporarily blacklist on disconnect"Roshan Pius2019-03-221-5/+5
| | | | | | | | | | | | | | | | | | This reverts commit 0cd22728c628e51e8f259f8404a97dec49804424. Bug: 126503889 Reason for revert: UI changes was punted to R. No rationale in making this API changing behavior now. Change-Id: Ie8cd931980d2eb0c7bf660cb0fa646848d315a71
* | WifiNetworkSuggestionsManager: Modify suggestion notification stringsRoshan Pius2019-03-141-2/+0
|/ | | | | | Bug: 120072329 Test: Manually verified the notification with CTS verifier Change-Id: I83247cabbc8a75e4262da3735926040a4c954b27
* WifiConfigManager: Temporarily blacklist on disconnectRoshan Pius2019-03-141-5/+5
| | | | | | | | | | | When an external entity (settings for example) triggers WifiManager.disconnect() API, ensure that we blacklist the network temporarily for 1 hour. Any internal disconnects triggered by the stack will not result in blacklisting the network. Bug: 126503889 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: If66fd078fa74b8153a9d1aca2ed362b2246f276d
* WifiMetrics: Report metrics for new API surfacesRoshan Pius2019-03-061-1/+53
| | | | | | | | | | | | | | | Changes to report metrics for the new API surface usage. Also, a) Added a new maxSize field in WifiNetworkSuggestionsManager to track the maximum size of suggestion list ever for that app. b) Record the nominator names in existing connection event metrics. Bug: 123362619 Bug: 123362779 Test: adb shell dumpsys wifi wifiMetricsProto Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I801ce489941259be9185e3dbc1133ff04bae5c71
* WifiServiceImpl: Factory resetRoshan Pius2019-02-111-0/+53
| | | | | | | | | | | | Clear the following lists on the network settings reset: a) Blacklisted ephemeral networks b) All suggestion related lists. c) All user approvals stored for networks requests. Bug: 123884704 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: Manually verified by performing network settings reset Change-Id: I8a6476acf4a14acf968565cad1a6eb1c6aef1f55
* WifiNetworkSuggestionsManager: Don't disconnect on suggestion removalRoshan Pius2019-01-201-20/+18
| | | | | | | | | | | | | | | | | | | | To prevent apps from misusing the suggestion API surface for active network management, don't disconnect from the network when the app removes the suggestion backing the connection. The device will remain connected to the network until it falls off naturally (either because of a disconnect or we found a better network to connect to). Since apps using suggestion will not have access to the old API surface, they will not be able to trigger disconnect, reconnect, etc. Note: We do however disconnect when the suggestion app is uninstalled and one of it's suggestion was used for the connection. Bug: 121268587 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: Modified existing ACTS test with the new expectations. act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest Change-Id: Ie301d8ab73da935f350e54343ce2ae9fcd6c40aa
* WifiNetworkSuggestion/WifiNetworkSpecifier: Pass package nameRoshan Pius2019-01-181-57/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the package name from WifiNetworkSpecifier/WifiNetworkSuggestion instead of using PackageManager.getNameForUid() which cannot differentiate apps sharing UID. Functional changes (only in WifiNetworkFactory): a) Verify the uid/package name passed in the request using app-ops manager. b) Use the package name in the request everywhere instead of getNameForUid. WifiNetworkSuggestionsManager already uses the package name of the app passed in via addNetworkSuggestionsManager. So, no changes necessary there. Rest of the changes are mostly in unit tests to add the new packageName param in the constructor of these objects. Bug: 123078593 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkRequestTest Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest Test: New CtsVerifier tests for network request. Change-Id: Id7c9a954606f97dbba935cb259dd488ac19d7c62
* WifiNetworkSuggestionsManager: Post notification for user approvalRoshan Pius2019-01-181-0/+239
| | | | | | | | | | | | | | | | | | | | | | | | | Whenever a network suggested by an app is available in scan results, post a notification asking to approve the app (if not already approved). If there are multiple such apps matching a suggestion & pending approval, then we pick the first one to post the notification for. Once a notification is posted, we don't post any further notification until the user interacts with the active notification (i.e dismiss, allow, deny). a) If the user dismisses the notification, we popup the notification for the next time a suggestion from the app is available in scan results. b) If the user clicks on allow, then we don't popup notifications for any further connection from the app. c) If user clicks on disallow, then we revoke CHANGE_WIFI_STATE app-ops, which will trigger a full removal of the app & it's suggestions from the database. Bug: 120072329 Test: Manually verified the notification posting using ACTS tests. Test: Manual verification of interacting with the notification. Test: `act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest` Change-Id: I4a3ed6abca01aab84fcd3717fde56bca6187fae6
* WifiNetworkSuggestionsManager: Don't auto-join until user has approvedRoshan Pius2019-01-181-4/+82
| | | | | | | | | | | | | The new UI flow mandates that the user needs to explicitly allow the app before we auto-connect to network suggestions provided by the app. Also, implemented shell commands to let ACTS test approve an app (itself). These are needed to simulate the user approval process. Bug: 120072329 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest Change-Id: I49271e4534e74b8643d5138af80e902e55fa0cb2
* WifiNetworkSuggestionsManager: Add ExtendedWifiNetworkSuggestionRoshan Pius2019-01-181-56/+79
| | | | | | | | | | | | | | | | | | | Create an internal container class for WifiNetworkSuggestion object to optimize lookup of meta-data. This extended object contains a pointer to the PerAppInfo structure corresponding to the app that added the suggestion. This is necessary to avoid multiple loops during scan result lookup to post user approval notification for apps (implementation of notification posting will follow in a separate CL). It also reduces the lookup time for sending post connection broadcasts. No new unit test added since no functionality had been changed, just verified that existing unit tests continue to work with this internal change. Bug: 120072329 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest Change-Id: I84726e208a64dfce27151b2c4bbfeff5f28d79ca
* WifiNetworkSuggestionsManager: Store user approvalRoshan Pius2018-12-061-16/+129
| | | | | | | | | | | | | | | | | | For the first connection attributed to a suggestor app, we should post a notification letting the user optionally disable suggestor app. Store a flag (needs to be persisted) for each app to track whether the user has approved the app or not. This also implies that we don't discard apps with no active suggestions from the database. We still need to track whether we've already sent notification to the user for the corresponding app (in-case the app makes new suggestions afterwards). The app is removed from internal database only on the app uninstall. Note: The actual notification post will be done in a subsequent CL. Bug: 120072329 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ie201b1f2b7de64fa8ad8a3d02575379db1f9dc4c
* WifiNetworkSuggestionsManager: Handle change wifi state app-opsRoshan Pius2018-12-061-4/+178
| | | | | | | | | | Track all suggestor app's change wifi state app-ops change. Remove all suggestions from the app if user disallows change wifi state for that app. Bug: 120072329 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ib52e617fa3c12fe40fffda17ac7ff542989baa60
* WifiNetworkSuggestionsManager: Handle bssid in suggestionsRoshan Pius2018-12-061-9/+261
| | | | | | | | Add a new map to store suggestions with bssid for scan result lookup. Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I2e0d3a11fafff0702d4cd0bafcb3378873258b4f
* WifiNetworkSuggestionsManager: Set a max limit on num of suggestionsRoshan Pius2018-11-291-39/+124
| | | | | | | | Also, return the appropriate error code. Bug: 119210573 Test: ./frameworks/opt/net/wifi/tests/runtests.sh Change-Id: I0cce826a2e8aa153f3409e1f2c4f4db2d366669a
* WifiNetworkSuggestionsManager: Disconnect on suggestions removalRoshan Pius2018-11-291-5/+122
| | | | | | | | | | | | | | | Changes in the CL: a) Plumb the connection success/failure from ClientModeImpl. b) Keep track of suggestions matching the connected network. c) Ensure that we disconnect on removal of the only network suggestion matching the connected network. Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Test: python3 /usr/local/bin/act.py -c wifi_manager.config -tb dut-name -tc WifiNetworkSuggestionTest Change-Id: I31ec4c7954a75eabf999f5b860f1e7298b2603a1
* WifiNetworkSuggestionsManager: Handle data persistenceRoshan Pius2018-11-201-3/+172
| | | | | | | | | Integrate the new store data to serialize/deserialize data from persistent store. Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I280a28738051978ced008c6bf85624e76a2a15ba
* WifiNetworkSuggestionsManager: Send post connection broadcastRoshan Pius2018-11-161-1/+159
| | | | | | | | | | | | Send out the directed post connection broadcast to apps, if on connection: a) Provided network suggestion has the |isAppInteractionRequired| flag set. b) App holds location permission. Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ic5919f7e93e5d0b1bf9ca664a4e661004bd1e627
* WifiNetworkSuggestionsManager: Maintain scan result lookup mapRoshan Pius2018-11-161-0/+90
| | | | | | | | | | | | | | Optimize lookup of network suggestions matching a given scan result using a map of ScanResultMatchInfo to WifiNetworkSuggestions. This is similar to the cache maintained in WifiConfigManager to speed up saved networks lookup from scan results. Note that there could be multiple network suggestions matching a single scan result (multiple apps could give us the same network suggestion). Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: Ie3df68216e59320c62c9a96ebea2992b0163326d
* WifiNetworkSuggestionsManager: Add a module to manage suggestionsRoshan Pius2018-11-161-0/+221
The module currently just handles the add/remove API for network suggestions. Bug: 115504887 Test: ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh Change-Id: I4f067644e77425b98c6e54ff471a80d8d5acd7c1