Commit Graph

1176 Commits

Author SHA1 Message Date
Robert Greenwalt
dfdaa016bf Merge "Only apply tcp buffer sizes for default net" 2014-03-04 17:20:18 +00:00
Robert Greenwalt
9f25cdc323 Only apply tcp buffer sizes for default net
This may mean that secondary networks have bad network settings,
but currently default settings are overriden by secondary nets
which seems worse.

bug:13211589
Change-Id: I3ef1a17ccde05306d786729c4369a31f78b2ebcf
2014-03-03 10:26:11 -08:00
Dianne Hackborn
b4b09e8a97 Hold a wake lock while dispatching network activity events.
Also add new API for determining whether the current data network
is active, and thus better scheduling network operations.  This
API is designed to not be tied to a mobile network -- regardless
of the network, apps can use it to determine whether they should
initiate activity or wait.  On non-mobile networks, it simply always
reports as the network being active.

This changed involved reworking how the idle timers are done so
that we only register an idle timer with the current default
network.  This way, we can know whether we currently expect to
get callbacks about the network being active, or should just always
report that it is active.  (Ultimately we need to be getting this
radio active data from the radio itself.)

Change-Id: Iaf6cc91a960d7542a70b72f87a7db26d12c4ea8e
2014-02-28 15:19:39 -08:00
Chad Brubaker
7b0eca3a7d Merge "Remove SO_BINDTODEVICE from VPN protect" 2014-02-28 19:28:45 +00:00
Robert Greenwalt
9a2ef0b576 am 8395aadb: (-s ours) am 860ac9e4: am 94d5c80a: am 635097ff: am cf73f46a: am df3b5e5b: am 3c73a8e8: (-s ours) am ca4ba835: am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit '8395aadbd3b2a11fac664f44c590576141c78615':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 18:36:45 +00:00
Robert Greenwalt
94d5c80a2b am 635097ff: am cf73f46a: am df3b5e5b: am 3c73a8e8: (-s ours) am ca4ba835: am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit '635097ffe64d673a69113f3f33f804223a145b44':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 18:25:11 +00:00
Robert Greenwalt
635097ffe6 am cf73f46a: am df3b5e5b: am 3c73a8e8: (-s ours) am ca4ba835: am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit 'cf73f46a514f5c2b1a0de137ed203401417307b4':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 18:21:50 +00:00
Robert Greenwalt
df3b5e5bda am 3c73a8e8: (-s ours) am ca4ba835: am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit '3c73a8e87a43b6c7159f0b531948dae8b3686dfa':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 18:14:26 +00:00
Robert Greenwalt
3c73a8e87a am ca4ba835: am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit 'ca4ba835742e7131e1ae7a4a18f3989a1e96d9ed':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 10:12:35 -08:00
Robert Greenwalt
ca4ba83574 am 41708e1c: DO NOT MERGE Sanitize WifiConfigs
* commit '41708e1c6e4bbea0bd8b240ee6fdf7e305b6d6db':
  DO NOT MERGE Sanitize WifiConfigs
2014-02-25 10:09:13 -08:00
Robert Greenwalt
41708e1c6e DO NOT MERGE Sanitize WifiConfigs
Do this both on input from apps (giving error) and between wifi and
ConnectivityService (ignoring bad data).  This means removing all
addresses beyond the first and all routes but the first default and
the implied direct-connect routes.

We do this because the user can't monitor the others (no UI), their
support wasn't intended, they allow redirection of all traffic
without user knowledge and they allow circumvention of legacy VPNs.

This should not move forward from JB as it breaks IPv6 and K has
a more resilient VPN.

Bug:12663469
Change-Id: I0d92db7efc30a1bb3e5b8c6e5595bdb9793a16f2

Conflicts:
	core/java/android/net/LinkProperties.java
	services/java/com/android/server/WifiService.java
	wifi/java/android/net/wifi/WifiStateMachine.java
2014-02-24 15:20:32 -08:00
Jake Hamby
19ab991213 Remove unneeded new RIL command.
Remove the recently added RIL_REQUEST_SET_RADIO_MODE command and update
the definition of the RIL_REQUEST_NV_RESET_CONFIG parameter.
Also remove some accidentally added debug log lines.

Bug: 12864208
Change-Id: I6f035d6900c9fcb1427bad62057d7b4a1d3cd99c
2014-02-24 11:42:51 -08:00
Chad Brubaker
c92e61c782 Merge "Only allow System apps to make VPN exempt routes" 2014-02-24 18:09:56 +00:00
Chad Brubaker
f6c68ca61a Merge "Add the calling package name to requestRouteToHost" 2014-02-24 18:09:36 +00:00
Chad Brubaker
83ec7fcb2b Only allow System apps to make VPN exempt routes
requestRouteToHost will only allow system applications to make routes
exempt from the VPN's routing rules.

