438 Commits

Author SHA1 Message Date
Wink Saville
127beffb05 Tighten condition for calling checkMobileProvisioning.
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
2013-09-14 09:04:53 -07:00
Wink Saville
7770dcc3d3 Merge "checkMobileProvisioning should not block." into klp-dev 2013-09-13 20:59:16 +00:00
Jason Monk
312c495f4b Merge "Guarantee that PAC Local Proxy owns Port" into klp-dev 2013-09-13 20:31:54 +00:00
Wink Saville
d95ccc5c6a checkMobileProvisioning should not block.
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
2013-09-13 12:40:11 -07:00
Jason Monk
6f8a68f49a Guarantee that PAC Local Proxy owns Port
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
2013-09-13 09:53:26 -04:00
Jeff Sharkey
ceccceccff Merge changes Ib1274847,I2eb2a1bf into klp-dev
* changes:
  Fix SDK build.
  Request all tethering interfaces, fix corruption.
2013-09-11 20:16:59 +00:00
Yuhao Zheng
5530e4b5d4 Fix for the toggle airplane mode hidden API
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
2013-09-11 09:44:28 -07:00
Jeff Sharkey
e4984bea95 Request all tethering interfaces, fix corruption.
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
2013-09-10 21:03:30 -07:00
Yuhao Zheng
5cd1a0e8d7 Add a hidden API to toggle airplane mode.
Added a hidden API under ConnectivityManager to toggle airplane mode.
This may be a temp solution for b/10653570.
bug:10653570

Change-Id: I0b2b42230073289eb8dc6891317d62b84e26c133
2013-09-10 09:57:12 -07:00
Wink Saville
bdd61696c6 Merge "Tighten test for warm sim and add more debug." into klp-dev 2013-09-09 01:32:45 +00:00
Robert Greenwalt
ecd0db5a73 Merge "Setting MTU size for specific network." into klp-dev 2013-09-06 22:42:10 +00:00
Sreeram Ramachandran
1aa3202b1b Merge "Minor fixes: Add a missing "break" and some cosmetic fixes." into klp-dev 2013-09-06 22:37:21 +00:00
sy.yun
9d9b74a900 Setting MTU size for specific network.
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
2013-09-06 15:26:19 -07:00
Wink Saville
4fea0413c1 Tighten test for warm sim and add more debug.
- 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
2013-09-06 09:54:24 -07:00
Wink Saville
a1d6a9b474 am fc7a146b: am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit 'fc7a146b82774514bad4bc307489ece7ac27ee50':
  Do not change NetworkInfo.DetailedState.
2013-09-06 09:19:40 -07:00
Wink Saville
67c3821926 Do not change NetworkInfo.DetailedState.
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
2013-09-05 12:02:25 -07:00
Vinit Deshapnde
b402fb2fdd Merge "Rename LinkInfo to LinkQualityInfo" into klp-dev 2013-09-05 17:50:19 +00:00
Vinit Deshapnde
6a2d32597a Rename LinkInfo to LinkQualityInfo
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
2013-09-04 14:11:24 -07:00
Wink Saville
7788c61af5 Merge commit '270226b0' into manualmerge
* 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
2013-08-29 14:57:08 -07:00
Wink Saville
948282b0e6 Add support for handling mobile provisioning networks.
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
2013-08-29 08:55:16 -07:00
Sreeram Ramachandran
b1486aed22 Minor fixes: Add a missing "break" and some cosmetic fixes.
Change-Id: Ie614a7b47185fd511fdc3f064620e46ab7d6d8f8
2013-08-27 11:41:19 -07:00
Jason Monk
a8220a73c5 Don't clear Global Proxy on boot.
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
2013-08-27 10:51:24 -04:00
Vinit Deshapnde
e2a6d3df12 Merge "Introduce network link quality statistics" into klp-dev 2013-08-22 16:16:45 +00:00
Vinit Deshapnde
1f12cb52a4 Introduce network link quality statistics
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
2013-08-21 13:09:01 -07:00
Lorenzo Colitti
4faa027df0 Modify LinkProperties address update methods.
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
2013-08-20 21:16:37 +09:00
Wink Saville
dce52cdbf1 DO NOT MERGE: MDST is not ready until connected to DcTracker.
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
2013-08-16 17:17:28 -07:00
Wink Saville
e63411f28b In isMobileOk don't execute finally if mobile data is not supported.
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
2013-08-15 21:14:30 -07:00
Wink Saville
afe58b07db In isMobileOk don't execute finally if mobile data is not supported.
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
2013-08-13 12:41:06 -07:00
Wink Saville
89d16f7597 am 9b7b4450: am 02eab434: am 4d87d91d: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '9b7b4450185e723dc7021f7e8bae4a12d4dd5606':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 17:10:34 -07:00
Wink Saville
292a92e337 am 7c00be48: am 55adb390: am 35152f13: Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
* commit '7c00be48fcb1986db14915beef549e925b5670d2':
  Have CaptivePortalTracker use gservices updateable provisioning urls.
2013-08-08 17:10:32 -07:00
Wink Saville
280f6218a5 am 81b1fa6f: am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit '81b1fa6fc62190d64a6b76b4a5ee7cc2bf3172ac':
  Check that hipri has started.
