Commit Graph

2682 Commits

Author SHA1 Message Date
Felipe Leme
2e9555bced Merge "Added a onRestrictBackgroundBlacklistChanged() callback." into nyc-dev am: 54bc88cdbc am: 3b91df7ccf
am: e81819c43e

* commit 'e81819c43e0e304cc5dc330784b62bd4e0292774':
  Added a onRestrictBackgroundBlacklistChanged() callback.

Change-Id: Ieb58dda8f4749ccf5218be5913beb488fd3247cf
2016-05-17 19:07:18 +00:00
Felipe Leme
e81819c43e Merge "Added a onRestrictBackgroundBlacklistChanged() callback." into nyc-dev am: 54bc88cdbc
am: 3b91df7ccf

* commit '3b91df7ccf7ee4adf9914ffcdcbf220eb9f9fd08':
  Added a onRestrictBackgroundBlacklistChanged() callback.

Change-Id: Idb223f33d6c5b1d4054bd41f4b9b9672c507986c
2016-05-17 18:47:41 +00:00
TreeHugger Robot
54bc88cdbc Merge "Added a onRestrictBackgroundBlacklistChanged() callback." into nyc-dev 2016-05-17 18:28:22 +00:00
Robin Lee
dd58655f81 Merge "Make some of the UID-based VPN code reusable" into nyc-dev am: b0f3016b64 am: a7cc7c5b4e
am: 1cd027befe

* commit '1cd027befe8206fe4c33b1efff2bebb0584c138c':
  Make some of the UID-based VPN code reusable

Change-Id: I75d9871f8039d14f8d83be4696c3c4d4e864f9c0
2016-05-17 17:59:59 +00:00
Robin Lee
1cd027befe Merge "Make some of the UID-based VPN code reusable" into nyc-dev am: b0f3016b64
am: a7cc7c5b4e

* commit 'a7cc7c5b4edb125961bf5c219ecf57bce7876db5':
  Make some of the UID-based VPN code reusable

Change-Id: Ie7c88ba3eebe4af85a69f330cae3df3293113d4e
2016-05-17 17:52:45 +00:00
Robin Lee
a7cc7c5b4e Merge "Make some of the UID-based VPN code reusable" into nyc-dev
am: b0f3016b64

* commit 'b0f3016b64552674681dbc742667203d36c4c86d':
  Make some of the UID-based VPN code reusable

Change-Id: I3f1b1a08059aa58cb76db6cdd070b103024b9bf3
2016-05-17 17:36:43 +00:00
TreeHugger Robot
b0f3016b64 Merge "Make some of the UID-based VPN code reusable" into nyc-dev 2016-05-17 17:30:01 +00:00
Felipe Leme
c0343f4c3d Merge "Documented return value of getRestrictBackgroundStatus()." into nyc-dev am: 522787f39a am: aeb254ec20
am: 2b4f3e3327

* commit '2b4f3e3327f2c94364be4261ce60a505a03d416e':
  Documented return value of getRestrictBackgroundStatus().

Change-Id: Ia86cbc0d7b0be02f7dad7446127c2c711bb9f771
2016-05-16 22:35:23 +00:00
Felipe Leme
2b4f3e3327 Merge "Documented return value of getRestrictBackgroundStatus()." into nyc-dev am: 522787f39a
am: aeb254ec20

* commit 'aeb254ec20c1cdd95c89c6406c4deaaed1918deb':
  Documented return value of getRestrictBackgroundStatus().

Change-Id: Id6197b9ee56fd06505c21c1bb5dce083998aa79a
2016-05-16 22:28:27 +00:00
Felipe Leme
aeb254ec20 Merge "Documented return value of getRestrictBackgroundStatus()." into nyc-dev
am: 522787f39a

* commit '522787f39a759cf8af8438641fa8df7470a1b959':
  Documented return value of getRestrictBackgroundStatus().

Change-Id: Ie2e7b14ecc0b574a8776121d3c79c768093ef4f7
2016-05-16 22:23:44 +00:00
Felipe Leme
6bd46fc303 Documented return value of getRestrictBackgroundStatus().
Change-Id: I2c15a6d5e23cbc3c9b59c975196c1c04c1294471
Fixes: 28775490
2016-05-16 13:57:19 -07:00
Felipe Leme
81fb728ce4 Added a onRestrictBackgroundBlacklistChanged() callback.
When an UID is added / removed to the Data Saver blacklist, it's
necessary to notify internal components such as the Settings UI (which
was erroneously listening to UID rules changes instead).

BUG: 28743623
BUG: 28791717

