Commit Graph

1001 Commits

Author SHA1 Message Date
Yuhao Zheng
b77f15d90b 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
f41860989a Merge "Tighten test for warm sim and add more debug." into klp-dev 2013-09-09 01:32:45 +00:00
Ying Wang
cb5620b2c4 Fix docs build.
Change-Id: I6fd0d711b2cc7726fdaa9119ee467ed6fab82de1
2013-09-06 22:53:16 -07:00
Robert Greenwalt
39dd04c648 Fix the build.
Change-Id: Ia5d29de9db7ea8fd467b3bde551a8cfb95877b41
2013-09-06 16:49:37 -07:00
Robert Greenwalt
67e0bdf7cf Merge "Setting MTU size for specific network." into klp-dev 2013-09-06 22:42:10 +00:00
Sreeram Ramachandran
cfc7c57504 Merge "Minor fixes: Add a missing "break" and some cosmetic fixes." into klp-dev 2013-09-06 22:37:21 +00:00
sy.yun
4aa73924fd 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
9685cd1d17 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
1256d3e505 am 55c4f2aa: am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '55c4f2aa7a0c6d765cf33e5e403365bc138fc025':
  Do not change NetworkInfo.DetailedState.
2013-09-06 09:19:40 -07:00
Wink Saville
55c4f2aa7a am 50f86448: am 59a9884b: Merge "Do not change NetworkInfo.DetailedState." into jb-mr2-dev
* commit '50f864480d6e9cf9e4d83b4533e3764753b4d408':
  Do not change NetworkInfo.DetailedState.
2013-09-06 09:17:19 -07:00
Lorenzo Colitti
a5642e48b0 Merge "Add a function to replace all the link addresses." into klp-dev 2013-09-05 23:03:24 +00:00
Wink Saville
b1a3202e79 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
77dc937242 Merge "Rename LinkInfo to LinkQualityInfo" into klp-dev 2013-09-05 17:50:19 +00:00
Lorenzo Colitti
174782b0fc Add a function to replace all the link addresses.
Bug: 10232006
Change-Id: I689ce4735999dac2ab5e1fae09d80b1f734292a1
2013-09-05 13:02:54 +09:00
Vinit Deshapnde
00d4b8a987 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
cb117d31cb 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
2013-08-29 14:57:08 -07:00
Wink Saville
a37f06d7d5 am 8cb2f42e: am 9a1a7ef5: Add support for handling mobile provisioning networks.
* commit '8cb2f42eea2ef3b249528aa7913fc7a6dfc6b741':
  Add support for handling mobile provisioning networks.
2013-08-29 10:26:06 -07:00
Wink Saville
9a1a7ef57c 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
Jason Monk
c711d7a5e9 Merge "Don't clear Global Proxy on boot." into klp-dev 2013-08-28 14:41:15 +00:00
Sreeram Ramachandran
1b5a3acb8b Minor fixes: Add a missing "break" and some cosmetic fixes.
Change-Id: Ie614a7b47185fd511fdc3f064620e46ab7d6d8f8
2013-08-27 11:41:19 -07:00
Jason Monk
01a790ad55 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
Lorenzo Colitti
79d505d075 Merge "Add a simple test for NetworkManagementService." into klp-dev 2013-08-27 04:08:54 +00:00
Wink Saville
381c91dac5 am daed2e2b: (-s ours) am 33283a97: am d23fa090: DO NOT MERGE: MDST is not ready until connected to DcTracker.
* commit 'daed2e2baaa6e29badd345dd79a02eaf903722d8':
  DO NOT MERGE: MDST is not ready until connected to DcTracker.
2013-08-26 11:53:14 -07:00
Wink Saville
daed2e2baa 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.
2013-08-26 11:50:10 -07:00
Wink Saville
23d32ca4b9 am 85811798: am b42beeaf: am 54c5e169: In isMobileOk don\'t execute finally if mobile data is not supported.
* commit '85811798bee8677fd5949d7ec21959c77bcbdf87':
  In isMobileOk don't execute finally if mobile data is not supported.
2013-08-26 11:46:29 -07:00
Wink Saville
85811798be 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.
2013-08-26 11:43:25 -07:00
Lorenzo Colitti
2337946b4f Add a simple test for NetworkManagementService.
For now, this only tests network observers. It works by starting
NetworkManagementService with a fake netd socket, feeding it
inputs, and seeing if the appropriate observer methods are
called.

