summaryrefslogtreecommitdiffstats
path: root/service
Commit message (Collapse)AuthorAgeFilesLines
* Deal correctly with short stringsstable/cm-12.1-YOG4PPaul Stewart2016-08-081-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The parseMacAddress function anticipates only properly formed MAC addresses (6 hexadecimal octets separated by ":"). This change properly deals with situations where the string is shorter than expected, making sure that the passed in char* reference in parseHexByte never exceeds the end of the string. Ticket: CYNGNOS-3177 BUG: 28164077 TEST: Added a main function: int main(int argc, char **argv) { unsigned char addr[6]; if (argc > 1) { memset(addr, 0, sizeof(addr)); parseMacAddress(argv[1], addr); printf("Result: %02x:%02x:%02x:%02x:%02x:%02x\n", addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]); } } Tested with "", "a" "ab" "ab:c" "abxc". Change-Id: I0db8d0037e48b62333d475296a45b22ab0efe386 (cherry picked from commit 1921acbf2c82dd0813b3734f2609fe6f971c9c2f)
* Use def_wifi_idle_ms to fetch WIFI_IDLE_MS defaultsDanesh M2016-01-111-10/+4
| | | | | | | PAELLA-126 Change-Id: I060f2bb4611a2fc1576fd619acc6c87c784b4abf (cherry picked from commit 1e35a44465528dd552f8907be75d7dbc0d18e96a)
* wifi: fixup hotspot disconnect on subscriber changeKhalid Zubair2015-12-091-7/+32
| | | | | | | | | | | | The hotspot should be disconnected only if the IMSI changes (for GSM devices). SubscriptionInfo#getSubscriptionId() does not return the IMSI and returns a handle used by the framework. Switch to using the TelephonyManager#getSubscriberId(). SAMBAR-1151 Change-Id: I7a00600497a9d884dda08a9969cf7f34f9054e2b (cherry picked from commit 0ba3cdcfcb29e2933e394a5e978d52fc05c22e53)
* Fix a race in WifiNative objectsVinit Deshpande2015-12-081-5/+8
| | | | | | | | | | | | disconnectFromSupplicant doesn't have any synchronization; so it can cause problems when WifiStateMachine is disconnecting and P2p statemachine is sending commands. Ticket: CYNGNOS-1299 Bug: 22667667 Change-Id: I92e6ee44618813341e171f84442791a6403a5010 (cherry picked from commit b577f391af2c484e443c19b3df1d62cc0924692a) (cherry picked from commit 8b41627f7411306a0c42867fb526fa214f2991cd)
* wifi: don't disable AP on sub change if it's the same subRoman Birg2015-11-051-0/+15
| | | | | | | | Ref: CYNGNOS-1303 Change-Id: I653fdf40b1419c96e8d611b18d8d899cb5629f5c Signed-off-by: Roman Birg <roman@cyngn.com> (cherry picked from commit af2b86673c2743e1a7074da281a7db79f0389be8)
* wifi: disable access point on subscription changeRoman Birg2015-09-171-0/+32
| | | | | | | | | | | On subscription changes, we should stop tethering to not incur charges by accident. Ref: CYNGNOS-877 Change-Id: I27755f28e3a537c5ef61431817f22e98bc356c5d Signed-off-by: Roman Birg <roman@cyngn.com> (cherry picked from commit 5a4704de82e9f1f49c575dcae6e7bde0637ab2a1)
* Silence verbose Wifi loggingjumoog2015-05-181-3/+3
| | | | Change-Id: I30b4a770d030028dd090e8d547d2582d548d02ac
* Revert "aggressively blacklist WifiConfiguration for the purpose of ↵Michael Gernoth2015-05-053-56/+1
| | | | | | | | | | | | | switching network" This also blacklists network when dhcp acquisition fails due to range-problems and then blacklists the network for 2 days, even when it is the only available network (and it provides perfectly good internet-access when in range). This reverts commit 4fa99f57077ab287d6ed1b51cf308c44ce8bbe0b. Change-Id: I2bb73341c64095b7bbb13887a04a44983aced0c7
* Wifi: Do not enable saved networks in ConnectedStatestable/cm-12.1-YOG3CNalla Kartheek2015-04-111-3/+4
| | | | | | | | | | Since Wi-Fi Framework takes control over wpa_supplicant for network selection, there is no point to enable all the networks in the supplicant as this would end up in supplicant connect to other networks than the one selected by the framework. Change-Id: Ie691a4aa4e446363d6e2e6482956fca83eb7b183 CRs-Fixed: 800685
* Wifi: Filter the scan results based on the configured bandNalla Kartheek2015-04-113-2/+42
| | | | | | | | | | | | | Framework needs to get the scan results based on the configured band as the supplicant / host driver shall maintain the cache for these scan results. Without this, the UI shall display the scan results not corresponding to the configured band. This band capability also needs to be considered while getting the visibility of the network to trigger auto join. This commit ensures the same. Change-Id: Iccc9ab936895b3fb1028c2ad6a4fa12b7d4c7067 CRs-Fixed: 797374
* wifi: Handle the NULL check for the STATUS commandc_rrajiv2015-04-111-0/+4
| | | | | | | | | STATUS command is issued to the supplicant to get the currently connected network status. The current code does not consider the failure scenario (NULL check) for the obtained response and this commit handles the same. Change-Id: I4d90386bf8d909c97cacdf5b9c80e07a679d63ee CRs-Fixed: 811537
* Wifi: Exit the monitor thread when killSupplicant is issued.Hu Wang2015-04-111-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | When Wifi is turned off, WifiStateMachine issues terminate command to the supplicant and waits for the event CTRL-EVENT-TERMINATING. On receiving this TERMINTING event, WifiMonitor stops further monitoring of events. In some instances, WifiMonitor fails to receive the event CTRL-EVENT-TERMINATING and subsequently when Wifi framework times out it kills the supplicant. But this recovery logic has an issue where even though the supplicant is killed, the monitor thread is not stopped from listening the events and WifiMonitor continues looking for the events. Since at the time of killing the supplicant monitor_conn is initialized to NULL, internally fabricated WPA_EVENT_TERMINATING event is issued by the framework. This again leads to the deinitialization of the wlan0 / p2p0 interfaces while the process of initialization is in progress. This leads to concurrent actions of supplicant connection closure and command execution on the control socket. But wpa control interface library is not designed to concurrently handle activities on the control and monitor sockets. To solve this issue, exit the monitor thread when Wifi framework kills the supplicant explicitly (mConnected is set to FALSE). Change-Id: Ie130cb1b089bb39c30c088c6bee71debf7ecb08e CRs-Fixed: 810355
* wifi: Kill logspamstaging/cm-12.1Steve Kondik2015-03-231-1/+1
| | | | Change-Id: I24f573b4bba40d6d3738cd6477dae79b748745e7
* wifi: Handle error cases when EAP-SIM info is NULL/UnsupportedSravanthi Palakonda2015-03-231-1/+8
| | | | | | | | | | | | To get the SIM information,UI queries framework through the API exposed by the Wi-Fi framework which further interacts with the supplicant.If the supplicant times out or does not support the EAP-SIM functionality ,it either returns null or the string "unsupported".This throws an error while parsing at WifiEapSimInfo. This commit handles the error cases by catching the exception. Change-Id: Ie7b20dc32016d0396e68971415a835c40cf37989 CRs-Fixed: 796265
* WifiStateMachine: Tone down loggingMichael Bestas2015-03-121-5/+5
| | | | Change-Id: Iebb37cedc7ac999c7d6512681ae6c924ebd0fd2b
* Wifi: Add IBSS supported methodBruno Randolf2015-03-124-0/+84
| | | | | | | | Add method isIbssSupported() to WifiManager and related classes to query wether the driver supports IBSS mode. The query is answered by wpa_supplicants new command "get_capability modes". Change-Id: Idbccdf9d3b60855a0067032a0073f5aa001be224
* Fixed logging formatMarcos Marado2015-03-121-20/+20
| | | | Change-Id: I89905d56ee3933dfca32889df433d899745de847
* WifiController: fix high perf lock sometimes not respectedPawit Pornkitprasan2015-03-121-4/+30
| | | | | | | | | | | When the device screen is turned off, the state is DeviceActive for 15 minutes. In this time, high perf lock is not respected and Wi-Fi power-saving mode will be turned on because screen is off. Fix by adding a new DeviceActiveHighPerfState. Change-Id: I71074beec4d41286dea0861107d7931da205aca2 JIRA: CYAN-2860
* wifi: Set the mode at native layerRicardo Cerqueira2015-03-123-0/+10
| | | | | | | * Set normal/AP mode so that the HAL can specify correct module arguments when loading the driver. Change-Id: I6eee2cc53b5f1e70306e252e52c909833f220515
* wifi: Fix halutil buildSteve Kondik2015-03-121-0/+1
| | | | | | * We need to link libhardware_legacy too. Change-Id: Ida6bd36d222a48782acbf8b15ec3aab9956cf558
* Compilation fixZhoulu Luo2015-03-101-2/+6
| | | | Change-Id: I261bb890d53e3b0712fd70a199272133d3fe0f0c
* Merge tag 'android-5.1.0_r1' into HEADAnh Nguyen2015-03-1011-546/+1361
|\ | | | | | | | | | | | | | | | | | | | | Android 5.1.0 release 1 Conflicts: service/java/com/android/server/wifi/WifiAutoJoinController.java service/java/com/android/server/wifi/WifiConfigStore.java service/java/com/android/server/wifi/WifiStateMachine.java Change-Id: Ice0deccd16e33e512bf6c0b5ad53f8945303bdfe
| * aggressively blacklist WifiConfiguration for the purpose of switching networkvandwalle2015-01-273-1/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In cases where networks are not properly configured, WiFi might tries to repeatdly switch from one network to a bad network, or might try to roam and renew DHCP which can fail. In KK, WiFi autojoin would try other networks (by cycling to network it sees) and end up associated to a "good" network. In L release even thought WiFi might pick a good network it will still repeatedly try to switch to what it thinks is a better network and fail, thus annoying the user whose connection becomes unstable. This CL tries to remember networks that have seen multiple DHCP or auth failure in the past and for those networks it disable roaming temporarily. That is, if wifi is not associated to any network, it will tries to join a network aggressively, however if wifi is currently associated to a network, it will not try to switch to a new network if that new network has seen multiple failure in the past. The maximum blacklist time is set to 2 days for now. An example of such situation is: - user has multiple SSID at home, one of which is incorrectly configured with a wrong password - broken DHCP situation (potentially: multiple servers on home network, broken implementation incorrecting NAK'ing DHCP requests but properly serving DHCP offer...) Bug:18792931 Change-Id: Ib09eaaea978c772f630e86696f9a49f18ad708e2
| * Support MTK WIFI HAL librarysample.lin2015-01-221-0/+3
| | | | | | | | | | | | | | | | Bug: 18825290 from: https://partner-android-review.git.corp.google.com/#/c/192524/ Signed-off-by: sample.lin <sample.lin@mediatek.com> Change-Id: I3c19e1df455e77f71354f5e45b6a4037cc366051
| * Merge "prevent null BSSID being inject as scan results Bug:18917134" into ↵vandwalle2015-01-161-1/+14
| |\ | | | | | | | | | lmp-mr1-dev
| | * prevent null BSSID being inject as scan resultsvandwalle2015-01-131-1/+14
| | | | | | | | | | | | | | | | | | Bug:18917134 Change-Id: I0c4d0a2bd5383bac473a588af89589bf70f47c6c
| * | Merge "Fix an NPE in WifiConfigStore" into lmp-mr1-devVinit Deshpande2015-01-141-10/+12
| |\ \
| | * | Fix an NPE in WifiConfigStoreVinit Deshpande2015-01-091-10/+12
| | |/ | | | | | | | | | | | | | | | | | | | | | Disabling an invalid configuration causes Wifi service to crash. This change gaurds against bad API call. Bug: 18904771 Change-Id: I8d853b754cbd4163c17f3d53bf81dc7625c95466
| * | Merge "Disconnect if we had IPv4 and lost it." into lmp-mr1-devErik Kline2015-01-131-2/+5
| |\ \ | | |/ | |/|
| | * Disconnect if we had IPv4 and lost it.Erik Kline2015-01-071-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More specifically, the DHCP_FAILURE case is entered when a DHCPv4 RENEW fails. Even though we would connect to a network with no IPv4, when roaming to a "same network" and losing IPv4 it's probably better to disconnect and start afresh. Bug: 18867306 Change-Id: Ie667b4f0481ae0510d0dc00db819f4e5d43d98a9
| * | Fix incorrect tracking of ephemeral network statistics.Jeff Davidson2015-01-081-18/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lastUntrustedBSSID variable was being used as an SSID, not a BSSID, and was not cleared after the untrusted network was disconnected, causing stats not to increment on new connections if the last connection was to the same SSID. So, remove this unnecessary variable, and check the current WifiConfiguration to determine which network we're currently using, if any. Increment the connection count only when we are actually going to associate with the SSID. This only affects untrusted network flows and should have no impact when connecting to saved Wi-Fi networks. The only non-statistical change involves the boost given to the active network, which is controlled by the NetworkScorer and can be updated dynamically (outside of the framework). Bug: 18908655 Change-Id: I5b712a4ff613d8199d0591e568886be0d2419645
| * | Merge "Split untrusted NetworkFactory from regular one." into lmp-mr1-devJeff Davidson2015-01-061-6/+32
| |\ \ | | |/ | |/|
| | * Split untrusted NetworkFactory from regular one.Jeff Davidson2014-12-221-6/+32
| | | | | | | | | | | | | | | | | | This ensures that we see all requests for untrusted networks. Bug: 18815795 Change-Id: I9aaba6095b934fee27a27b20fa3adb2a10648e80
| * | Keep AutoJoin enabled when user has manually selected a networkvandwalle2014-12-291-5/+8
| | | | | | | | | | | | | | | | | | Bug:18865214 Change-Id: Iae9297cd50ebaf12217d12e4c5d55ae05316e917
| * | Merge "add debug logs to confirm network flapping issue is fixed ↵vandwalle2014-12-184-21/+37
| |\ \ | | | | | | | | | | | | Bug:18706288" into lmp-mr1-dev
| | * | add debug logs to confirm network flapping issue is fixedvandwalle2014-12-174-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | Bug:18706288 Change-Id: I27a86aeb650a63511b667244b0138afbc1bc059e
| * | | Merge "Disable legacy poor Network detection Bug:18723206 Legacy poor ↵vandwalle2014-12-181-9/+2
| |\ \ \ | | |/ / | |/| | | | | | network detection was removed from L settings but can still be enabled during an upgrade if it had been manually enabled by user, now really disable it." into lmp-mr1-dev
| | * | Disable legacy poor Network detectionvandwalle2014-12-161-9/+2
| | |/ | | | | | | | | | | | | | | | | | | Bug:18723206 Legacy poor network detection was removed from L settings but can still be enabled during an upgrade if it had been manually enabled by user, now really disable it. Change-Id: I661b326c6f5dfacfcc5582cea14dc52501740367
| * / Stabilize ephemeral connections in the face of new BSSIDs.Jeff Davidson2014-12-162-37/+96
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we only check whether the most recently seen BSSID has a score before deciding to disconnect an ephemeral network. This causes unnecessary flapping - if multiple BSSIDs are in visible range, and the scorer likes one of them but has no score for the other (or is still looking up the score), we will drop the connection. Instead, as long as we've recently seen a scored BSSID (in the last minute), we keep the connection alive. A scorer can still initiate an immediate disconnect from an unwanted network by nulling scores for all BSSIDs. The timeout (and whether we use this new behavior at all) is controlled by a Settings.Global flag. Bug: 18637384 Change-Id: I6bde3c9eef12caf2cc51c449abffc1c69f60c17f
| * Merge changes Ieee0b91a,I0093620c into lmp-mr1-devPrem Kumar2014-12-142-26/+79
| |\ | | | | | | | | | | | | | | | * changes: fix logspam Bug:18589606 Apply 5GHz band preference only when comparing configurations on different bands
| | * fix logspamvandwalle2014-12-111-2/+19
| | | | | | | | | | | | | | | | | | Bug:18589606 Change-Id: Ieee0b91ab96ec9392a9b91ac1017a319605425dc
| | * Apply 5GHz band preference only when comparing configurations on different bandsvandwalle2014-12-111-24/+60
| | | | | | | | | | | | | | | | | | Bug:18589301 Change-Id: I0093620c859940d993c9ea60d9d6cdc86bb2fa58
| * | Merge "make sure wificonfiguration scan cache doesnt grow unbounded ↵Prem Kumar2014-12-141-1/+9
| |\| | | | | | | | | | Bug:18703749" into lmp-mr1-dev
| | * make sure wificonfiguration scan cache doesnt grow unboundedvandwalle2014-12-111-1/+9
| | | | | | | | | | | | | | | | | | Bug:18703749 Change-Id: If6452e7dbaaabb164cf2a99b48b3964f4cb86ee5
| * | Merge "autojoin scanning + P2P - discard autojoin scan when both infra and ↵Prem Kumar2014-12-141-1/+21
| |\| | | | | | | | | | P2P are connected - reduce autojoin scan period when P2P is connected and infra is disconnected Bug:18692653" into lmp-mr1-dev
| | * autojoin scanning + P2Pvandwalle2014-12-111-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | - discard autojoin scan when both infra and P2P are connected - reduce autojoin scan period when P2P is connected and infra is disconnected Bug:18692653 Change-Id: Id1891e6a9f2863d8876915cfefd158fb1712b8fe
| * | Merge "handle beacons reported with wrong RSSI value of 0 Bug:18654243" into ↵Prem Kumar2014-12-142-0/+17
| |\| | | | | | | | | | lmp-mr1-dev
| | * handle beacons reported with wrong RSSI value of 0vandwalle2014-12-102-0/+17
| | | | | | | | | | | | | | | | | | Bug:18654243 Change-Id: Ied2fbc87c7effc23fecb68e9863153d63c0cfba4
| * | Merge "Fix an unhandled exception in WifiP2pStateMachine" into lmp-mr1-devVinit Deshpande2014-12-111-1/+1
| |\ \ | | |/ | |/|
| | * Fix an unhandled exception in WifiP2pStateMachineVinit Deshpande2014-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An exception is thrown when group creation is deemed failed. It is thrown because an empty peer address is encountered. It is not clear when the address goes empty (there are no logs); but this change would prevent resstarting of the framework. Bug: 18667239 Change-Id: I523646eaa1ff6c8dab9ee99b893ebc4291eee2da