Commit Graph

2055 Commits

Author SHA1 Message Date
Paul Jensen
bb910e9bcd Revive ConnectivityServiceTest and add some tests.
Change-Id: I44740a7b21cff18ac2a67d09c4d0e597add19ee0
2015-06-04 09:09:36 -04:00
Erik Kline
7cbc907b61 Delete unsed mDnsLock.
Bug: 21449922
Change-Id: I0c9f95c30eaa170d809e86f6505379f34a0a7603
2015-06-03 16:10:08 +09:00
Lorenzo Colitti
3b1ad969cf Make the dumpsys connectivity shorter and easier to read.
- Print NetworkFactories on one line.
- Only print LegacyTypeTracker networks if they are connected,
  and record supported network types on a separate summary line.
- Print all tethering upstreams on one line.
- Summarize the state of the transition wakelock on one line.
- Don't print Inet condition reports if there are none.
  (Currently there can never be any.)

Bug: 21449922
Change-Id: Ib4b29a7fd882e6c105839a255fffecf4f346cf7e
2015-06-03 11:29:41 +09:00
Stuart Scott
d198fe197b Network Reset should have a lockdown like Factory Reset.
bug:20332322
Change-Id: I7c61a011d11e89513757f112abf320bb2a785edb
(cherry picked from commit 94b038bbb291431a7b39611d72f206b07e839891)
2015-06-01 16:31:00 +00:00
Paul Jensen
16d8795df6 Merge "Add javadoc comments mentioning ConnectivityManager API permissions." into mnc-dev 2015-05-26 17:37:33 +00:00
Paul Jensen
f66991ceaf Merge "Null-check argument to ConnectivityManager.releaseNetworkRequest(PendingIntent)" into mnc-dev 2015-05-26 17:33:26 +00:00
Paul Jensen
6f94248ebf Null-check argument to ConnectivityManager.releaseNetworkRequest(PendingIntent)
Do this in ConnectivityService to prevent crashing framework.

Bug:21329396
Change-Id: Ifd9c970cd0da392d0bd5da9a9ae845fdf0b559b3
2015-05-21 08:15:08 -04:00
Erik Kline
04612b0692 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
c7830c6dcf Merge "LCE feature enhancement" into mnc-dev 2015-05-20 21:09:09 +00:00
Paul Jensen
60472854d2 Merge "Undeprecate android.net.ProxyInfo as it's still used." into mnc-dev 2015-05-20 10:49:04 +00:00
Lorenzo Colitti
892a7e1885 Merge "Add a hidden method to clear the capabilities of a NetworkRequest" into mnc-dev 2015-05-20 05:49:03 +00:00
fenglu
fcc8c9b5f4 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
81c7260a93 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
08f9dbbfa1 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
1916861976 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
1aa80c66de Add a hidden method to clear the capabilities of a NetworkRequest
Change-Id: I41d4f2229259d0bf9d68aa00f92f3bf4e2e71fbc
2015-05-20 00:35:24 +09:00
Lorenzo Colitti
a3a771b3d7 Merge "Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen." into mnc-dev 2015-05-19 10:29:48 +00:00
Robin Lee
1281e50c72 Merge "Support cross-user VPN calls (with permission)" into mnc-dev 2015-05-19 10:14:59 +00:00
Lorenzo Colitti
e97685a88f 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
Robin Lee
1e71fc8356 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
db93dd93c5 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
The Android Automerger
527979bb76 merge in mnc-release history after reset to mnc-dev 2015-05-16 01:02:14 -07:00
Lorenzo Colitti
c2faedca3f Don't display the "no Internet access" prompt on captive portals.
Bug: 20081183
Bug: 21066461
Change-Id: Idc71844a604f9ca655411c6916de256780ea4586
2015-05-14 09:54:33 -07:00
Lorenzo Colitti
e14a622909 Statically import NetworkCapabilities constants for brevity.
Bug: 18591282
Change-Id: I41c148951724136f31bc663fd81ca9f5de72818a
2015-05-14 23:46:17 +09:00
Lorenzo Colitti
2c39d1313a Don't display the "no Internet access" prompt on captive portals.
Bug: 20081183
Bug: 21066461
Change-Id: Idc71844a604f9ca655411c6916de256780ea4586
2015-05-14 23:46:16 +09:00
Lorenzo Colitti
2943803f73 Merge "Fix a race when removing from LegacyTypeTracker." into mnc-dev 2015-05-13 06:31:38 +00:00
Paul Jensen
5696665e2d Merge "Deprecate ConnectivityManager.isNetworkTypeValid as it's unneeded." into mnc-dev 2015-05-12 16:32:29 +00:00
Paul Jensen
bbb61094b2 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
4976772f9b Fix a race when removing from LegacyTypeTracker.
Because LegacyTypeTracker#remove can send broadcasts that cause
apps to refresh their view of network state, it needs to be
called only after network state has been updated. This requires
that callers determine whether the network was the default, and
updating state, before calling remove().