2013-08-08 16:22:14 -07:00
Wink Saville
4d87d91dfe Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev 2013-08-08 22:07:27 +00:00
Wink Saville
35152f13b3 Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev 2013-08-08 22:06:21 +00:00
Jason Monk
602b232a06 Add PAC File support for proxy configuration
PAC (Proxy auto-config) files contain a single javascript function,
FindProxyForURL(url, host).  It gets called to determine what proxy should be
used for a specific request.

This adds PAC support to the system.  The ProxyProperties has been modified
to hold the PAC file when one is present.  The Proxy method
setHttpProxySystemProperty has been modified to insert a PacProxySelector
as the default ProxySelector when it is required.  This new ProxySelector
makes calls to the ConnectivityService to parse the PAC file.

The ConnectivityService and the WifiConfigStore have been modified to support
saving the extra PAC file data.

The ConnectivityService now has a class attached (PacProxyNative) that
interfaces to the native calls for PAC files.  The parsing of the PAC file
is handled by libpac (which is being added to external/) which utilizes
libv8 to parse the javascript.

As a fallback to applications that don't use the java ProxySelector,  the proxy
is setup to point to a local proxy server that will handle the pac parsing.

bug:10182711
Change-Id: I5eb8df893c632fd3e1b732385cb7720ad646f401
2013-08-07 21:01:39 -04:00
Wink Saville
d747cbc898 If in a mobile captive portal is detected enable fail fast.
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
2013-08-07 16:22:47 -07:00
Wink Saville
7f6ee2ec90 Check that hipri has started.
I needed to test the result of startUsingNetworkFeature, otherwise
on mobile networks that are slow to come up, we won't detect
warm SIMs after booting.

Bug: 9962943
Change-Id: Ib638a4e43867ecaa85d6abff65643b77a63526b6
2013-08-07 11:02:57 -07:00
Wink Saville
42d4f08db2 Have CaptivePortalTracker use gservices updateable provisioning urls.
After detecting there is a captive portal the url used in the
notification for mobile networks should be updateable via gservices.
These urls will be the same as used by CheckMp and is needed for
carriers that have specific provisioning urls such as AT&T and Verizon.

Bug: 9622647
Change-Id: Idcf4dabc72ece1dbbe1d5e5a21e550dd06fe16c7
2013-08-05 14:15:54 -07:00
Lorenzo Colitti
e1cd293151 Merge "Add accessors for all addresses and clarify compare* methods" 2013-08-01 06:44:29 +00:00
Wink Saville
1aef7fc81a Fix excessive log spew.
Bug: 10115060
Change-Id: I61fd83071da1224f38757b8d90f58c8d6c41d36b
2013-07-31 15:49:04 -07:00
Lorenzo Colitti
d1e0fae2bc Add accessors for all addresses and clarify compare* methods
1. Add a method to return all addresses and all LinkAddresses on
   all links (both base links and stacked links). We already had
   one for routes, but did not yet have any for addresses.
2. Rename compareRoutes to compareAllRoutes, because unlike the
   other compare* methods, it looks at all interfaces. Update
   what appears to be its only caller.
3. Update the documentation of the compare* methods to match
   reality (they don't return lists) and clarify whether they
   look at all links or only the base link.

Change-Id: Ie22e6c7f163d5de8e407248b45171dc28382d2d3
2013-08-01 00:21:24 +09:00
Wink Saville
5e56bc5437 Add network type TYPE_MOBILE_IA.
Add a network type for establishing connections to the apn used for
the initial connection.

Enable some debug for now.

Bug: 8733613
Change-Id: Ia627ac0cf5715660b6d02bb13a83d46ec1727b87
2013-07-29 15:02:29 -07:00
Geremy Condra
350d274746 Merge "Remove unused mDnsOverridden" 2013-07-26 17:48:54 +00:00
Chad Brubaker
b98703e9c0 Remove unused mDnsOverridden
mDnsOverridden is no longer used now that VPNs do not override the
default DNS settings.

Change-Id: I69495b9a6de7d60628813f357d3dbdf548695ada
2013-07-23 17:49:37 -07:00
Geremy Condra
46a7b0d1aa Merge "Fix default DNS not being set on network changes" 2013-07-24 00:32:34 +00:00
Chad Brubaker
20a7e881da Fix default DNS not being set on network changes
Change-Id: I3c45404cab34c77b20dadc1d8aee127aa08fd0bd
2013-07-23 17:13:36 -07:00
Geremy Condra
5830e07521 Merge "Fix supplimentary network connections with VPNs" 2013-07-23 17:58:33 +00:00
Geremy Condra
1b6868cc4b Merge "Support multiple Vpn ManageDialogs" 2013-07-23 17:55:45 +00:00
Chad Brubaker
f336d722c7 Fix supplimentary network connections with VPNs
Enables the use of supplimentary mobile networks like MMS, and HIPRI
while VPNs are running.

Change-Id: I313f57a905b4e16bd4322c68687cbff1cfbe9d3e
2013-07-19 15:57:05 -07:00
Robert Greenwalt
bfc7634b36 resolved conflicts for merge of f9774dc7 to master
Change-Id: Ia9509ab6897e27da8bf4fc61a4140f2f93acb80f
2013-07-19 14:30:49 -07:00
Robert Greenwalt
538cdb98ef resolved conflicts for merge of 85b5e4c4 to master
Change-Id: Idd0ad9b1504fddf68c4c4cc04731de1eddd204b3
2013-07-19 14:09:30 -07:00