Commit graph android_packages_modules_Co.../services/java/com/android
Message SHA1
Fix captive portal detection on IPv6 networks.
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

Lorenzo Colitti   commited 2013-10-08 14:15:14 +09:00
9405beeea0
Merge "Don't redirect dns to an iface without dns servers" into klp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-10-04 18:06:13 +00:00
d5e94d8699
Use networkType to display wifi and mobile notification separately.
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

Wink Saville   commited 2013-10-03 08:34:46 -07:00
76f49d3cee
Don't redirect dns to an iface without dns servers
bug:10115444
Change-Id: Ide42072bb3aae21f8e99c11c2de263e9a765b911

Robert Greenwalt   commited 2013-09-25 16:58:45 -07:00
b87ab96295
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

Wink Saville   commited 2013-09-14 09:04:53 -07:00
11fa47227d
Merge "checkMobileProvisioning should not block." into klp-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2013-09-13 20:59:16 +00:00
e1b4220f8e
Merge "Guarantee that PAC Local Proxy owns Port" into klp-dev
Jason Monk   authored and   Android (Google) Code Review   commited 2013-09-13 20:31:54 +00:00
fddacc6045
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

Wink Saville   commited 2013-09-13 12:40:11 -07:00
e14346f8f4
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

Jason Monk   commited 2013-09-13 09:53:26 -04:00
0a9cc50662
Merge changes Ib1274847,I2eb2a1bf into klp-dev
* changes:
  Fix SDK build.
  Request all tethering interfaces, fix corruption.

Jeff Sharkey   authored and   Android (Google) Code Review   commited 2013-09-11 20:16:59 +00:00
6cb013235d
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

Yuhao Zheng   commited 2013-09-11 09:44:28 -07:00
239a3b22f1
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

Jeff Sharkey   commited 2013-09-10 21:03:30 -07:00
168cd72f76
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

Yuhao Zheng   commited 2013-09-10 09:57:12 -07:00
b77f15d90b
Merge "Tighten test for warm sim and add more debug." into klp-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2013-09-09 01:32:45 +00:00
f41860989a
Merge "Setting MTU size for specific network." into klp-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-09-06 22:42:10 +00:00
67e0bdf7cf
Merge "Minor fixes: Add a missing "break" and some cosmetic fixes." into klp-dev
Sreeram Ramachandran   authored and   Android (Google) Code Review   commited 2013-09-06 22:37:21 +00:00
cfc7c57504
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

sy.yun   authored and   Robert Greenwalt   commited 2013-09-06 15:26:19 -07:00
4aa73924fd
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

Wink Saville   commited 2013-09-06 09:54:24 -07:00
9685cd1d17
am 55c4f2aa: am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '55c4f2aa7a':
  Do not change NetworkInfo.DetailedState.

Wink Saville   authored and   Android Git Automerger   commited 2013-09-06 09:19:40 -07:00
1256d3e505
am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '50f864480d6e9cf9e4d83b4533e3764753b4d408':
  Do not change NetworkInfo.DetailedState.

Wink Saville   authored and   Android Git Automerger   commited 2013-09-06 09:17:19 -07:00
55c4f2aa7a
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

Wink Saville   commited 2013-09-05 12:02:25 -07:00
b1a3202e79
Merge "Rename LinkInfo to LinkQualityInfo" into klp-dev
Vinit Deshapnde   authored and   Android (Google) Code Review   commited 2013-09-05 17:50:19 +00:00
77dc937242
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

Vinit Deshapnde   commited 2013-09-04 14:11:24 -07:00
00d4b8a987
Merge commit 'a37f06d7' into manualmerge
* commit 'a37f06d7':
  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

Wink Saville   commited 2013-08-29 14:57:08 -07:00
cb117d31cb
am 8cb2f42e: am 9a1a7ef5: Add support for handling mobile provisioning networks.
* commit '8cb2f42eea2ef3b249528aa7913fc7a6dfc6b741':
  Add support for handling mobile provisioning networks.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-29 10:26:06 -07:00