Change-Id: I11c85e141dfe074ad390fd324309d2412bfbbd45
2016-05-16 13:30:57 -07:00
Android Build Merger (Role)
ac0c51c1e2 Merge "Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f am: 6f582ae1d4 am: d117f7dd99" 2016-05-13 17:37:20 +00:00
Felipe Leme
01689a690d Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f am: 6f582ae1d4
am: d117f7dd99

* commit 'd117f7dd99cd4751432238496e0851e45815d9e3':

Change-Id: I2ff4fafa45f2f41a6d34e1c2b602f1152e3645e7
2016-05-13 17:35:42 +00:00
Felipe Leme
9a49aaa2c7 Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f am: 6f582ae1d4
am: d117f7dd99

* commit 'd117f7dd99cd4751432238496e0851e45815d9e3':

Change-Id: If85188ccc995b4f50070ca85de199280b03290f2
2016-05-13 17:32:27 +00:00
Felipe Leme
eb8d471630 Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f am: cc02a95cbd
am: 3d079f210c

* commit '3d079f210cce78d6d87220b289a68de97ae263b4':
  Fixed connectivity state in some power saving scenarios.

Change-Id: Idd27e581b208a0d80d8fa6a4d7cf75eac82a32fd
2016-05-13 17:31:58 +00:00
Felipe Leme
d117f7dd99 Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f
am: 6f582ae1d4

* commit '6f582ae1d42c5767d0e5ef4fa5684b0cc9fc1feb':

Change-Id: Ic63dadce968a17a4df8b39f8904f5818d48e95ac
2016-05-13 17:29:07 +00:00
Felipe Leme
3d079f210c Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev am: 942ee1159f
am: cc02a95cbd

* commit 'cc02a95cbd694927cd70d7b0d7921d3f10300b38':
  Fixed connectivity state in some power saving scenarios.

Change-Id: I9ce60e8520c041e1345960a51394f8477c4ac49e
2016-05-13 17:26:29 +00:00
Felipe Leme
6f582ae1d4 Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev
am: 942ee1159f

* commit '942ee1159f45c13029c28dc7846d6773571f6cda':
  Fixed connectivity state in some power saving scenarios.

Change-Id: I7ebe3864657d2147034ffae400312e94deb5ef35
2016-05-13 17:23:24 +00:00
TreeHugger Robot
942ee1159f Merge "Fixed connectivity state in some power saving scenarios." into nyc-dev 2016-05-13 17:14:13 +00:00
Elliott Hughes
b89fe38222 resolve merge conflicts of bc90502 to nyc-dev-plus-aosp am: ddd7dd8e7f
am: 13d5a1d648

* commit '13d5a1d648bd71e92347dd30629648c90326fccf':
  Make android_net_NetUtils include what it actually uses.

Change-Id: I775c03ba7fd3895c6525d3986b564b228d34063b
2016-05-13 16:08:58 +00:00
Elliott Hughes
13d5a1d648 resolve merge conflicts of bc90502 to nyc-dev-plus-aosp
am: ddd7dd8e7f

* commit 'ddd7dd8e7f7d661e4a411f2c9f14f69a86e172a4':
  Make android_net_NetUtils include what it actually uses.

Change-Id: I84a143e1922c7180a0a1926d2cfd87b59bca137d
2016-05-13 16:06:35 +00:00
Robin Lee
6b78f4f48b Make some of the UID-based VPN code reusable
By changing some member refs into arguments and having one of the
functions create the UID range instead of adding to mVpnUsers.

This will be useful for other layers of UID filtering like having
UIDs explicitly blocked from the VPN.

Deleted one broken line of code that cleared the status intent when
a restricted profile is removed. Other than that, this commit shouldn't
change any behaviour. If it does, that's a bug.

Bug: 26694104
Change-Id: Ieb656835d3282a8ba63cc3f12a80bfae166bcf44
2016-05-13 16:03:11 +00:00
Elliott Hughes
ddd7dd8e7f resolve merge conflicts of bc90502 to nyc-dev-plus-aosp
Change-Id: Ic78042d45085718b2220107e9a84767df316440a
2016-05-13 08:57:40 -07:00
Paul Jensen
60612f8096 Merge "Merge "ApfFilter unit test" into nyc-dev am: cf12d6140b am: 771d9fe0b6" into nyc-mr1-dev-plus-aosp
am: f97396b8ad

* commit 'f97396b8ad5f57fd25f12e1661257323dad18ae4':

Change-Id: Ibef62387f6c05632432408c5e011377dd8498d6a
2016-05-13 14:47:57 +00:00
Paul Jensen
30c3ad8d61 Merge "ApfFilter unit test" into nyc-dev am: cf12d6140b am: 83e6bff540
am: 6f62c8df0f

