summaryrefslogtreecommitdiff
path: root/services/java/com/android/server/ConnectivityService.java
Commit message (Collapse)AuthorAgeFilesLines
* Move some system services to separate directoriesAmith Yamasani2013-12-191-4930/+0
| | | | | | | | Refactored the directory structure so that services can be optionally excluded. This is step 1. Will be followed by another change that makes it possible to remove services from the build. Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
* am a8a448da: am e568672c: Merge "Fix NPE in ConnectivityService" into klp-devRobert Greenwalt2013-11-181-1/+1
|\ | | | | | | | | * commit 'a8a448da25c62f54cac3318c17c69e851a4ecde9': Fix NPE in ConnectivityService
| * Fix NPE in ConnectivityServiceRobert Greenwalt2013-11-181-1/+1
| | | | | | | | | | bug:11727708 Change-Id: Ia8ca9d1e23f021feaf4b772ec38d1d0e89b0cd2a
* | am 4c514f2a: am 594eeb08: Merge "Fix for the invalid Global Proxy Setting" ↵Robert Greenwalt2013-11-131-0/+14
|\| | | | | | | | | | | | | into klp-dev * commit '4c514f2a688bdae319c919987092ccfee690f390': Fix for the invalid Global Proxy Setting
| * Fix for the invalid Global Proxy SettingRaj Mamadgi2013-11-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | Adding validation for Global Proxy setting before it is being set. Proxy is validated at the boot time also to make sure the value set is valid. Signed-off-by: Raj Mamadgi <rmamadgi@sta.samsung.com> bug:11598568 Change-Id: Idff5ae81119d8143da096b5291ecbfbc5875cbd4
* | am 6eddb39c: am 18490abd: Merge "Fix NPE in ConnectivityService"Robert Greenwalt2013-11-131-2/+5
|\ \ | |/ |/| | | | | * commit '6eddb39c857b178672218a345a276c4304e7ad37': Fix NPE in ConnectivityService
| * am 18490abd: Merge "Fix NPE in ConnectivityService"Robert Greenwalt2013-11-131-2/+5
| |\ | | | | | | | | | | | | * commit '18490abd9bcb401f0d75a314056fb2a44dd61f07': Fix NPE in ConnectivityService
| | * Fix NPE in ConnectivityServiceKen Mixter2013-11-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | Could occur when requestRouteToHostAddress is called on a network with no associated tracker. Code later in the method handles this case gracefully but code introduced in JB throws an exception. Change-Id: I6c8a0e313ecbcca120aeb5dd0802a72114749aa1
* | | Use HttpsURLConnection to by pass proxies.Wink Saville2013-10-311-20/+99
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In isMobileOk attempting to connect to clients3.google.com/generate_204 we sometimes see a proxy server will not let the connection go to our server and instead returns 200 instead of 204. By using Https we by pass proxy servers and we will always connected to our server. The number of loops is increased from 3 to 4 and half the the retires will use Http and half will use Https. I also, added mTestingFailures which can be set to true by setting persist.checkmp.testfailures to 1. This will cause checkMobileProvisiong to always fail so we can test https & http. Bug: 9972012 Change-Id: I870606037dcffe5250843980517ac52218266e02
* | | Merge "Change how we use provisioning url so post works" into klp-devRobert Greenwalt2013-10-171-2/+3
|\ \ \
| * | | Change how we use provisioning url so post worksRobert Greenwalt2013-10-171-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Needed to do an http post instead of a get for one carrier. Do this by putting an auto-submitting form in the data to be interpreted as a html doc by the browser. The ACTION_VIEW intent only works on http uri, but by specifying ACTION_MAIN/ CATEGORY_APP_BROWSER we could use data:text/html. bug:11168810 Change-Id: Ifd33e1c3c7f9f40b6add39e446e6a7d7cde22549
* | | | Retry captiveportal check even if only one addrRobert Greenwalt2013-10-151-21/+34
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We're getting some false positive results on this check and while it was coded to try 3 times given sufficient independent addrs the default url resolves to a single address so we'd just try once. Rework to try again even with fewer urls to try to reduce the false positives. Also adds a random query param to fool proxies into not caching. bug:9972012 Change-Id: Ib719f40ec612065ca6bcd919549fc1164506d35a
* | | getProxy in ConnectivityService returns port w/PACJason Monk2013-10-101-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Changes the PacManager to report message back to ConnectivityService to send a broadcast once the download has completed. This allows the ConnectivityService to store the correct proxy info for getProxy(). This made the problem arise that ProxyProperties was not handling port while it had PAC. Added small fix for equals() and parcelization. The combination of these fixes seems to resolve Bug: 11028616. Bug: 11168706 Change-Id: I92d1343a8e804391ab77596b8167a2ef8d76b378
* | | Fix captive portal detection on IPv6 networks.Lorenzo Colitti2013-10-081-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the captive portal check URL is generated by concatenating scheme, "://", IP address, and port. This breaks for IPv6 because IPv6 addresses in URLs must be enclosed in square brackets (e.g., http://2001:db8::1/generate_204 is invalid; should he http://[2001:db8::1]/generate_204 instead). The resulting MalformedURLException causes isMobileOk to report that there is no captive portal, even if there is one. Fortunately the three-arg URL constructor already knows how to construct URLs with IPv6 addresses. Use that instead of generating the URL ourselves. Bug: 10801896 Change-Id: I02605ef62f493a34f25bb405ef02b111543a76fd
* | | Merge "Don't redirect dns to an iface without dns servers" into klp-devRobert Greenwalt2013-10-041-9/+11
|\ \ \
| * | | Don't redirect dns to an iface without dns serversRobert Greenwalt2013-09-251-9/+11
| | | | | | | | | | | | | | | | | | | | bug:10115444 Change-Id: Ide42072bb3aae21f8e99c11c2de263e9a765b911
* | | | Use networkType to display wifi and mobile notification separately.Wink Saville2013-10-031-7/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are two bugs one is I was clearing the notification in CaptivePortalTracker when entering the ActivateState. (double check according to bug 5021626 we should be calling enter) Second is we could have the need to display both icons but can't because we only allow one. The solution I'm proposing here is to allow two notifications and have then controlled separately. Bug: 10886908 Change-Id: I30e7130bc542535492d175640a4990c592f32806
* | | Tighten condition for calling checkMobileProvisioning.Wink Saville2013-09-141-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add the condition that the connected network needs to be TYPE_MOBILE. This eliminates checking on connecting to secondary networks like FOTA, MMS, SUPL ... This reduces unnecessary attempts to bring up multiple connections at the same time. Especially in the light of the trouble we're having with HFA on Sprint, where we don't want to connect to any other network until HFA has completed. Bug: 10758001 Change-Id: Id294536b70304a51de4752bc1a4ffac734f10f1a
* | | Merge "checkMobileProvisioning should not block." into klp-devWink Saville2013-09-131-39/+24
|\ \ \
| * | | checkMobileProvisioning should not block.Wink Saville2013-09-131-39/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In checkMobileProvisioning the call to mdst.isProvisioningNetwork() is a blocking call and during monkey testing without SIM this is causing ANR's. Move the initial test for provisioning into isMobileOk so checkMobileProvisioning doesn't block. If mobile is not supported return CMP_RESULT_NO_CONNECTION. Cleaned up some debug. Bug: 10674404 Change-Id: I10a0e922cd6ea9790f66e2083f37e68cb0a8861f
* | | | Merge "Guarantee that PAC Local Proxy owns Port" into klp-devJason Monk2013-09-131-1/+1
|\ \ \ \ | |/ / / |/| | |
| * | | Guarantee that PAC Local Proxy owns PortJason Monk2013-09-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This changes the PAC support to not broadcast the Proxy information until the Local Proxy has started up and successfully bound to a port so that the local proxy information can be guaranteed to be owned by the proxy. Bug: 10459877 Change-Id: I175cd3388c758c55e341115e4a8241884b90d633
* | | | Merge changes Ib1274847,I2eb2a1bf into klp-devJeff Sharkey2013-09-111-9/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * changes: Fix SDK build. Request all tethering interfaces, fix corruption.
| * | | | Request all tethering interfaces, fix corruption.Jeff Sharkey2013-09-101-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | netd now tracks statistics for tethered interfaces across tethering sessions, so switch to asking for all tethering stats. (Currently we're double-counting all tethering data, ever since it started tracking across sessions.) Also catch OOME to handle corrupt stats files, which we then dump to DropBox and then start over. Bug: 5868832, 9796109 Change-Id: I2eb2a1bf01b993dd198597d770fe0e022466c6b9
* | | | | Fix for the toggle airplane mode hidden APIYuhao Zheng2013-09-111-4/+4
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix to https://googleplex-android-review.git.corp.google.com/#/c/356900/ Previous implementation throws SecurityException when the API is called from apps. bug:10653570 Change-Id: I95ae6f07db74d881f1a8d3d40a6486105a068e90
* | | | Add a hidden API to toggle airplane mode.Yuhao Zheng2013-09-101-0/+15
|/ / / | | | | | | | | | | | | | | | | | | | | | Added a hidden API under ConnectivityManager to toggle airplane mode. This may be a temp solution for b/10653570. bug:10653570 Change-Id: I0b2b42230073289eb8dc6891317d62b84e26c133
* | | Merge "Tighten test for warm sim and add more debug." into klp-devWink Saville2013-09-091-25/+40
|\ \ \
| * | | Tighten test for warm sim and add more debug.Wink Saville2013-09-061-25/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Require a non-204 response multiple times before declaring a redirected error and hence a warm sim. - If there is no connection or dns don't declare its a warm-sim. - Add printing of the http headers to try to get more information if we still get a false positive result. Bug: 9972012 Change-Id: Ic115685cdbbe39c2b4de88b128eaf8d2ea96b45c
* | | | Merge "Setting MTU size for specific network." into klp-devRobert Greenwalt2013-09-061-1/+21
|\ \ \ \
| * | | | Setting MTU size for specific network.sy.yun2013-09-061-1/+21
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Able to config network specific MTU size. Normally, the default size of MTU is 1500. US - ATT 1410, TMUS 1440, SPRINT 1422 KR - SKT 1440, KT 1450, LGU+ 1428 JP - KDDI 1420, SoftBank 1340 CA - RGS 1430, FIDO 1430, MTS 1430, BELL 1358, SaskTel 1358 AU - TEL 1400 Bug: 10195070 Change-Id: Ie18650b37a3d44af944f2dae4aa97c04fb12cd5e
* | | | Merge "Minor fixes: Add a missing "break" and some cosmetic fixes." into klp-devSreeram Ramachandran2013-09-061-19/+16
|\ \ \ \ | |/ / / |/| | |
| * | | Minor fixes: Add a missing "break" and some cosmetic fixes.Sreeram Ramachandran2013-08-271-19/+16
| | | | | | | | | | | | | | | | Change-Id: Ie614a7b47185fd511fdc3f064620e46ab7d6d8f8
* | | | am fc7a146b: am 50f86448: am 59a9884b: Merge "Do not change ↵Wink Saville2013-09-061-8/+7
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NetworkInfo.DetailedState." into jb-mr2-dev * commit 'fc7a146b82774514bad4bc307489ece7ac27ee50': Do not change NetworkInfo.DetailedState.
| * | | | Do not change NetworkInfo.DetailedState.Wink Saville2013-09-051-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'd changed DetailedState to force ConnectivityService to treat provisioning apn's specially. In particular so that they wouldn't be identified they were fully connected until the provisioning actually started. The problem is that DetailedState is a public enum that has a CTS test and just changing the CTS to allow for the new state (CONNECTED_TO_PROVISIONING_NETWORK) was inappropriate. Instead I've added a new mIsConnectedToProvisioningNetwork variable and used the DetailedState.SUSPENDED as the intermediate state. Bug: 10620248 Change-Id: Id4a842398cad67455541ce629959351c27d83639
* | | | | Merge "Rename LinkInfo to LinkQualityInfo" into klp-devVinit Deshapnde2013-09-051-9/+9
|\ \ \ \ \
| * | | | | Rename LinkInfo to LinkQualityInfoVinit Deshapnde2013-09-041-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change renames the LinkInfo objects to LinkQuailtyInfo. The API is still hidden; but it can be accessed via reflection. Bug: 10342372 Change-Id: Ieccea87c467ceae5d7f76298b137573f67396cd6
* | | | | | Merge commit '270226b0' into manualmergeWink Saville2013-08-291-100/+376
|\ \ \ \ \ \ | |/ / / / / |/| / / / / | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '270226b0': Add support for handling mobile provisioning networks. Conflicts: core/java/android/net/CaptivePortalTracker.java core/java/android/net/ConnectivityManager.java core/java/android/net/IConnectivityManager.aidl core/java/android/net/MobileDataStateTracker.java core/res/AndroidManifest.xml services/java/com/android/server/ConnectivityService.java Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
| * | | | Add support for handling mobile provisioning networks.Wink Saville2013-08-291-92/+353
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a sim is new or it has expired it needs to be provisioned with the carrier. Basically provisioning is associating a sim with a user account. When a sim isn't provisioned then operators will restrict access to the network and only allow certain addresses or services to be used. This set of changes allows two types of provisioning networks to be recognized. The first is a network that causes all DNS lookups to be redirected to a different address than was intended. This is exemplified by how T-Mobile works. The second technique uses a special apn for provisioning. An example is AT&T where lwaactivate is the provisioning apn and broadband is the normal apn. We first try broadband and if we are unable to connect we try lwaactivate. When we see the activate we identify it as special and the ApnContext.isProvisioningApn will return true. In the future our plan is to create a new network type that can be added to the apn list, but for now it identified by name. Here is a list of significant changes: - CaptivePortalTracker now only test WiFi networks instead of all networks - checkMobileProvisioning checks for provisioning networks and doesn't try to ping. - IConnectivityManager.aidl changes: * getProvisioningOrActiveNetworkInfo was added to and used by Manage mobile plan in WirelessSettings so even when there is no active network it will still allow provisioning. Otherwise it would report no internet connection. * setSignInErrorNotificationVisible is used by both CaptiviePortalTracker and checkMobileProvisioning so they use the same code for the notifications. * checkMobileProvisioning was simplified to have only a timeout as returning the result is now harder as we abort simultaneous call otherwise we'd could get into loops because we now check every time we connect to mobile. - Enhanced MDST to handle the provisioning network. - Added CONNECTED_TO_PROVISIONING_NETWORK to NetworkInfo to make a new state so we don't announce to the world we're connected. - TelephonyIntents.ACTION_DATA_CONNECTION_CONNECTED_TO_PROVISIONING_APN is sent by the low level data connection code to notify Connectivity Service that a provisioning apn has connected. This allows CS to handle the connection differently than a normal connection. Bug: 10328264 Change-Id: I3925004011bb1243793c4c1b963d923dc2b00cb5
| * | | | DO NOT MERGE: MDST is not ready until connected to DcTracker.Wink Saville2013-08-161-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the system becomes loaded the PhoneApp can be delayed significantly and a call to setEnableFailFastMobileData may not occur because the channel between the MobileDataStateTracker (MDST) and DcTracker (DCT) is not connected. Solution: Add a isReady to MDST and isMobileDataStateTrackerReady to ConnectivityService and call it from isMobileOk. Bug: 10351868 Change-Id: I92f9d58121b88186b636cd71c2fd2ef9a28f7cf6
| * | | | In isMobileOk don't execute finally if mobile data is not supported.Wink Saville2013-08-151-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the early return outside the try {} finally so we don't call setEnableFailFastMobileData(DctContants.DISABLED). Otherwise referencing counting is wrong and an exception is thrown in DcTrackerBase. Bug: 10304904 Change-Id: I5ba5121e473bada9f3daa8d6f3d3577cec8212fc
* | | | | Don't clear Global Proxy on boot.Jason Monk2013-08-271-2/+0
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Doesn't clear the global proxy when a deprecated one is not found because there still may be a non-deprecated global proxy present. Bug: 10457179 Change-Id: I68e6d5aee7b4940f9315484060c7d82cb8ccfa70
* | | | Merge "Introduce network link quality statistics" into klp-devVinit Deshapnde2013-08-221-3/+147
|\ \ \ \
| * | | | Introduce network link quality statisticsVinit Deshapnde2013-08-211-3/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change starts tracking traffic quality data for WiFi and mobile networks. The quality is tracked based on incidental traffic, and not on specific measurements. Theoretical bandwidths are hard-coded, as well as sampling interval; although sampling interval can be changed by setting a system policy. Bugs filed to remove shortcomings of this change - 10342372 Change LinkInfo name to something better 10342318 Move hardcoded values of MobileLinkInfo to resources so they can be updated without changing code Bug: 10006249 Change-Id: I83d8c7594da20fe53abbd5e1f909b1f606b035bb
* | | | | Modify LinkProperties address update methods.Lorenzo Colitti2013-08-201-16/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Make addLinkAddress a no-op if the address already exists. 2. Make addLinkAddress, addStackedLink and removeStackedLink return a boolean indicating whether something changed. 3. Add a removeLinkAddress method (currently there is no way of removing an address). 3. Move hasIPv6Address from ConnectivityService to LinkProperties, where it belongs. Bug: 9625448 Bug: 10232006 Change-Id: If641d0198432a7a505e358c059171f25bc9f13d5
* | | | In isMobileOk don't execute finally if mobile data is not supported.Wink Saville2013-08-131-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the early return outside the try {} finally so we don't call setEnableFailFastMobileData(DctContants.DISABLED). Otherwise referencing counting is wrong and an exception is thrown in DcTrackerBase. Bug: 10304904 Change-Id: I5ba5121e473bada9f3daa8d6f3d3577cec8212fc
* | | | am 9b7b4450: am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal ↵Wink Saville2013-08-081-0/+11
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | is detected enable fail fast." into jb-mr2-dev * commit '9b7b4450185e723dc7021f7e8bae4a12d4dd5606': If in a mobile captive portal is detected enable fail fast.
| * | | Merge "If in a mobile captive portal is detected enable fail fast." into ↵Wink Saville2013-08-081-0/+11
| |\ \ \ | | | | | | | | | | | | | | | jb-mr2-dev
| | * | | If in a mobile captive portal is detected enable fail fast.Wink Saville2013-08-071-0/+11
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When captive portal checking completes pass back the result. This is used to enable/disable failing fast for mobile. When failing fast is enabled we don't check for data stalls and thus won't be continually trying to do recovery operations, such as restarting the radio. Bug: 9462512 Change-Id: I0dea0eee519f8ee7f94e79d40e82c18f30d7fe2e
* | | | am 7c00be48: am 55adb390: am 35152f13: Merge "Have CaptivePortalTracker use ↵Wink Saville2013-08-081-3/+6
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | gservices updateable provisioning urls." into jb-mr2-dev * commit '7c00be48fcb1986db14915beef549e925b5670d2': Have CaptivePortalTracker use gservices updateable provisioning urls.
| * | | Merge "Have CaptivePortalTracker use gservices updateable provisioning ↵Wink Saville2013-08-081-3/+6
| |\ \ \ | | | | | | | | | | | | | | | urls." into jb-mr2-dev