Commit Graph

1804 Commits

Author SHA1 Message Date
Lorenzo Colitti
2af6f557df Add two utility methods for IPv4 netmasks.
1. Add a validating method to convert a netmask to a prefix length.
2. Add a function to get the implicit netmask of an IPv4 address.
3. Add a unit test.

Bug: 19704592
Change-Id: Icb9f58d3903ea01df9e3720383c9bd5db6dd8f26
2015-03-20 16:32:34 +09:00
Alan Viverette
501ecd6dac Replace usages of deprecated Resources.getColor() and getColorStateList()
Change-Id: I8f64fe6c4c44a92ff6d07250223ba590a1d691b0
2015-03-18 18:37:18 -07:00
Erik Kline
94500b2aae Fix missing printf argument.
Change-Id: Ifd1eebfbcefa06570882da54a1c410eabf26bce7
2015-03-18 08:08:57 +09:00
Vinit Deshpande
8d1c3be573 am "Refactor NetworkUtils interaction with DHCP."
merged from goog/mirror-m-wireless-internal-release
9def7be Refactor NetworkUtils interaction with DHCP.
2015-03-15 13:40:27 -07:00
Lorenzo Colitti
6f7cccbc71 am 4a61eaf7: am 342a2a9a: Merge "Fix build, broken by https://android-review.googlesource.com/#/c/115890/"
* commit '4a61eaf784fb085e66a21e9e4d4fa8aeb6b41c2b':
  Fix build, broken by https://android-review.googlesource.com/#/c/115890/
2015-03-13 07:07:54 +00:00
Andreas Gampe
8679a46283 resolved conflicts for merge of b6b9fe21 to master
Change-Id: If4f62aa1fd8bb774288a677e7008e86a7e3ea6d9
2015-03-13 00:04:10 -07:00
Wenchao Tong
e164e0063b NetworkStatsService to adjust VPN stats before recording.
* Creates a new Parcelable class VpnInfo to hold required
  parameters for VPN stats adjustments.
* ConnectivityService to collect infomation and provide
  a list of VpnInfo, one for each user.
* NetworkStatsService passes the VpnInfo array to
  NetworkStatsRecorder.
* NetworkStatsRecorder calls NetworkStats.migrateTun()
  to do the math.
* Poll NetworkStats when the vpn application calls
  setUnderlyingNetworks().

Bug: 19536273
Change-Id: I7a4c7726b8243fead10416f7ec6eb5cf95f20183
2015-03-12 17:43:41 -07:00
Wenchao Tong
79ec5b8656 Merge "NetworkStats to support VPN accounting." 2015-03-12 22:10:56 +00:00
Lorenzo Colitti
342a2a9a6c Merge "Fix build, broken by https://android-review.googlesource.com/#/c/115890/" 2015-03-12 07:49:23 +00:00
Lorenzo Colitti
a897c84357 Fix build, broken by https://android-review.googlesource.com/#/c/115890/
Change-Id: Ieafa2fb0a7f539d8f933ad9c98e3be80457da6e5
2015-03-12 16:48:12 +09:00
Paul Jensen
9edb1fc511 Remove dead code, mostly DataStateTracker.
Change-Id: I1433937bffdb29bd42fb1adbfcf0a50ceffac7dd
2015-03-11 10:03:58 -04:00
Wenchao Tong
7352b6df64 NetworkStats to support VPN accounting.
Create a new method to migrate underlying network traffic
from VPN app to other apps.

Bug: 19536273
Change-Id: I3434cad361592e26b01225edf8012f7b16afc98f
2015-03-09 11:38:10 -07:00
Erik Kline
9def7be67d Refactor NetworkUtils interaction with DHCP.
Separate out starting DHCP (DISCOVER) and RENEW operations from fetching
the results.  Add NetworkUtils.getDhcpResults(), to enable quick checks
of any available DhcpResults without extraneous interaction with the
DHCP daemon.