* commit '6f62c8df0f0771cc6301c1b40c7757f3c8b6e5f8':
  ApfFilter unit test

Change-Id: Ide959b34cd6bd97620b2c14812bd362d203fd85f
2016-05-13 14:43:06 +00:00
Android Build Merger (Role)
f97396b8ad Merge "Merge "ApfFilter unit test" into nyc-dev am: cf12d6140b am: 771d9fe0b6" into nyc-mr1-dev-plus-aosp 2016-05-13 14:41:03 +00:00
Paul Jensen
e1fbe074e5 Merge "ApfFilter unit test" into nyc-dev am: cf12d6140b
am: 771d9fe0b6

* commit '771d9fe0b607a953f2efbb64745c1e68f4fced01':
  ApfFilter unit test

Change-Id: I00a8b46efdd8e52d2756723f2e11b48e3231eff6
2016-05-13 14:40:42 +00:00
Paul Jensen
6f62c8df0f Merge "ApfFilter unit test" into nyc-dev am: cf12d6140b
am: 83e6bff540

* commit '83e6bff54056e75314762e8d50fc71b912ab5fe1':
  ApfFilter unit test

Change-Id: I17ddf9d4823588dd2cad0d5662ec434ae2d027f6
2016-05-13 14:40:39 +00:00
Paul Jensen
83e6bff540 Merge "ApfFilter unit test" into nyc-dev
am: cf12d6140b

* commit 'cf12d6140b923c3049f26b4e57bd64003c5885c9':
  ApfFilter unit test

Change-Id: I97bdf703c24c8c3008113c09f5f441cd1d74bc81
2016-05-13 14:38:13 +00:00
Paul Jensen
cf12d6140b Merge "ApfFilter unit test" into nyc-dev 2016-05-13 14:33:25 +00:00
Felipe Leme
35bfb4616b Fixed connectivity state in some power saving scenarios.
NetworkPolicyManagerService (NPMS) manages 4 type of network restriction
when apps are running on background:

- Data Saver Mode (data usage restriction on metered-networks)
- Battery Saver Mode (power restriction on all networks)
- Doze Mode (power restriction on all networks)
- App Idle (power restriction on all networks)

These restrictions affects 2 parts of the system:

- Internal framework state on NPMS which is propagated to other internal
  classes.
- External firewall rules (managed by netd).

Although each of the power-related restrictions have their own external firewall
rules, internally apps are whitelisted to them through the same
whitelist, and the current code is only updating the internal state (and
notifying the internal listeners) when Battery Saver Mode is on.

As a consequence of this problem, there are scenarios where an app
correctly does not have internet access (because the firewall rules are
properly set), but the NetworkInfo state returns the wrong state (like
CONNECTED / CONNECTED).

This CL fixes this problem by splitting the power-related logic from
updateRulesForRestrictBackgroundLocked() into its own
method (updateRulesForPowerRestrictionsLocked()), and making sure such
method is called whenever the firewall rules are updated.

Externally to this change, the CTS tests were also improved to verify
the apps get the proper connection state; it can be verified by running:

cts-tradefed run commandAndExit cts -m CtsHostsideNetworkTests \
    -t com.android.cts.net.HostsideRestrictBackgroundNetworkTests

BUG: 28521946
Change-Id: Id5187eb7a59c549ef30e2b17627ae2d734afa789
2016-05-12 12:33:23 -07:00
Elliott Hughes
ee04c535f0 Make android_net_NetUtils include what it actually uses.
Bug: http://b/28519060
Change-Id: I49dcd358d3fc8e0ba5c5e0b50a0f5dcc63281d22
2016-05-11 15:18:13 -07:00
Antonio Cansado
44a88e29e5 Merge "Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640 am: de224ba451" into nyc-mr1-dev-plus-aosp
am: 5062e21feb

* commit '5062e21febf47d96392a306959e533707f5540f3':

Change-Id: I7a1644a097b8edbaa0da0b80c0e2b6f374f99cf1
2016-05-10 21:14:17 +00:00
Antonio Cansado
39485fcdfc Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640 am: 860924860a
am: 1f186ce13b

* commit '1f186ce13bf383be39bd4b610bcb3e69f2882899':
  Addressing API council comments on NetworkStatsManager.

Change-Id: Ie6455799758f0bdb67440f72c266effaf412e22f
2016-05-10 21:14:09 +00:00
Android Build Merger (Role)
5062e21feb Merge "Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640 am: de224ba451" into nyc-mr1-dev-plus-aosp 2016-05-10 21:08:59 +00:00
Antonio Cansado
c24a9e3baa Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640
am: de224ba451

* commit 'de224ba451547fcc139ec6c565243e0f450ece46':
  Addressing API council comments on NetworkStatsManager.

