Commit Graph

1679 Commits

Author SHA1 Message Date
Erik Kline
2027d85cbe Send neighbors into NUD_PROBE rather than NUD_DELAY
Now that device kernels have the required kernel patch [1] forcing
neighbors into NUD_PROBE guarantees that:

    (a) all neighbors will be probed, even currently reachable ones
    (b) no spurious neighbor failures will caused

[1] http://git.kernel.org/cgit/linux/kernel/git/davem/net-next.git/commit/?id=765c9c639fbb132af0cafc6e1da22fe6cea26bb8

Bug: 18581716
Change-Id: I51ba92a730ceb9a6c5193dfa6d9a0f1d10bbf16b
2015-06-01 18:32:39 +09:00
Erik Kline
ab06923576 Treat RTM_DELNEIGH as a transition to NUD_NONE
RTM_DELNEIGHs can happen naturally during garbage collection of STALE
entries, as well as when an interface is going down.  All other
transitions of interest at this time pass through FAILED.

Bug: 18581716
Bug: 21531726
Change-Id: Ib2a731dd6ad6ece478df6950d4cc7752588328a4
2015-06-01 12:46:24 +09:00
Paul Jensen
46ed04de08 Merge "Add javadoc comments mentioning ConnectivityManager API permissions." into mnc-dev 2015-05-26 17:37:33 +00:00
Erik Kline
b1eebaeb92 Notify only on loss of provisioning.
Lots of code refactoring, include:
    - no longer watch for on-link proxies (only routers and DNS servers)
    - keep track of NUD state of neighbors of interest

Bug: 18581716
Change-Id: Ia7dbef0690daf54f69ffecefc14e1224fd402397
2015-05-22 13:03:08 +09:00
Erik Kline
cd7ed16f00 LinkProperties function to compare provisioning and remove DNS servers
Adds:
    - enum ProvisioningChange
    - LinkProperties#compareProvisioning()
          return a ProvisioningChange value describing the delta in
          provisioning between two LinkProperties objects
    - LinkProperties#removeDnsServer()
    - make "@hide public" isIPv4Provisioned() and isIPv6Provisioned()

Bug: 18581716
Change-Id: I3df90b2b89617f693346f2dbe72e77c88ce91ffd
2015-05-21 20:43:47 +09:00
fenglu
22c228f203 Merge "LCE feature enhancement" into mnc-dev 2015-05-20 21:09:09 +00:00
Paul Jensen
cb7c035081 Merge "Undeprecate android.net.ProxyInfo as it's still used." into mnc-dev 2015-05-20 10:49:04 +00:00
Erik Kline
6f611d7267 Merge "Set NLM_F_ACK in our RTM_NEWNEIGH requests" into mnc-dev 2015-05-20 08:05:22 +00:00
Erik Kline
cef7bc939f Set NLM_F_ACK in our RTM_NEWNEIGH requests
With NLM_F_ACK set in RTM_NEWNEIGH requests we get some response from
the kernel, whether there was an error or not.

Additionally:

    [1] add IpReachabilityMonitor#probeNeighbor() as a public
        static method, since it actually depends very little on the
        class internals and might be of larger use.

    [2] add a unittest for parsing NetlinkErrorMessages.

Bug: 18581716
Change-Id: I5d62e7a9972c7440f0483c38c77677436d3a1a25
2015-05-20 16:46:30 +09:00
Lorenzo Colitti
4b545dfbcd Merge "Add a hidden method to clear the capabilities of a NetworkRequest" into mnc-dev 2015-05-20 05:49:03 +00:00
Erik Kline
abd3142dca Close netlink socket when shutting down IpReachabilityMonitor
This forces the NetlinkSocketObserver thread to exit quickly, rather
than lingering until the next random netlink neighbor multicast message
arrives.

Additionally, add a small unittest to verify that multiple calls to
NetlinkSocket#close() are safe.

Change-Id: I101730fad7eee72f9c6e8a7e7bd10c634f2ceab4
2015-05-20 12:08:55 +09:00
fenglu
95ce803da7 LCE feature enhancement
- space pollLceData calls every 500ms
- cluster multiple pending pollLceData calls into one
- cherry pick from mwd to mnc-dev