a37f06d7d5
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

Wink Saville   commited 2013-08-29 08:55:16 -07:00
9a1a7ef57c
Minor fixes: Add a missing "break" and some cosmetic fixes.
Change-Id: Ie614a7b47185fd511fdc3f064620e46ab7d6d8f8

Sreeram Ramachandran   commited 2013-08-27 11:41:19 -07:00
1b5a3acb8b
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

Jason Monk   commited 2013-08-27 10:51:24 -04:00
01a790ad55
am 33283a97: am d23fa090: DO NOT MERGE: MDST is not ready until connected to DcTracker.
* commit '33283a9726a29b5a79d7885fe194d52c0ebe7450':
  DO NOT MERGE: MDST is not ready until connected to DcTracker.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-26 11:50:10 -07:00
daed2e2baa
am b42beeaf: am 54c5e169: In isMobileOk don\'t execute finally if mobile data is not supported.
* commit 'b42beeafcf8117fb4ac41dd91fc9e6113c0d6aae':
  In isMobileOk don't execute finally if mobile data is not supported.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-26 11:43:25 -07:00
85811798be
Merge "Introduce network link quality statistics" into klp-dev
Vinit Deshapnde   authored and   Android (Google) Code Review   commited 2013-08-22 16:16:45 +00:00
5b8b6751f3
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

Vinit Deshapnde   commited 2013-08-21 13:09:01 -07:00
30ad254a1e
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

Lorenzo Colitti   commited 2013-08-20 21:16:37 +09:00
09de418b17
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

Wink Saville   commited 2013-08-16 17:17:28 -07:00
d23fa090e9
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

Wink Saville   commited 2013-08-15 21:14:30 -07:00
54c5e16978
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

Wink Saville   commited 2013-08-13 12:41:06 -07:00
69e2de0a4e
am ead12e2f: am 02eab434: am f42ca169: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit 'ead12e2f40':
  If in a mobile captive portal is detected enable fail fast.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 17:10:34 -07:00
052f1b617b
am b3aae5de: am 55adb390: am 848b190c: Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
* commit 'b3aae5de90':
  Have CaptivePortalTracker use gservices updateable provisioning urls.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 17:10:32 -07:00
84c97feb16
am bcd5f33d: am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit 'bcd5f33d7e':
  Check that hipri has started.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 16:22:14 -07:00
04078a6b3c
am 02eab434: am f42ca169: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit '02eab434ad9faa25291e63023b7e66698ca457a8':
  If in a mobile captive portal is detected enable fail fast.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 15:46:55 -07:00
ead12e2f40
am 55adb390: am 848b190c: Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
* commit '55adb390bb96175db9abee3ead349a98b4dc4262':
  Have CaptivePortalTracker use gservices updateable provisioning urls.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 15:46:52 -07:00
b3aae5de90
am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit '9b6363e5e6d37e3e8d103751d81613eeca32bbbf':
  Check that hipri has started.

Wink Saville   authored and   Android Git Automerger   commited 2013-08-08 15:46:46 -07:00
bcd5f33d7e
Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2013-08-08 22:07:27 +00:00
f42ca16989
Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2013-08-08 22:06:21 +00:00
848b190c4f
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

Jason Monk   commited 2013-08-07 21:01:39 -04:00
a5bf2840cc
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

Wink Saville   commited 2013-08-07 16:22:47 -07:00
674777e622
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

Wink Saville   commited 2013-08-07 11:02:57 -07:00
15f129209d
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

Wink Saville   commited 2013-08-05 14:15:54 -07:00
8432cf4621
Merge "Add accessors for all addresses and clarify compare* methods"
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2013-08-01 06:44:29 +00:00
a721e2bb76
Fix excessive log spew.
Bug: 10115060
Change-Id: I61fd83071da1224f38757b8d90f58c8d6c41d36b

Wink Saville   commited 2013-07-31 15:49:04 -07:00
d28eef464a