Commit Graph

784 Commits

Author SHA1 Message Date
Paul Jensen
6fabfa0e32 Deprecate EXTRA_PROXY_INFO and unhide ConnectivityManager.getDefaultProxy().
1. Unhide ConnectivityManager.getDefaultProxy() and update it to
   take into account process-bound-Networks.
2. Deprecate EXTRA_PROXY_INFO and instead encourage querying via
   getDefaultProxy().

Bug: 17905627
Bug: 17420465
Bug: 18144582

Change-Id: I45358ee82fe705d048022c8238b2452f52c37b88
2015-04-03 07:25:55 -04:00
Paul Jensen
ee2f45d85f Deprecate static ConnectivityManager.get/setProcessDefaultNetwork() functions.
These functions risk hitting an unchecked Exception due to ConnectivityManager
not being instantiated yet.  Also, change Network.openConnection() to throw a
checked Exception rather than an unchecked Exception when ConnectivityManager
is not yet instantiated.

bug:19416463
Change-Id: Ie1e2b3238aec0343d267c76b64927073f2f05f85
2015-04-02 14:03:43 +00:00
Stuart Scott
0f835acb91 Move reset network settings into framework.
bug: 16161518
Change-Id: Ic3b537ebd09d1b9723feff9dcc96e20fda05a94f
2015-03-30 18:02:55 -07:00
Wenchao Tong
fdf2267b50 Keep debug information in NetworkStats files
Create two special SETs.

SET_DBG_VPN_IN is used by individual applications to know
how much traffic of the NetworkIdentity was actually moved
from a VPN app.
SET_DBG_VPN_OUT is used by the VPN app to know how much
traffic of the NetworkIdentity was deducted.

A debug application can restore the raw stats by these
entries.
  raw_traffic = recorded_entry (TAG_NONE, SET_ALL)
              + recorded_entry (TAG_NONE, SET_DBF_VPN_OUT)
              - recorded_entry (TAG_NONE, SET_DBF_VPN_IN)

The two debug SETs are not returned by
NetworkStatsService.openSession(). These debug entries are
retrieved by NetworkStatsCollection.dump().

Bug: 19536273
Change-Id: I03ef9f7667f5f2f48cbe3f6b11447fe7ead8ad3b
2015-03-27 13:49:13 -07:00
Prerepa Viswanadham
5d4c045bcf Merge remote-tracking branch 'goog/mirror-m-wireless-internal-release' into master_merge
Change-Id: I49aab437af220f1139cfd2d0a9c362acce31074e
2015-03-24 13:46:08 -07:00
Paul Jensen
703642c635 Merge "Make NetworkCapabilities.NOT_VPN javadoc visible." into m-wireless-dev 2015-03-20 11:27:18 +00:00
Lorenzo Colitti
ddf811b950 Add a protectFromVpn method that takes a FileDescriptor
Bug: 19704592
Change-Id: I9aeb29c2f6cf55fa010bc606c99b21a797ac5a19
2015-03-20 16:32:40 +09:00
Lorenzo Colitti
06b991f444 DHCP: Add a native method for making a DHCP socket.
Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be
2015-03-20 16:32:35 +09:00
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
Paul Jensen
8357dfd520 Remove dead code, mostly DataStateTracker.
(cherry picked from AOSP commit 9edb1fc511)

Change-Id: I18c44cd08dfb51e02a96d0b726e9af1db21e3058
2015-03-18 12:29:13 -04:00
Paul Jensen
ba9c42f661 Make NetworkCapabilities.NOT_VPN javadoc visible.
Also adjust wording to be more suitable for NetworkRequests and NetworkAgents.