Bug: 19422416
Change-Id: I58808e529dda8429737e749f5caef56d923c0809
2015-03-02 12:35:35 +09:00
John Spurlock
c3c163f3f4 Remove unused imports in frameworks/base.
Change-Id: I031443de83f93eb57a98863001826671b18f3b17
2015-02-28 14:47:49 -05:00
Narayan Kamath
3473245e45 Merge "Move apache specific portions of android.net.http to external/apache-http." 2015-02-13 09:51:44 +00:00
Jeremy Joslin
472032a647 Merge branch 'master' of https://googleplex-android.googlesource.com/_direct/platform/frameworks/base 2015-02-12 19:40:58 +00:00
Jeremy Joslin
3aee237f28 am 0992f962: am 1267462c: am f456d4dc: am d4d604e2: Merge "Update Javadoc for EXTRA_NETWORK." into lmp-mr1-dev
* commit '0992f962468e28bd6798581cb768dc7226dcdfb4':
  Update Javadoc for EXTRA_NETWORK.
2015-02-12 19:40:48 +00:00
Jeremy Joslin
3337a69ecc am 1267462c: am f456d4dc: am d4d604e2: Merge "Update Javadoc for EXTRA_NETWORK." into lmp-mr1-dev
automerge: 0992f96

* commit '0992f962468e28bd6798581cb768dc7226dcdfb4':
  Update Javadoc for EXTRA_NETWORK.
2015-02-12 19:39:20 +00:00
Jeremy Joslin
0992f96246 am 1267462c: am f456d4dc: am d4d604e2: Merge "Update Javadoc for EXTRA_NETWORK." into lmp-mr1-dev
* commit '1267462c0bf8ef5a0cfaca535847fc962b2cf32e':
  Update Javadoc for EXTRA_NETWORK.
2015-02-12 18:56:35 +00:00
Jeremy Joslin
d4d604e238 Merge "Update Javadoc for EXTRA_NETWORK." into lmp-mr1-dev 2015-02-12 18:34:03 +00:00
Narayan Kamath
9a87ca5691 Move apache specific portions of android.net.http to external/apache-http.
We continue to compile external/apache-http into ext.jar. This contains
a few changes apart fom the classes moving around :

- Makefile changes to build docs and api-stubs for now. A future change
  will revert these changes and remove these classes from stubs and
  docs.
- Hardcode event IDs in legacyerrorstrings to avoid a dependency between
  the frameworks and apache. These strings are on their way out and will
  never change anyway.
- Remove imports due to {@link} tags and use {@code} instead.
- Remove an accidental(?) dependency on apache commons code that's a
  part of apache-http.

bug: 18027885

Change-Id: I51cd038d846ec7d02c283a4541b10a6a9cf62ecf
2015-02-12 11:15:49 +00:00
Lorenzo Colitti
30ef72dc6b am b0dfaad8: am f99551d8: am c7ccc393: Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev
automerge: 1c4b299

* commit '1c4b29971c2ef7e44a6933963a7ce3ac1e43febe':
  Make reportInetCondition revalidate if the report differs from our state
2015-02-12 07:51:11 +00:00
Lorenzo Colitti
1c4b29971c am b0dfaad8: am f99551d8: am c7ccc393: Merge "Make reportInetCondition revalidate if the report differs from our state" into lmp-mr1-dev
* commit 'b0dfaad8c2a02c33885e6a278c7901da69d8ab49':
  Make reportInetCondition revalidate if the report differs from our state
2015-02-12 03:09:57 +00:00
Jeremy Joslin
c53026391a Update Javadoc for EXTRA_NETWORK.
Bug: 19352840
Change-Id: Ib668bee0fb2c6f5bcd01a7908ebd20b9ec8a40ef
2015-02-11 18:28:57 -08:00
Lorenzo Colitti
2dd68f1324 am ac0bc4ad: Merge "Make getNetworkInfo() take into account VPN underlying networks." into lmp-mr1-dev automerge: c38b90b automerge: 00c8450
* commit 'ac0bc4ad5f53a659928666fc9accec7bddf173e8':
  Make getNetworkInfo() take into account VPN underlying networks.
2015-02-11 07:40:08 +00:00
Lorenzo Colitti
ac0bc4ad5f Merge "Make getNetworkInfo() take into account VPN underlying networks." into lmp-mr1-dev automerge: c38b90b
automerge: 00c8450

* commit '00c8450d2711de57ee45f66cae1050dbca98d1f5':
  Make getNetworkInfo() take into account VPN underlying networks.