Bug: 21307957
Change-Id: I04513011db3ae29af02bd54fe91cb8e0d4ab9f12
2015-05-19 17:08:00 -07:00
Paul Jensen
f361e3dff9 Undeprecate android.net.ProxyInfo as it's still used.
It was deprecated as part of the Apache deprecation, however it is used
by ConnectivityManager.getLinkProperties() and .getDefaultProxy().
The alternatives (e.g. java.net.Proxy) do not offer a complete
replacement as they lack certain fields (e.g. PAC URL).

Bug:21274137
Change-Id: I99163a2611a738f337fb9907349ef6255dbed6d6
2015-05-19 15:09:17 -04:00
Paul Jensen
b27489215c Add javadoc comments mentioning ConnectivityManager API permissions.
Also move permissions comments above @param and @return to fix indent.

bug:20499587
Change-Id: If82ff2367fdbce06e696e494439b31cb100d768f
2015-05-19 14:03:03 -04:00
Paul Jensen
c1a9436d27 Merge "Query HTTP proxy for network via a new API to avoid permissions exceptions" into mnc-dev 2015-05-19 17:58:11 +00:00
Lorenzo Colitti
84b83c5a95 Add a hidden method to clear the capabilities of a NetworkRequest
Change-Id: I41d4f2229259d0bf9d68aa00f92f3bf4e2e71fbc
2015-05-20 00:35:24 +09:00
Lorenzo Colitti
aba6cccd40 Merge "Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen." into mnc-dev 2015-05-19 10:29:48 +00:00
Robin Lee
3e5484d452 Merge "Support cross-user VPN calls (with permission)" into mnc-dev 2015-05-19 10:14:59 +00:00
Lorenzo Colitti
76f6779703 Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen.
1. Always keep ConnectivityService's validated bits current:
   - Apply the validated bit whenever a NetworkAgent updates its
     NetworkCapabilities.
   - Set or clear the validated bit whenever lastValidated changes.
2. Send callbacks when the validation state of a network changes.
3. Delete getNetworkCapabilitiesAndValidation, removing code
   duplication with getNetworkCapabilities.
4. Add the validated bit to NetworkCapabilities#toString.

Bug: 18591282
Bug: 20081183
Change-Id: I6aa53b61c15cc137f203f9fc6bbd4c16894be750
2015-05-19 18:29:02 +09:00
Erik Kline
9ce5d602cd Add IpReachabilityMonitor#probeAll() to begin doing DNAv4/v6-like probing
Note that this change is not sufficient to force probing in all cases,
but does cause probing to occur on Linux if the target node hasn't been
confirmed as reachable in the past 5 seconds (delay_first_probe_time).

Bug: 18581716
Bug: 19866451
Bug: 20944464
Change-Id: I29393897118311b48c966c41e2cddb7a784f136f
2015-05-19 09:04:18 +09:00
Robin Lee
3b3dd942ec Support cross-user VPN calls (with permission)
Settings and SystemUI need to act on other users than USER_OWNER.

This is gated by INTERACT_ACROSS_USERS_FULL in addition to the existing
CONTROL_VPN checks, so the number of processes able to interfere with
other profiles' VPNs should be quite small.

Bug: 20692490
Bug: 20747154
Bug: 20872408
Change-Id: I6e5d7220f73435bec350719e7b4715935caf4e19
2015-05-18 23:35:31 +01:00
Paul Jensen
cee9b51c4b Query HTTP proxy for network via a new API to avoid permissions exceptions
Add @hidden ConnectivityManager.getProxyForNetwork() API.

Bug:20470604
Change-Id: I6a9bc4afc8273bc43b14cdeccfedbbf3ff66be40
2015-05-18 17:05:51 +00:00
Erik Kline
787d935611 Initial IpReachabilityMonitor implementation.
Add a class that monitors on-link IP reachability and notifies
callers whenever any on-link addresses of interest appear to have
become unresponsive.

Bug: 18581716
Change-Id: I333eee6fe30fa97a21297c6745de14ceb95bb661
2015-05-13 21:36:15 +09:00
Erik Kline
5a5745b30c Merge "Add basic netlink library code." into mnc-dev 2015-05-13 07:05:00 +00:00
Erik Kline
6193aa3305 Add basic netlink library code.
Add netlink socket helpers and parsing code for basic netlink messages.
Additionally, support from some neighbor discovery -specific messages
is included.