If a VPN is currently running and a non-system app requests a route it
will only succeed if that host is currently covered by a VPN exempt
routing rule. Otherwise it will fail.

For example, if a VPN is running and the MMS network is brought online
those routes will be added as VPN exempt. If an application then tries
to request a route to a MMS endpoint it will succeed because the routes
already exist. If an application tries to request a route to a host
covered by the VPN the call will fail.

Bug: 12937545
Change-Id: If7bcec91bbb96c62c8fb69748c975847e6c00b6f
2014-02-21 15:30:02 -08:00
JP Abgrall
d3bc570b7b ConnectivityService: add support to set TCP initial rwnd
The value for the TCP initial receive window comes from,
in order,

kernel
  /proc/sys/net/ipv4/tcp_default_init_rwnd

init.rc (via properties)
  net.tcp.default_init_rwnd

properties
  net.tcp.default_init_rwnd

gservices
  Settings.Global.TCP_DEFAULT_INIT_RWND

Bug: 12020135
Change-Id: I0e271be19472900fa9f3bab037d53383ec014a9e
2014-02-21 12:05:20 -08:00
Patrick Tjin
870078d85a Modify unexpected mtu debug message to print mtu
Change-Id: Iacc78582c5e3d6b156e8e2eda25e89e0e5be6eda
2014-02-19 12:53:04 -08:00
Chad Brubaker
170386ea78 Add the calling package name to requestRouteToHost
The calling package name will be used to check if an application is a
system application when deciding if a route should be exempt from VPN
routing rules.

Bug: 12937545
Change-Id: I2c09c875fe9bb9685871a0a801ddcbb32fc17405
2014-02-19 11:04:49 -08:00
Chad Brubaker
e05e257bd0 Remove SO_BINDTODEVICE from VPN protect
SO_BINDTODEVICE is not needed with policy routing.
SO_BINDTODEVICE was also used on the default iface which causes problems
when the default iface is IPv6 only and the socket tries to connect to a
IPv4 address.

Bug: 12940882
Change-Id: I5b2bde0ac5459433fc5749f509072a548532f730
2014-02-13 18:19:43 -08:00
Dianne Hackborn
5da0d5a316 Start tracking radio up time.
We now always turn on network state tracking for mobile,
and push this information down to battery stats.

In battery stats we use this to both log the changes in
the history and keep track of the total time the mobile
radio was active.

Power computation is switched over to using this information
to help determine power use, which will hopefully make it
more accurate (not counting inaccuracies in knowing when it
actually goes down).

Note yet done is aggregating this data per-uid, to better
emphasize which apps are causing the radio to be up.  Right
now we just spread the total time across all uids weighted
by the total number of packets they have sent and received.

Also put in the battery stats infrastructure for bluetooth to
address issue #12973036: Improve power_profile.xml

Change-Id: I39d11b7ff6ae4f336f253d1cba308d8569de7e0d
2014-02-13 17:55:40 +00:00
Jake Hamby
5f5d4337b1 Add new RIL commands to read/write NV items and reset NV config.
Add new RIL commands and generic code cleanups.

The only changes required for OMA DM support are the
addition of five new methods in ITelephony.aidl for
reading/writing NV items and performing NV config and
radio resets (requires MODIFY_PHONE_STATE), along with
the new RIL request IDs in RILConstants.java.

Bug: 12864208
Change-Id: I958d2571580d98a49936ef2e6822e5ac086acbe2
2014-02-03 15:52:18 -08:00
Hui Lu
abb57909e0 am 3cab7fc1: Merge "Add proxy as another network." into klp-modular-dev
* commit '3cab7fc1b8f06166df3a58cf10d4a0db36bde788':
  Add proxy as another network.
2014-01-31 08:11:57 +00:00
Hui Lu
07f2933a07 Add proxy as another network.
Change-Id: I70cb6ac5604c4f0d6a752a291c40de2445ae98bb
2014-01-30 17:26:18 -05:00
Robert Greenwalt
593cc7af27 Clean up dhcp no-op logging
bug:10553167
Change-Id: I1f6feb9a44e17d45ffc9f28b37bf5690230a3ade
2014-01-23 16:05:25 -08:00
Amith Yamasani
ae31a40841 am 6ac202be: Move some system services to separate directories
* commit '6ac202be31f255c01eba381fe30c431aee3ab50f':
  Move some system services to separate directories