While I'm at it, fix maybeLogBroadcast's concept of whether the
network it's logging about is/was the default. This has never
been correct.

Bug: 20613953
Change-Id: Ia175ac454aa4e0a4c4f0151866314ebada681438
2015-05-12 16:48:30 +09:00
Erik Kline
05f2b40542 Optionally add a default MOBILE request.
This enables persisting the mobile internet data connection, even
when Wi-Fi is enabled and serving as the default network (for faster
network switching).

Change-Id: I9d1512b3a8413c4f163c63d57e66bded017101e4
2015-05-08 15:22:37 +09:00
Prerepa Viswanadham
96011f4e3a Merge changes from topic 'mwd-merge-050415' into mnc-dev
* changes:
  Merge commit 'b6f59f4' into master_merge
  Merge commit 'f6db0ce' into master_merge
  Merge commit '17455a3' into master_merge
  Merge commit 'b4d5b32' into master_merge
  Merge commit 'a1a2fa7' into master_merge
  Merge commit '8dfdb98' into master_merge
  Merge commit 'eba66c3' into master_merge
2015-05-05 01:06:38 +00:00
Sanket Padawe
89f510319f Merge "Adding "Connected, no Internet" string in Wifi nw summary." into mnc-dev 2015-05-04 20:44:52 +00:00
Sanket Padawe
aeb5be7c7d Adding "Connected, no Internet" string in Wifi nw summary.
Bug: 17380953
Change-Id: I9664bcbf33832fe722e7d2b3125939287ee98098
2015-05-01 16:55:00 -07:00
Lorenzo Colitti
a8851ab1fb 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
c5647c2eda Add a hidden method to clear NetworkCapabilities.
Change-Id: Icf7d67e24a09113340e9bff2c72526760914ef48
2015-05-01 12:36:29 +09:00
Lorenzo Colitti
7f6a2bfffa 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
68e02363c7 Simplify network callback handling code.
Change-Id: I2490ad754bf2a1282f27302c8556fb19983cc6b1
2015-05-01 12:36:28 +09:00
Lorenzo Colitti
145745967f Document and unhide CALLBACK_PRECHECK.
Bug: 20038463
Change-Id: Ie79f2d28c06cf611289504e49c471b55ffb9890f
2015-05-01 12:36:28 +09:00
Amith Yamasani
55819cc235 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
2a37b3cc84 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
fenglu
ea2d928abe Fix the javadoc for requestBandwidthUpdate(...)
Change-Id: I6673dd219ef832acb15ce9b6398caa1c8503320b
2015-04-27 14:28:04 -07:00
fenglu
faa4bcf5e3 Merge "API review for requestBandwidthUpdate()" 2015-04-27 20:34:01 +00:00
Etan Cohen
299db05f65 Merge commit '052a0da' into merge2 2015-04-24 14:06:22 -07:00
Etan Cohen
a70e10d366 Merge commit '83cda00' into merge2 2015-04-24 14:03:06 -07:00
Etan Cohen
856f4a7d05 Merge commit '60df4aa' into merge2
Change-Id: I116a9dbf19e95651a7c50393e4dcd7fb59ca3f3f
2015-04-24 13:58:45 -07:00
Etan Cohen
050bf7cbda Merge commit 'd39aecf' into merge2 2015-04-24 13:54:24 -07:00
Etan Cohen
d6bc847e87 Merge commit '6ddbb5e' into merge2 2015-04-24 13:44:05 -07:00
Etan Cohen
2fcb05cd8b Merge commit '9561e74' into merge2 2015-04-24 13:43:36 -07:00
Lorenzo Colitti
34c019ce63 Merge "@removed requestRouteToHost and {start,stop}UsingNetworkFeature" 2015-04-23 10:21:28 +00:00
Lorenzo Colitti
21e9a15571 @removed requestRouteToHost and {start,stop}UsingNetworkFeature
Bug: 20482461
Change-Id: Ic59fc1271e664d85102dc7945c0c2ea82c0d6f6b
2015-04-23 17:44:05 +09:00