Bug: 18581716
Change-Id: Ib2aa924222b63cdbebf09a8bf8ff35ee24269fc5
2015-05-13 15:18:39 +09:00
Paul Jensen
9e59e12b86 Deprecate ConnectivityManager.isNetworkTypeValid as it's unneeded.
All ConnectivityManager APIs taking a network type have been
deprecated so there should be no need to validate a network type.

bug:20647016
Change-Id: I2dcf24f58016e94aa814dda38cfc848366cc461c
2015-05-12 10:36:56 -04:00
Lorenzo Colitti
0c12125e00 am ad44d814: am 3dc08220: am b57f236e: Merge changes Icf7d67e2,Ia914ec88,I2490ad75,Ie79f2d28 into mnc-dev
* commit 'ad44d81457971085a0b20fb42388010d76c79132':
  Add a hidden method to clear NetworkCapabilities.
  Fix javadoc error for requestNetwork.
  Simplify network callback handling code.
  Document and unhide CALLBACK_PRECHECK.
2015-05-01 04:19:07 +00:00
Lorenzo Colitti
f7058f5d1d Add a hidden method to clear NetworkCapabilities.
Change-Id: Icf7d67e24a09113340e9bff2c72526760914ef48
2015-05-01 12:36:29 +09:00
Lorenzo Colitti
2ea89e59c3 Fix javadoc error for requestNetwork.
The ConnectivityManager documentation uses {@link requestNetwork}
without specifying which version of that method it refers to.
This results in javadoc incorrectly linking to the version of the
method that takes a PendingIntent instead of the version that
takes a callback.

Change-Id: Ia914ec88005a6401b6391c5b4fc92f988baa3922
2015-05-01 12:36:29 +09:00
Lorenzo Colitti
db95a60981 Simplify network callback handling code.
Change-Id: I2490ad754bf2a1282f27302c8556fb19983cc6b1
2015-05-01 12:36:28 +09:00
Lorenzo Colitti
0708693f1e Document and unhide CALLBACK_PRECHECK.
Bug: 20038463
Change-Id: Ie79f2d28c06cf611289504e49c471b55ffb9890f
2015-05-01 12:36:28 +09:00
Narayan Kamath
b0f3d9ea6e Fix incorrect javadoc for Uri.getQueryParameter.
This first went out with Jelly Bean and not ICS.

bug: https://code.google.com/p/android/issues/detail?id=61651

(cherry picked from commit 4356c95354)

Change-Id: I5b96bcb20aa3a1d227dd5b00926af077276fc666
2015-04-30 12:23:19 +01:00
Amith Yamasani
98322c8e88 am 278886d5: am 3184b286: am fa4eda44: Merge "Remove network access for idle apps" into mnc-dev
* commit '278886d50a66689529320f9bd735177c068e210d':
  Remove network access for idle apps
2015-04-29 23:04:50 +00:00
Amith Yamasani
278886d50a am 3184b286: am fa4eda44: Merge "Remove network access for idle apps" into mnc-dev
* commit '3184b28648a782a3a037de90bc76f64839b91560':
  Remove network access for idle apps
2015-04-29 22:52:08 +00:00
Amith Yamasani
15e47235c0 Remove network access for idle apps
Track apps going in and out of idle in the NetworkPolicyManagerService.
Apply DROP rules in firewall controller if app is to be blacklisted
for network access.

Firewall can now be in whitelist (old) or blacklist mode. When in
blacklist, it allows all by default and we can selectively DENY
some uids.

Track app idle in UsageStats and update periodically.
Track charging/discharging states.

TODO: Check for appidle temporary parole state

Bug: 20066058
Change-Id: Ia65d7544204b3bcb78a517310ef4adcc05aac6fb
2015-04-29 14:21:53 -07:00
Dianne Hackborn
c5cbdfcfe5 am 8756f9b3: am 599a4e0e: am 9ac2718e: Merge "Implement user-settable power save whitelist." into mnc-dev
* commit '8756f9b34dd04cabae7487bd1941008a6c98c4c6':
  Implement user-settable power save whitelist.