2013-12-19 23:30:35 +00:00
Amith Yamasani
6ac202be31 Move some system services to separate directories
Refactored the directory structure so that services can be optionally
excluded. This is step 1. Will be followed by another change that makes
it possible to remove services from the build.

Change-Id: Ideacedfd34b5e213217ad3ff4ebb21c4a8e73f85
2013-12-19 15:25:37 -08:00
Lorenzo Colitti
fdd455785e am 263c4788: am a58711d5: am b4ccc540: Merge "Add address flags and scope to LinkAddress."
* commit '263c4788dcf45f104f8668fd6621d1a7c39689b9':
  Add address flags and scope to LinkAddress.
2013-12-09 18:34:44 +00:00
Lorenzo Colitti
a58711d5b5 am b4ccc540: Merge "Add address flags and scope to LinkAddress."
* commit 'b4ccc5407932858e9e4cdc29dafe05e810e35f22':
  Add address flags and scope to LinkAddress.
2013-12-09 10:28:19 -08:00
Lorenzo Colitti
b4ccc54079 Merge "Add address flags and scope to LinkAddress." 2013-12-07 02:43:04 +00:00
Lorenzo Colitti
4ea70b7743 Add address flags and scope to LinkAddress.
This is necessary so that the framework can know whether an IPv6
address is likely to be usable (i.e., if it's global scope and
preferred). Also, it will simplify the address notification
methods in INetworkManagementEventObserver, which currently take
the address, the flags, and the scope as separate arguments.

1. Add flags and scope to the class and update the unit test.
   Use the IFA_F_* and RT_SCOPE_* constants defined by libcore.
   Since most callers don't know about flags and scope, provide
   constructors that default the flags to zero and determine the
   scope from the address. Addresses notified by the kernel will
   have these properly set. Make multicast addresses invalid.
   Update the class documentation.
2. Provide an isSameAddressAs() method that compares only the
   address and prefix information between two LinkAddress
   objects. This is necessary because an interface can't have
   two addresses with the same address/prefix but different
   flags.
3. Update LinkProperties's addLinkAddress and removeLinkAddress
   to identify existing addresses to add/remove using
   isSameAddressAs instead of implicit equals(). Specifically:
   - If addLinkAddress is called with an address that is already
     present, the existing address's flags and scope are updated.
     This allows, for example, an address on an interface to go
     from preferred to deprecated when it expires, without it
     having to be removed and re-added.
   - If removeLinkAddress is called with an address that is
     present but with different flags, it deletes that address
     instead of failing to find a match.
4. Update the INetworkManagementEventObserver address
   notification methods to take just a LinkAddress instead of
   LinkAddress, flags, and scope. While I'm at it, change the
   order of the arguments for consistency with the other
   functions in the interface.

Change-Id: Id8fe0f09a7e8f6bee1ea3b52102178b689a9336e
2013-12-06 13:54:35 +09:00
The Android Open Source Project
93dfe5add6 am dcff5cef: am 35e36de6: am 8a49a518: Merge commit \'bac61807d3bcfff957b358cb9ad77850bd373689\' into HEAD
* commit 'dcff5ceff6ef0050af4c49a8c2a86ab663a88665':
2013-12-06 02:50:46 +00:00
The Android Open Source Project
35e36de659 am 8a49a518: Merge commit \'bac61807d3bcfff957b358cb9ad77850bd373689\' into HEAD
* commit '8a49a518c5eba286f7739a61c9af03e4f222e046':
2013-12-05 17:27:10 -08:00
The Android Open Source Project
8a49a518c5 Merge commit 'bac61807d3bcfff957b358cb9ad77850bd373689' into HEAD
Change-Id: I29374270c8e0c2f2859efaf1d55af9f73da0f8d7
2013-12-05 13:10:46 -08:00
Lorenzo Colitti
a9f3961f77 am 13d9dfb4: am e097407f: am 8fc3d9a2: Merge "Minor changes to LinkAddress."
* commit '13d9dfb495db1431623c712b36cac1fe2f3c2fc0':
  Minor changes to LinkAddress.
2013-12-04 01:35:11 +00:00
Lorenzo Colitti
e097407f80 am 8fc3d9a2: Merge "Minor changes to LinkAddress."
* commit '8fc3d9a2d9a0533f5a95c9508cf6a0abef07d7e3':
  Minor changes to LinkAddress.
2013-12-03 17:26:06 -08:00
Lorenzo Colitti
8fc3d9a2d9 Merge "Minor changes to LinkAddress." 2013-12-04 01:21:07 +00:00
Lorenzo Colitti
64eb7fdb64 Minor changes to LinkAddress.
1. Simplify the parceling code. Since the InetAddress inside a
   LinkAddress can never be null, we don't need to special-case
   the case where it is.