Change-Id: I1383b3c11653daaa3a0ca34600dbc7e28af24641
2016-05-10 21:08:28 +00:00
Antonio Cansado
1f186ce13b Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev am: dc5f558640
am: 860924860a

* commit '860924860a5a27f609210079076e907640e229da':
  Addressing API council comments on NetworkStatsManager.

Change-Id: Ia886e1ce98520c1618ba501097a2c979a628bbb4
2016-05-10 21:08:25 +00:00
Antonio Cansado
860924860a Merge "Addressing API council comments on NetworkStatsManager." into nyc-dev
am: dc5f558640

* commit 'dc5f558640da8785fabc274167ec37a0fda30cd6':
  Addressing API council comments on NetworkStatsManager.

Change-Id: I952e69e7cfbd8cebcbac7c3b19ede300e26777e8
2016-05-10 21:05:17 +00:00
Antonio Cansado
3bbf833ff4 Addressing API council comments on NetworkStatsManager.
Callbacks
 - DataUsageCallback renamed to UsageCallback
 - DataUsagePolicy removed; passing in params directly to register method
 - making it an abstract class
 - passing in (networkType, subscriberId) that reached its threshold
 - renaming onLimitReached to onThresholdReached to match existing naming
 - only monitor single network,subscriberId
 - no monitoring of specific uids; using device or user wide instead

Tags
 - only owner uid can read its tags
 - exposing only TAG_NONE to match service side

BUG: 27530098

Change-Id: I2b2664da71806868a1e937d2bf4d1f234637509b
2016-05-10 13:24:16 -07:00
Paul Jensen
97d1682d07 ApfFilter unit test
Bug: 26238573

Change-Id: I5171038228782bd54e91f5bcc663cc529d2c1150
2016-05-10 11:54:42 -04:00
Felipe Leme
2e6c791d53 Merge "Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140 am: f39d22efcf" into nyc-mr1-dev-plus-aosp
am: 597409049c

* commit '597409049c43a8db383c3560294d36c2c1243f3f':

Change-Id: I84bb94fff82e9a7965147b0bb1736ab5529b6c8d
2016-05-06 23:48:57 +00:00
Felipe Leme
78c6cc4f44 Merge "Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140 am: f39d22efcf" into nyc-mr1-dev-plus-aosp
am: 67ff40fadd

* commit '67ff40fadd7cb5ac7ad474b1364a52e1705a7cad':

Change-Id: I681d58e763bec7b22b2962c98661576f534d6669
2016-05-06 23:48:54 +00:00
Felipe Leme
6fca287f50 Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140 am: 87d20317bf
am: d9c0f5c6a1

* commit 'd9c0f5c6a1e2c16b61ed0d87b5533aed295273c9':
  Fixed connectivity state in some restricted network scenarios.

Change-Id: I1bc51c4a06dad9245ce0ed884707855b2c04edf1
2016-05-06 23:48:47 +00:00
Android Build Merger (Role)
597409049c Merge "Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140 am: f39d22efcf" into nyc-mr1-dev-plus-aosp 2016-05-06 23:47:02 +00:00
Felipe Leme
bac2fa1d05 Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140
am: f39d22efcf

* commit 'f39d22efcf7db6043e13fbc093de2799c3ccf531':

Change-Id: Ic58995d889136c62d397bb8323ed8b66be90e3cf
2016-05-06 23:46:37 +00:00
Android Build Merger (Role)
67ff40fadd Merge "Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140 am: f39d22efcf" into nyc-mr1-dev-plus-aosp 2016-05-06 23:44:23 +00:00
Felipe Leme
d9c0f5c6a1 Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140
am: 87d20317bf

* commit '87d20317bf26e87ef58798d3c5aafb81aa163788':
  Fixed connectivity state in some restricted network scenarios.

Change-Id: Ifeb332fbf00c554b78d0ad724b34e3a8ebfc9894
2016-05-06 23:43:55 +00:00
Felipe Leme
bb507dda10 Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev am: 638a6e8140
am: f39d22efcf

* commit 'f39d22efcf7db6043e13fbc093de2799c3ccf531':
  Fixed connectivity state in some restricted network scenarios.

Change-Id: I76e419d0d010652699b9081418f5f654763887d1
2016-05-06 23:43:52 +00:00
Felipe Leme
f39d22efcf Merge "Fixed connectivity state in some restricted network scenarios." into nyc-dev
am: 638a6e8140

* commit '638a6e8140a22a0ddb5d5dacb02173795073bd1a':
  Fixed connectivity state in some restricted network scenarios.

Change-Id: I0fd66b16c83680940f294ea8e117443ffd8a50cd
2016-05-06 23:38:59 +00:00