2015-02-11 07:32:53 +00:00
Lorenzo Colitti
4e858cbafa Make reportInetCondition revalidate if the report differs from our state
1. If reportInetCondition says the network is not working, and
   the network is already marked not validated, don't revalidate
   it. This was superfluous and should save battery.
2. If reportInetCondition says the network is working, and the
   network is not marked as validated, revalidated. This will
   allow us to get out of a validated state quickly based on app
   input (e.g., allowing GCM's exponential backoff timer to drive
   revalidation instead of our 10-minute timer).

Bug: 19258761
Bug: 19209043
Change-Id: Iaa4bac82d117ed1f4088dab106e6f6ce46b34bc3
2015-02-11 11:03:50 +09:00
Lorenzo Colitti
489eb043d7 Make getNetworkInfo() take into account VPN underlying networks.
If a user is subject to a VPN, getActiveNetworkInfo() will return
the VPN's underlying network (e.g., TYPE_WIFI), so that apps that
call getActiveNetworkInfo to answer questions like "is the device
connected to wifi?" will continue to work. Make getNetworkInfo
do this as well: if the query is for a network type that is
underlying the current user's VPN, then return that network.

Bug: 19196545
Change-Id: Ic5a651735b927c758594a26d26a03fbd704b52e6
2015-02-11 10:21:01 +09:00
Lorenzo Colitti
c901766a37 am 9fa0471a: am 12b26c12: am 21702263: Merge "Add a unit test for StaticIpConfiguration."
* commit '9fa0471a1577ef3008575a01bb84cbc8fad5138f':
  Add a unit test for StaticIpConfiguration.
2015-02-05 02:41:31 +00:00
Lorenzo Colitti
9fa0471a15 am 12b26c12: am 21702263: Merge "Add a unit test for StaticIpConfiguration."
* commit '12b26c12483633f7a75d1f1c9ead73eaf6056811':
  Add a unit test for StaticIpConfiguration.
2015-02-05 02:31:40 +00:00
Lorenzo Colitti
003133f82d Add a unit test for StaticIpConfiguration.
Change-Id: I68c735def8a242da0c8f95b7c5ea680ed902dab7
2015-02-04 17:28:35 +09:00
Lorenzo Colitti
d2147882c6 Merge "Also include the domain when parceling StaticIpConfiguration." automerge: c40bd27 automerge: 5b392ee
automerge: 792622f

* commit '792622f75408a475870c7ace2c15b60bff53f974':
  Also include the domain when parceling StaticIpConfiguration.
2015-01-30 15:59:49 +00:00
Lorenzo Colitti
42c7ff127e Merge "Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()" automerge: c0e636a automerge: 786deba
automerge: bac1485

* commit 'bac14852ef54d17bbef04f1eb2cc03a540fee0a1':
  Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()
2015-01-30 15:58:39 +00:00
Lorenzo Colitti
792622f754 Merge "Also include the domain when parceling StaticIpConfiguration." automerge: c40bd27
automerge: 5b392ee

* commit '5b392ee7584688d6929ca40760d0df2a12bd0b16':
  Also include the domain when parceling StaticIpConfiguration.
2015-01-30 15:56:00 +00:00
Lorenzo Colitti
bac14852ef Merge "Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()" automerge: c0e636a
automerge: 786deba

* commit '786deba636618fcf530e42340b0e5d683c5af74c':
  Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()
2015-01-30 15:54:45 +00:00
Lorenzo Colitti
c40bd27e25 Merge "Also include the domain when parceling StaticIpConfiguration." 2015-01-30 07:07:49 +00:00
Lorenzo Colitti
c0e636aae7 Merge "Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()" 2015-01-30 07:00:38 +00:00
Lorenzo Colitti
68a1a34ec0 Also include the domain when parceling StaticIpConfiguration.
StaticIpConfiguration objects are parceled at least as part of the
IpConfiguration objects that are passed to IEthernetManager when an
application sets static IP configuration on Ethernet.

Change-Id: I49991e2f591cc6cf01b503c18eb343b5929efe29
2015-01-29 12:20:55 +00:00
Lorenzo Colitti
a8a5ea3416 Merge "Support connecting to networks with misconfigured subnet masks." automerge: bd01ceb automerge: fb69689
automerge: 4137d5f