2. Add / update method documentation.
3. Write a unit test.

Change-Id: Iba0a8cecc683d55d736419965e72ee33dd66dc22
2013-12-03 19:46:36 +09:00
Lorenzo Colitti
ff6daa9aff am 025b1edc: am f226bc60: Merge "Use LinkAddress in address notifications."
* commit '025b1edcd92142305d6f1e50a9224d8a7f8b628a':
  Use LinkAddress in address notifications.
2013-12-02 20:53:06 +00:00
Lorenzo Colitti
025b1edcd9 am f226bc60: Merge "Use LinkAddress in address notifications."
* commit 'f226bc606af9ce5aceff6b05fc4b0200c94cb248':
  Use LinkAddress in address notifications.
2013-11-26 17:56:45 -08:00
Lorenzo Colitti
6ee1306c53 am 48a93c46: am 9d4ac970: Merge "Pass DNS server info notifications to observers."
* commit '48a93c46f390d2cd74c9bce61121386f93bde13a':
  Pass DNS server info notifications to observers.
2013-11-26 08:48:34 -08:00
Lorenzo Colitti
3b6f820e6b am 4eeb8ad4: am eede7e89: Merge "Minor cleanups to NetdCallbackReceiver.onEvent."
* commit '4eeb8ad49491ccb155e171ca89cb89c337e7723c':
  Minor cleanups to NetdCallbackReceiver.onEvent.
2013-11-26 08:48:30 -08:00
Lorenzo Colitti
48a93c46f3 am 9d4ac970: Merge "Pass DNS server info notifications to observers."
* commit '9d4ac9703657142b190d3c256de7c3329e5a4b29':
  Pass DNS server info notifications to observers.
2013-11-26 08:38:48 -08:00
Lorenzo Colitti
4eeb8ad494 am eede7e89: Merge "Minor cleanups to NetdCallbackReceiver.onEvent."
* commit 'eede7e89c94b3bb56c26aec137c53d592d3bc7c3':
  Minor cleanups to NetdCallbackReceiver.onEvent.
2013-11-26 08:38:45 -08:00
Lorenzo Colitti
3ac3fea4e7 Use LinkAddress in address notifications.
Currently address{Updated,Removed} pass in the address as a
string such as "fe80::1/64". Use LinkAddresses instead, since
that's what it is.

This makes the code more robust in the unlikely case that netd
passes in an invalid string. In the future we can move flags and
scope into the LinkAddress itself and simplify the code further.

Bug: 9180552
Change-Id: I66599f9529cf421caa7676fdd0141bb110b8589e
2013-11-26 21:55:15 +09:00
Lorenzo Colitti
ea5c0e2c48 Pass DNS server info notifications to observers.
These are sent if the device receives IPv6 Router Advertisements
with DNS server configuration options. Currently, nothing listens
to them; in a future change we will use them as IPv6 DNS servers.

[Cherry-pick of d3b7821c8f]

Bug: 9180552
Change-Id: I05000c0cd3867a68ab390102e8470b6912a9d3aa
2013-11-25 17:27:17 +09:00
Lorenzo Colitti
1f7e433a86 Minor cleanups to NetdCallbackReceiver.onEvent.
- Clean up identical error messages.
- Fix the array length check for InterfaceAddressChange.

[Cherry-pick of 4f85a08091]

Bug: 9180552
Change-Id: Id871f481445b530c3ad749725f1548df0e3a1228
2013-11-25 17:25:45 +09:00
The Android Open Source Project
2c3004bf9e am ac29b5a6: am b4c0ead9: (-s ours) Merge commit \'b873a17ce7be0a9771c24999adca6964431728f6\' into HEAD
* commit 'ac29b5a6746279f156f9471633498f29e39c14ff':
2013-11-22 19:31:23 -08:00
The Android Open Source Project
ac29b5a674 am b4c0ead9: (-s ours) Merge commit \'b873a17ce7be0a9771c24999adca6964431728f6\' into HEAD
* commit 'b4c0ead90f29f49cf494aa1d39a143b417e62545':
2013-11-22 17:40:32 -08:00
The Android Open Source Project
b4c0ead90f Merge commit 'b873a17ce7be0a9771c24999adca6964431728f6' into HEAD
Change-Id: I938755073e70602cc8f51ce9bd420fdcf870cecd
2013-11-22 11:18:57 -08:00
Lorenzo Colitti
3b49b08e33 Merge "Pass DNS server info notifications to observers." 2013-11-22 01:27:15 +00:00