Bug: 10232006
Change-Id: I827681575642a4ee13ae48b81272521544b676bd
2013-08-23 18:30:19 +09:00
Vinit Deshapnde
5b8b6751f3 Merge "Introduce network link quality statistics" into klp-dev 2013-08-22 16:16:45 +00:00
Vinit Deshapnde
30ad254a1e 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
09de418b17 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
Lorenzo Colitti
b48bb0801a Add a string constructor to LinkAddress.
This will allow us to do new LinkAddress("2001:db8::1/64").

Bug: 10232006
Change-Id: If479bdbab16826afe9d82732215141841c282299
2013-08-20 14:19:20 +09:00
Wink Saville
d23fa090e9 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
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
2013-08-15 21:14:30 -07:00
The Android Open Source Project
db5cb48920 am 754e0803: (-s ours) Reconcile with jb-mr2-release jb-mr2-zeroday-release jb-mr2-zeroday-deb-release - do not merge
* commit '754e08030d6c473485f0c331d4914bed0144b6e6':
  Use hostname verifier directly instead of instance DO NOT MERGE
  If in a mobile captive portal is detected enable fail fast.
  Have CaptivePortalTracker use gservices updateable provisioning urls.
  In CaptiviePortalTracker a socket timeout is probably a captive portal.
  Check that hipri has started.
  Fix issue #10226007: Reset apps restores most of the changed settings...
  Fix issue #10226007: Reset apps restores most of the changed settings...
2013-08-14 12:16:21 -07:00
The Android Open Source Project
754e08030d Reconcile with jb-mr2-release jb-mr2-zeroday-release jb-mr2-zeroday-deb-release - do not merge
Change-Id: I498651fc3fa9b021570780e8b8848a806c31962f
2013-08-14 12:09:27 -07:00
Wink Saville
69e2de0a4e 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
052f1b617b am ead12e2f: am 02eab434: am f42ca169: Merge "If in a mobile captive portal is detected enable fail fast." into jb-mr2-dev
* commit 'ead12e2f4004410c317c3c8c8d3829fbba5fd289':
  If in a mobile captive portal is detected enable fail fast.
2013-08-08 17:10:34 -07:00
Wink Saville
84c97feb16 am b3aae5de: am 55adb390: am 848b190c: Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev
* commit 'b3aae5de90baa0c5ccc3c3407943326f2d3357d9':
  Have CaptivePortalTracker use gservices updateable provisioning urls.
2013-08-08 17:10:32 -07:00
Wink Saville
11f99735ee 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-08 16:59:18 -07:00
Wink Saville
830e29b51b 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-08 16:59:07 -07:00
Wink Saville
bd53d843fa 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-08 16:58:43 -07:00
Wink Saville
04078a6b3c am bcd5f33d: am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit 'bcd5f33d7eea7c09fe727d61613429c0d49c2086':
  Check that hipri has started.
2013-08-08 16:22:14 -07:00
Wink Saville
ead12e2f40 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.
2013-08-08 15:46:55 -07:00
Wink Saville
b3aae5de90 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.
2013-08-08 15:46:52 -07:00
Wink Saville
bcd5f33d7e am 9b6363e5: am cbad1243: Merge "Check that hipri has started." into jb-mr2-dev
* commit '9b6363e5e6d37e3e8d103751d81613eeca32bbbf':
  Check that hipri has started.
2013-08-08 15:46:46 -07:00
Wink Saville
f42ca16989 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
848b190c4f Merge "Have CaptivePortalTracker use gservices updateable provisioning urls." into jb-mr2-dev 2013-08-08 22:06:21 +00:00
Vinit Deshapnde
e0fac27d4d Use a single socket to communicate with supplicant
This helps to prepare for future updates from external sources.

Bug: 9298955

Change-Id: I4c63ad5fc1ea3564aab38cfce955de19bad75c0c
(cherry picked from commit fb40801ed8c217ae01082fb1cbd0c30bbf5532ac)
2013-08-08 18:38:53 +00:00
Lorenzo Colitti
ac30f4205e Merge "Simplify LinkPropertiesTest." 2013-08-08 02:54:29 +00:00
Lorenzo Colitti
a2dc69a893 Simplify LinkPropertiesTest.
Instead of converting IP addresses to strings throughout the
test, do so once at the beginning.

Change-Id: I7f0dae5d2e9e2cdc6ec808e2cf71197ba6ade0a4
2013-08-08 11:03:46 +09:00