* commit '4137d5fd3ec8bd1dfb898fd92307db81c3648b3c':
  Support connecting to networks with misconfigured subnet masks.
2015-01-29 08:46:07 +00:00
Lorenzo Colitti
4137d5fd3e Merge "Support connecting to networks with misconfigured subnet masks." automerge: bd01ceb
automerge: fb69689

* commit 'fb696894ee24ffee3135f4bc460afa84f23efaeb':
  Support connecting to networks with misconfigured subnet masks.
2015-01-29 08:42:18 +00:00
Lorenzo Colitti
bd01cebdd4 Merge "Support connecting to networks with misconfigured subnet masks." 2015-01-29 08:35:36 +00:00
Paul Jensen
99366a8aa4 Fix DhcpResults.setDomain() and StaticIpConfiguration.toLinkProperties()
setDomain() and toLinkProperties() were not setting the domains.
The setDomain() bug affected Wifi and I believe the toLinkProperties()
bug affected Ethernet and Bluetooth reverse-tethering.

(cherry picked from commit c53113b37f33c7ed19660c8ec5bfd578e8bb5409)

bug:18252947
Change-Id: I6235fcd6b875aee516efbb5f880db1a99380355b
2015-01-29 17:12:35 +09:00
Lorenzo Colitti
c915d4c83d Support connecting to networks with misconfigured subnet masks.
In K and earlier, we would connect to a network where the gateway
was not covered by the subnet mask of the IP address. This is an
invalid configuration, but it used to work, and other OSes appear
to accept it too, so support it.

Bug: 19067207

(cherry picked from commit 2dfb79a54adeb4bcf1f62332a9db467fce302ced)

Change-Id: I80088f291466dbd5a47f360dcc1620acee5cf57e
2015-01-28 20:36:37 +09:00
Lorenzo Colitti
6c1da05211 am 50f9d93a: am 68c9c5aa: Merge "Support connecting to networks with misconfigured subnet masks." into lmp-mr1-dev
automerge: 7325a9d

* commit '7325a9da748e0d02301a071ec73bcc33acf79d7f':
  Support connecting to networks with misconfigured subnet masks.
2015-01-23 13:05:26 +00:00
Lorenzo Colitti
7325a9da74 am 50f9d93a: am 68c9c5aa: Merge "Support connecting to networks with misconfigured subnet masks." into lmp-mr1-dev
* commit '50f9d93a1c6f3d9f28966dd61997b4b780f31fb2':
  Support connecting to networks with misconfigured subnet masks.
2015-01-23 13:01:42 +00:00
Lorenzo Colitti
68c9c5aaff Merge "Support connecting to networks with misconfigured subnet masks." into lmp-mr1-dev 2015-01-23 12:50:32 +00:00
Lorenzo Colitti
64f1689c81 Support connecting to networks with misconfigured subnet masks.
In K and earlier, we would connect to a network where the gateway
was not covered by the subnet mask of the IP address. This is an
invalid configuration, but it used to work, and other OSes appear
to accept it too, so support it.

Bug: 19067207
Change-Id: I822e1d754b336691b675438eefa959a3d75fd07b
2015-01-23 21:10:34 +09:00
Erik Kline
2530cf6f9f Merge "Log interface name and uid when filtering a blocked network." into lmp-mr1-dev automerge: 3891c36 automerge: 4f36150
automerge: e806ea0

* commit 'e806ea09db2b1c62fa1bf6a58b1a0444b39bb1c0':
  Log interface name and uid when filtering a blocked network.
2015-01-22 07:22:19 +00:00
Erik Kline
e806ea09db Merge "Log interface name and uid when filtering a blocked network." into lmp-mr1-dev automerge: 3891c36
automerge: 4f36150

* commit '4f3615036db441c4a099dc789ebcdf641ac5a987':
  Log interface name and uid when filtering a blocked network.
2015-01-22 07:18:00 +00:00
Erik Kline
3891c36428 Merge "Log interface name and uid when filtering a blocked network." into lmp-mr1-dev 2015-01-22 07:07:36 +00:00