Change-Id: I1cc93cb20779cf02d6ffa0fa11ad2916c199b365
2015-03-18 09:33:07 -04:00
Erik Kline
5ccaadee2e Merge "Fix missing printf argument." into m-wireless-dev 2015-03-18 00:18:41 +00:00
Erik Kline
d687dc5da9 Fix missing printf argument.
Change-Id: Ifd1eebfbcefa06570882da54a1c410eabf26bce7
2015-03-18 08:41:42 +09:00
Erik Kline
94500b2aae Fix missing printf argument.
Change-Id: Ifd1eebfbcefa06570882da54a1c410eabf26bce7
2015-03-18 08:08:57 +09:00
Lorenzo Colitti
b85f0b44a7 Add a protectFromVpn method that takes a FileDescriptor
Bug: 19704592
Change-Id: I9aeb29c2f6cf55fa010bc606c99b21a797ac5a19
2015-03-17 19:46:12 +09:00
Lorenzo Colitti
1271037d00 Merge changes from topic 'dhcpclient' into m-wireless-dev
* changes:
  DHCP: Minor cleanups to the packet code.
  DHCP: Move the packet code to frameworks/base/services.
  DHCP: Add a native method for making a DHCP socket.
  DHCP: Add a superclass for DhcpStateMachine.
2015-03-16 12:12:42 +00:00
Lorenzo Colitti
0210a8c5d9 Merge "Add two utility methods for IPv4 netmasks." into m-wireless-dev 2015-03-16 12:11:37 +00:00
Lorenzo Colitti
c70fbac892 DHCP: Add a native method for making a DHCP socket.
Bug: 19704592
Change-Id: Iadd60d39c93aaabd2917e76791101a7d313b34be
2015-03-16 20:08:45 +09:00
Lorenzo Colitti
e82e0f0a8c 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-16 16:07:36 +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
Paul Jensen
051135c956 Fix javadoc braces for ConnectivityManager.EXTRA_NETWORK.
Change-Id: I5ad30a34f96e9e99a557b5bae9a30bfc08c89620
2015-03-13 14:06:12 -04: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
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
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
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
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
Jeremy Joslin
c53026391a Update Javadoc for EXTRA_NETWORK.
Bug: 19352840
Change-Id: Ib668bee0fb2c6f5bcd01a7908ebd20b9ec8a40ef
2015-02-11 18:28:57 -08: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
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
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
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
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
Neil Fuller
7141623597 am 1c60d120: resolved conflicts for merge of 7382c02d to lmp-mr1-dev-plus-aosp
* commit '1c60d1208fa91abb8b69c3cd619ae400ebd1ca8b':
  Changes associated with an OkHttp upgrade
2015-01-20 13:29:31 +00:00
Neil Fuller
1c60d1208f resolved conflicts for merge of 7382c02d to lmp-mr1-dev-plus-aosp
Change-Id: Idfa2750230aa56e7ae34fcc33d62558df942abd0
2015-01-20 13:21:58 +00:00
Neil Fuller
c30362d9cf Changes associated with an OkHttp upgrade
Change-Id: I2a4db602aa7ffdef886e0f1a955715a2551a87a5
2015-01-20 11:59:24 +00:00
Paul Jensen
a18ea556e9 am 81af1e4f: am 6c93739f: am 49f74a38: Clear process DNS NetID binding when expiring or releaseing legacy requests.
* commit '81af1e4f390a4aedb49c1405f3ea8e1b27fadbfa':
  Clear process DNS NetID binding when expiring or releaseing legacy requests.
2015-01-06 20:09:18 +00:00
Paul Jensen
81af1e4f39 am 6c93739f: am 49f74a38: Clear process DNS NetID binding when expiring or releaseing legacy requests.
* commit '6c93739f2f25c8afb77997165fa86be537df67a9':
  Clear process DNS NetID binding when expiring or releaseing legacy requests.
2015-01-06 14:57:44 +00:00
Paul Jensen
49f74a382b Clear process DNS NetID binding when expiring or releaseing legacy requests.
When requests made by ConnectivityManager.startUsingNetworkFeature() are
expired or are canceled via ConnectivityManager.stopUsingNetworkFeature(),
we must remember to clear the binding of DNS requests from the calling
process to the Network satisfying the request.

bug:18778725
Change-Id: I800c808ac6486000241b5d263aa79a1192a9fe9e
2015-01-06 09:43:04 -05:00