2015-04-29 21:02:36 +00:00
Dianne Hackborn
8756f9b34d am 599a4e0e: am 9ac2718e: Merge "Implement user-settable power save whitelist." into mnc-dev
* commit '599a4e0ea864769e6cd1d04bd766c472b16be4c7':
  Implement user-settable power save whitelist.
2015-04-29 20:51:04 +00:00
Dianne Hackborn
0b4daca9ba Implement user-settable power save whitelist.
The whitelist is now maintained by DeviceIdleController,
which is moving out into its own independent system service.
Network stats now queries it for the whitelist, instead of
collecting that itself.

Also did a few improvements in alarm manager -- made the
code for moving alarms out of the pending list more robust,
and fixed the debug output to always print the contents of
the pending list even if we aren't in a pending state.  (That
would have helped me identify the problem much earlier.)

Change-Id: I0f7119d4c553c3af4d77b2f71246fa6e2c13c561
2015-04-29 12:38:09 -07:00
fenglu
ae519190aa Fix the javadoc for requestBandwidthUpdate(...)
Change-Id: I6673dd219ef832acb15ce9b6398caa1c8503320b
2015-04-27 14:28:04 -07:00
fenglu
d515d07336 Merge "API review for requestBandwidthUpdate()" 2015-04-27 20:34:01 +00:00
Narayan Kamath
b6d1d7171d am cf6fc5ee: Merge "Fix incorrect javadoc for Uri.getQueryParameter."
* commit 'cf6fc5ee13e549c6ce1a6a4fc417aa13fc0dfa17':
  Fix incorrect javadoc for Uri.getQueryParameter.
2015-04-27 11:35:12 +00:00
Narayan Kamath
4356c95354 Fix incorrect javadoc for Uri.getQueryParameter.
This first went out with Jelly Bean and not ICS.

bug: https://code.google.com/p/android/issues/detail?id=61651
Change-Id: I26f6b18593fe089bd3a52ec1d159494923bcbad1
2015-04-27 10:42:41 +00:00
Etan Cohen
a179962b61 Merge commit '25a217c' into merge2
Change-Id: I116a9dbf19e95651a7c50393e4dcd7fb59ca3f3f
2015-04-24 13:58:45 -07:00
Etan Cohen
fa96c94c30 Merge commit '9561e74' into merge2 2015-04-24 13:43:36 -07:00
Lorenzo Colitti
e285b434f4 @removed requestRouteToHost and {start,stop}UsingNetworkFeature
Bug: 20482461
Change-Id: Ic59fc1271e664d85102dc7945c0c2ea82c0d6f6b
2015-04-23 17:44:05 +09:00
Lorenzo Colitti
ec4c555571 Don't require ACCESS_NETWORK_STATE in setProcessDefaultNetwork
The documentation for setProcessDefaultNetwork does not
mention that it requires ACCESS_NETWORK_STATE, but a process
without ACCESS_NETWORK_STATE that calls it will crash because
we can't fetch the proxy properties.

Because ACCESS_NETWORK_STATE is not required to obtain a Network
object (Network objects can come from broadcasts too), it may not
be reasonable to require the permission. We did not do so in L.

For now, ignore the failure and don't crash the app. I've filed
http://b/20470604 to track a longer term fix.

Bug: 20081183
Bug: 20423580
Bug: 20470604
Change-Id: I158016130b4afb1d300357fe703804d2e7bc609b
2015-04-22 12:27:33 +09:00
fenglu
73c7e0ef38 API review for requestBandwidthUpdate()
Change-Id: I53dc3b95b1f989541e06d9b2c2ef8871bac81344
2015-04-21 18:57:15 -07:00
fenglu
b32243498f Merge "update API name to requestBandwidthUpdate()" 2015-04-22 01:32:19 +00:00
fenglu
db57147a55 update API name to requestBandwidthUpdate()
Change-Id: If26942978ffcc43f06f17dfad5da790f34758395
2015-04-21 17:12:05 -07:00
Robert Greenwalt
bba3270c34 Merge "Revert "requestBwUpdate() public API review"" 2015-04-21 23:59:35 +00:00