Commit graph android_packages_modules_Co.../services/java/com/android/server/ConnectivityService.java
Message SHA1
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
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
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
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
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
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
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
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

Lorenzo Colitti   commited 2013-08-01 00:21:24 +09:00
e1b4742442
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

Wink Saville   commited 2013-07-29 15:02:29 -07:00
512c2204b1
Merge "Remove unused mDnsOverridden"
Geremy Condra   authored and   Android (Google) Code Review   commited 2013-07-26 17:48:54 +00:00
1fea7c4bdd
Remove unused mDnsOverridden
mDnsOverridden is no longer used now that VPNs do not override the
default DNS settings.

Change-Id: I69495b9a6de7d60628813f357d3dbdf548695ada

Chad Brubaker   commited 2013-07-23 17:49:37 -07:00
5fdc14656c
Merge "Fix default DNS not being set on network changes"
Geremy Condra   authored and   Android (Google) Code Review   commited 2013-07-24 00:32:34 +00:00
63ac2f7d54
Fix default DNS not being set on network changes
Change-Id: I3c45404cab34c77b20dadc1d8aee127aa08fd0bd

Chad Brubaker   commited 2013-07-23 17:13:36 -07:00
73652d07b8
Merge "Fix supplimentary network connections with VPNs"
Geremy Condra   authored and   Android (Google) Code Review   commited 2013-07-23 17:58:33 +00:00
3092b8e931
Merge "Support multiple Vpn ManageDialogs"
Geremy Condra   authored and   Android (Google) Code Review   commited 2013-07-23 17:55:45 +00:00
50e914ff34
Fix supplimentary network connections with VPNs
Enables the use of supplimentary mobile networks like MMS, and HIPRI
while VPNs are running.

Change-Id: I313f57a905b4e16bd4322c68687cbff1cfbe9d3e

Chad Brubaker   commited 2013-07-19 15:57:05 -07:00
49db422100
resolved conflicts for merge of eb98d8f6 to master
Change-Id: Ia9509ab6897e27da8bf4fc61a4140f2f93acb80f

Robert Greenwalt   commited 2013-07-19 14:30:49 -07:00
f68291a419
resolved conflicts for merge of 22069565 to master
Change-Id: Idd0ad9b1504fddf68c4c4cc04731de1eddd204b3

Robert Greenwalt   commited 2013-07-19 14:09:30 -07:00
8636128e2c
am 790ac470: am df43ba82: am e3badc10: Merge "When a SIM is changed check mobile provisioning." into jb-mr2-dev
* commit '790ac470fe':
  When a SIM is changed check mobile provisioning.

Wink Saville   authored and   Android Git Automerger   commited 2013-07-19 13:42:36 -07:00
5ada2f6941
checkMobileProvisioning is not using sendNotification.
Change-Id: Ie5b98b462b29fe9339fcb8207d2d33e3028a155c

Wink Saville   commited 2013-07-19 09:27:56 -07:00
99fedebaa1
Make CS.isTetheringSupported dynamic
It used to be set at boot, but that was too quick to pick up carrier
specific resources.  With this change even if you switch sims subequent
checks get the new values.

bug:9865616
Change-Id: I8c270c6b02fc6bdd3c3d76ceea58172df25e058d

Robert Greenwalt   commited 2013-07-18 14:24:42 -07:00
368095f658
Merge "Add gservices updater for carrier provisioning url" into jb-mr2-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-07-17 23:46:25 +00:00
1497d4854d
Add gservices updater for carrier provisioning url
bug:9623159
Change-Id: I36697ed341353b7a3dbec5afe20241102e76f6f1

Robert Greenwalt   commited 2013-07-17 14:05:33 -07:00
39d560174e
Support multiple Vpn ManageDialogs
Move away from storing the configs in the Intent to prevent issues with
PendingIntents and multiple configs.

The Dialog now queries ConnectivityService for the configuration to
display in the management dialog.

Change-Id: I0e0ef52db840152914d117a24f776d8106e836ff

Chad Brubaker   commited 2013-07-16 18:59:12 -07:00
94f3c8c66d
When a SIM is changed check mobile provisioning.
A simple mechanism for doing this is to take advantage of the fact
that we require the device to reboot after a sim has been changed.
Thus when connectivity service is started we wait to get a connection
then call checkMobileProvisioning once. We also add a check that
the DEVICE_PROVISIONED is true, i.e. SetupWizard has been run.

Bug: 9784024
Change-Id: I5c1936744f6fc55a447ae44cd36eec3849d27e21

Wink Saville   commited 2013-07-16 17:16:37 -07:00
f0e9c7fc7f
Support routing sockets as another user
Add support for routing sockets as if they were another user's.
This is for services that handle delegated network tasks like MediaServer and DownloadManager.

Change-Id: Id20efc1f5c2cce6f8838d777762f6c0a703a9437

Chad Brubaker   commited 2013-07-15 12:14:10 -07:00
11f2225c3d
Add per user VPN support
VPNs are now per user instead of global. A VPN set by user A routes only
user A's traffic and no other user can access it.

Change-Id: Ia66463637b6bd088b05768076a1db897fe95c46c

Chad Brubaker   commited 2013-07-12 20:51:03 -07:00
b7652cde9d
am ef942e8a: am 42a85412: am 925ec03f: Merge "VZW wants the phoneNumber to be 10 zero\'s if there isn\'t one." into jb-mr2-dev
* commit 'ef942e8a55':
  VZW wants the phoneNumber to be 10 zero's if there isn't one.

Wink Saville   authored and   Android Git Automerger   commited 2013-07-12 12:14:01 -07:00
a77b479408
VZW wants the phoneNumber to be 10 zero's if there isn't one.
Bug: 9784059
Change-Id: I41bba908855648d2560440655d8a75a7cb2e0859

Wink Saville   commited 2013-07-10 23:00:07 -07:00
c118d7efab
am 6152916c: am db011499: am 753d754c: Merge "Fix NPE if mobile is not supported in checkMobileProvisioning." into jb-mr2-dev
* commit '6152916c45':
  Fix  NPE if mobile is not supported in checkMobileProvisioning.

Wink Saville   authored and   Android Git Automerger   commited 2013-07-02 12:41:31 -07:00
b0a3f08942
Fix NPE if mobile is not supported in checkMobileProvisioning.
Bug: 9664438
Change-Id: If0c4938956a80e8d6a21a968aa771d0d8f546b3c

Wink Saville   commited 2013-07-02 10:55:14 -07:00
d469c47d5b
Merge commit '3463b3ff' into fix-merge-conflict
* commit '3463b3ff':
  Add checkMobileProvisioning to ConnectivityService.

Conflicts:
	services/java/com/android/server/ConnectivityService.java

Change-Id: Ieceb9c8f4aa4fa99258e56a720b4c74512369458

Wink Saville   commited 2013-07-01 16:12:31 -07:00
0cc0a44c2f