Commit Graph

969 Commits

Author SHA1 Message Date
Jeff Sharkey
4fd1783314 Unify permissions under UPDATE_DEVICE_STATS.
The UPDATE_DEVICE_STATS permission has become the de-facto mechanism
that platform components use to shift blame for resource usage, so
it's confusing to also have a separate MODIFY_NETWORK_ACCOUNTING
permission.  So this change replaces MODIFY_NETWORK_ACCOUNTING with
UPDATE_DEVICE_STATS.

Bug: 62483389
Test: builds, boots
Exempt-From-Owner-Approval: Bug 63673347
Change-Id: I872759f02327b6d531ec2338bd876890aded60ad
2017-07-17 16:10:55 -06:00
nharold
ee81941aec Merge "Check ManagedResource is NonNull before Checking Owner" am: 0d1e9bb5b8 am: 83dee33162 am: 43d17a6785
am: d4da46291a

Change-Id: Ie439eca6ec805e0c60574f21deef1d49574891c8
2017-07-17 18:22:18 +00:00
nharold
d4da46291a Merge "Check ManagedResource is NonNull before Checking Owner" am: 0d1e9bb5b8 am: 83dee33162
am: 43d17a6785

Change-Id: I97f1cda1efc1fb7d699b34ab725a205d3143bdad
2017-07-17 18:11:47 +00:00
nharold
83dee33162 Merge "Check ManagedResource is NonNull before Checking Owner"
am: 0d1e9bb5b8

Change-Id: I2e8cde8a7be8bdbdeebb00df053fdc621d30cdec
2017-07-17 17:52:25 +00:00
nharold
0d1e9bb5b8 Merge "Check ManagedResource is NonNull before Checking Owner" 2017-07-17 16:57:01 +00:00
Di Lu
34556e2f57 Merge "Remove return value of ipSecAddSecurityAssociation" am: 36acf01d58 am: 84aa41dae2 am: c554c2c1cb
am: 4ba38b60e2

Change-Id: I77f2e8be5a3ce9fe1c8c49b2530a8955abf5b0cc
2017-07-12 04:21:00 +00:00
Di Lu
4ba38b60e2 Merge "Remove return value of ipSecAddSecurityAssociation" am: 36acf01d58 am: 84aa41dae2
am: c554c2c1cb

Change-Id: I94e533d415e0afdbd4be72536ec667513a32f025
2017-07-12 04:13:52 +00:00
Di Lu
84aa41dae2 Merge "Remove return value of ipSecAddSecurityAssociation"
am: 36acf01d58

Change-Id: I3cf6dbc44af4934c34b074dccdfff77dede6a693
2017-07-12 04:02:24 +00:00
Di Lu
36acf01d58 Merge "Remove return value of ipSecAddSecurityAssociation" 2017-07-12 03:53:57 +00:00
Andreas Gampe
e3e17a5ca4 Merge "IpSecService: Actually throw exception" am: 3eff26449f am: 50f53691de am: d7c0357277
am: fe09d91eae

Change-Id: Ic3440c4f933725be28d5cd2b86bebc2950206f63
2017-07-12 01:50:13 +00:00
Andreas Gampe
fe09d91eae Merge "IpSecService: Actually throw exception" am: 3eff26449f am: 50f53691de
am: d7c0357277

Change-Id: I9d5b81d6f62b6d8ff7561d908c6d61b4a21c7419
2017-07-12 01:43:13 +00:00
Andreas Gampe
50f53691de Merge "IpSecService: Actually throw exception"
am: 3eff26449f

Change-Id: I415b249d564c5ffdd2d9381b53a31dd6f6c18eab
2017-07-12 01:29:47 +00:00
Andreas Gampe
afb01e2317 IpSecService: Actually throw exception
Add a missing throw.

Bug: 19797138
Test: m
Test: Device boots
Change-Id: I6c6058ecc95a5b85da43a42bac2846c31cefc038
2017-07-11 14:52:37 -07:00
Nathan Harold
5291cb6004 Check ManagedResource is NonNull before Checking Owner
If an invalid Resource Id is provided to the Managed Resource
Array getter, we should just return null rather than asserting
the owner of the resource.

Bug: none
Test: tbd
Change-Id: I407a96e4e82e9d6bf68e89380a88d3851efe4305
2017-07-06 21:12:38 -07:00
Jeff Sharkey
65501f8094 Only require that system UIDs tag their sockets.
Apps with a normal UID are typically isolated enough to not require
socket tagging; we're mostly interested in tracking down internal
UIDs that have lots of code sharing the same UID.

Also fix up everyone doing manual string checks of Build.TYPE, since
we now have first-class fields for those.

Bug: 38126076
Test: builds, boots
Change-Id: I3a40348196bd8459289f2b9355d9783a07f1e7dd
2017-06-27 11:11:06 -06:00
Jeff Sharkey
8af5ad1575 Allocate well-known tag for app store updates.
This way an app store can shift blame for update-related network
traffic onto the app that is being updated.

Using a well-known tag makes it easy for developers to identify
that they didn't explicitly request the traffic at runtime, similar
to how backup/restore traffic is handled.

Bug: 38282350
Test: builds, boots
Change-Id: I003dd7c9615d4ab318250f1e44fa5d195ac94d23
2017-06-26 19:50:48 -06:00
ludi
bdd5ab8874 Remove return value of ipSecAddSecurityAssociation
Bug:38350493

Test: runtest frameworks-net

Change-Id: I48f8462d94e8c4e95d6766c1ce7f24b8a596b743
2017-06-07 15:26:50 -07:00
Etan Cohen
6d7f581187 [P2P] Add binder to service calls
Bug: 33040182
Test: unit tests, run-time behavior
Change-Id: Ic383efc858bb4454d99c98ab24365c63ad3e7f54
2017-06-06 17:23:44 +00:00
Jeff Sharkey
96d9849a0a Merge "Annotate @SystemApi with required permissions." into oc-dev am: c1406978a4
am: 4786aec7cc

Change-Id: Ib629e25dbf047c110feaf03e4ff744b5c6df9aeb
2017-06-06 15:48:24 +00:00
Jeff Sharkey
4786aec7cc Merge "Annotate @SystemApi with required permissions." into oc-dev
am: c1406978a4

Change-Id: I305967cad945a807c3f8234efabaad0ef8b591d1
2017-06-05 22:28:21 +00:00
Jeff Sharkey
ad1cebe58e Annotate @SystemApi with required permissions.
Most @SystemApi methods should be protected with system (or higher)
permissions, so annotate common methods with @RequiresPermission to
make automatic verification easier.

Verification is really only relevant when calling into system
services (where permissions checking can happen on the other side of
a Binder call), so annotate managers with the new @SystemService
annotation, which is now automatically documented.

This is purely a docs change; no logic changes are being made.

Test: make -j32 update-api && make -j32 offline-sdk-docs
Bug: 62263906
Change-Id: I2554227202d84465676aa4ab0dd336b5c45fc651
2017-06-05 13:27:11 -06:00
nharold
8df1bad599 Merge "Add UDP Encap Socket Support to IpSecManager" am: 4f6ec3d11d am: c530c01744 am: 3c1484c715
am: 834637a824

Change-Id: Iafed2773a6d32542b051d944341533b2190aa284
2017-06-03 00:15:53 +00:00
nharold
834637a824 Merge "Add UDP Encap Socket Support to IpSecManager" am: 4f6ec3d11d am: c530c01744
am: 3c1484c715

Change-Id: Idc082c1ab2aac63ad61e5fc74be7fa75cf6e686f
2017-06-03 00:04:41 +00:00
Nathan Harold
8086539071 Add UDP Encap Socket Support to IpSecManager
-Implement the UdpEncapsulationSocket
-Convert all ManagedResources to use resourceIds
-Rework ManagedResource to track resourceIds

Bug: 30984788
Test: cts - IpSecManagerTest#testUdpEncapsulation()

Change-Id: I7b1099c487051a8d951c1485791c4b6cef2deb1d
2017-06-02 03:18:56 +00:00
Jack Yu
eab8084104 Merge "Added video calling data usage per-uid support" am: 4a98eb7208 am: 2f74c02826 am: ce10610a9c
am: 47ab7cc247  -s ours

Change-Id: I63e6eac2b46aad6999307833b79bf6032a0721fd
2017-06-01 06:00:59 +00:00
Jack Yu
47ab7cc247 Merge "Added video calling data usage per-uid support" am: 4a98eb7208 am: 2f74c02826
am: ce10610a9c

Change-Id: I0a068e0eb7e833ad28611cf2be1a8bc18d99830a
2017-06-01 05:53:47 +00:00
Treehugger Robot
4a98eb7208 Merge "Added video calling data usage per-uid support" 2017-05-31 21:33:57 +00:00
Jack Yu
955599c547 Added video calling data usage per-uid support
Now the VT call data usage will be counted under
current dialer's data usage as well as the total
device data usage.

Test: Manual
bug: 37671326

Merged-In: I8351e9ae17c84210f7ca6c319d3bddcbb0043341
Change-Id: I8351e9ae17c84210f7ca6c319d3bddcbb0043341
2017-05-31 12:37:24 -07:00
Jack Yu
797af1d030 Added video calling data usage per-uid support
Now the VT call data usage will be counted under
current dialer's data usage as well as the total
device data usage.

Test: Manual
bug: 37671326

Change-Id: I8351e9ae17c84210f7ca6c319d3bddcbb0043341
2017-05-30 16:04:00 -07:00
Hugo Benichi
651f902204 Merge changes If4deb106,Ib25d7658 am: 0388f0e47b am: 41a57af66a am: ae278410f5
am: 2b9c0de7d3

Change-Id: Id592d287a92c89320a682d660792b9b6c67e7563
2017-05-26 01:04:44 +00:00
Hugo Benichi
2b9c0de7d3 Merge changes If4deb106,Ib25d7658 am: 0388f0e47b am: 41a57af66a
am: ae278410f5

Change-Id: I4fa34b647e7b2408d4493cfb148ae7d8c24bd6e8
2017-05-26 00:58:27 +00:00
Hugo Benichi
f60833507e NsdService: do not use ContentResolver directly
This patch changes NsdService to call registerContentObserver in the
ContentResolver class indirectly through NsdSettings.

This allows to easily intercept it and mock it in unit tests, and solves
test failures on the internal master branch where
registerContentObserver uses final or static methods that cannot be
worked around.

Bug: 32561414
Bug: 62044295
Test: runtest -x frameworks/base/tests/net/../NsdServiceTest.java
Change-Id: If4deb106de551746babb70196b20f21ece478850
2017-05-26 07:18:15 +09:00
Hugo Benichi
c52f403933 Merge "NsdServiceInfo: move test to tests/net" am: 48859e01d5 am: 1b0f4bf606 am: e8c2700519
am: ca4c03dbb0

Change-Id: I11af75ab8ebc4081cc90d29b83d8a1742f00a3ab
2017-05-25 01:18:45 +00:00
Hugo Benichi
ca4c03dbb0 Merge "NsdServiceInfo: move test to tests/net" am: 48859e01d5 am: 1b0f4bf606
am: e8c2700519

Change-Id: I44cae417fcddad72c13938b6fb751de6ed784046
2017-05-25 01:12:51 +00:00
Hugo Benichi
298ac9487e NsdServiceInfo: move test to tests/net
This patch also
  - adds a license plate to NsdServiceInfoTest
  - fixes some formatting and style issues
      package name
      uses of canonical junit asserts
  - update NsdServiceInfoTest to not use the deprecated AndroidTestCase

Bug: 62044295
Bug: 32561414
Test: $ runtest frameworks-net passes
Change-Id: Ie5ebb00172aef4eec19e6ecd2b41c4467901b93d
2017-05-24 16:03:43 +09:00
Hugo Benichi
ecea72cfca NsdService: simple cleanups
This patch replace some SparseArray<Integer> with SparseIntArray, and
simplify a value lookup function by using indexOfValue().

Test: TODO
Bug: 37013369, 33298084
Bug: 38503832

(cherry picked from commit d2552aee11)

Change-Id: Ifbe4f01bad8964e6f3a6e9633415959ab5feb0af
2017-05-23 12:54:00 +09:00
Hugo Benichi
c0a215d1ad NsdService: test coverage for client requests.
Adding coverage for:
  - NsdManager client disconnection
  - in-flight request GC

Test: new test passes
Bug: 37013369, 33298084
Bug: 38503832

(cherry picked from commit 4dd4db7720)

Change-Id: I02aca772d88306acae09db739ced7a2b1119b72b
2017-05-23 12:53:55 +09:00
Christopher Tate
fde4caf456 Be resilient to restoring unintelligible network templates
Some OEMs have introduced incompatible network bookkeeping.  We now
detect and ignore those network definitions at restore time.

In addition, we now

  * log when an undefined network match type is used to construct a
    NetworkTemplate instance, and
  * quietly refuse to match such a NetworkTemplate against any known
    network identifier, rather than crashing the inquiring app.

Bug 38151335
Test: manual

Change-Id: I565b6f6b87df1f13a8c0c01ae6049bda270b1e48
2017-05-17 10:33:01 -07:00
Hugo Benichi
85c377405c Merge "NetworkStatsFactory: no double looping on stats + stacked interfaces" am: b884b37cea am: cd6537edb5 am: b323e61584
am: 1f27dba36f

Change-Id: I175ffaae545d88b7bc39ab01ab3a811af7e03d60
2017-05-10 09:30:01 +00:00
Hugo Benichi
1f27dba36f Merge "NetworkStatsFactory: no double looping on stats + stacked interfaces" am: b884b37cea am: cd6537edb5
am: b323e61584

Change-Id: I0312882bb8885aaa65f99a445fd0554d6ac054b3
2017-05-10 09:20:04 +00:00
Hugo Benichi
cb4e4db083 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" into oc-dev am: f37b271894 -s ours
am: f2daafb681  -s ours

Change-Id: Ia2b1ca862959fb685e6595f41dbfb130cdad6009
2017-05-10 08:49:28 +00:00
Hugo Benichi
f2daafb681 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" into oc-dev
am: f37b271894  -s ours

Change-Id: I28f139b2bc5a42eed4caf01bea7a1a9426a91625
2017-05-10 08:38:56 +00:00
Hugo Benichi
b884b37cea Merge "NetworkStatsFactory: no double looping on stats + stacked interfaces" 2017-05-10 08:19:33 +00:00
Hugo Benichi
cab3546780 Merge "NsdService: more cleanups" am: cfd9a290ef am: 49bc06d0f9 am: ea0d4a65f9
am: 9e0bb312f8

Change-Id: If7fe9be600285f70b24de6ad97895555157a6a6a
2017-05-10 02:23:01 +00:00
Hugo Benichi
c1781e6e5e Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: 5a015facd7

Change-Id: I97d5fcc43d6f11c05b74b29ebf3182a3ea7198c5
2017-05-10 02:12:15 +00:00
Hugo Benichi
e8a2ba93eb Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp
am: f8dbdba5a2

Change-Id: Ie09f2b4e04749e61923781f4b13e796054108fad
2017-05-10 02:06:06 +00:00
Hugo Benichi
9e0bb312f8 Merge "NsdService: more cleanups" am: cfd9a290ef am: 49bc06d0f9
am: ea0d4a65f9

Change-Id: I547138d0f45e621b583cbcc8a4ed5ab334bd4471
2017-05-10 01:15:30 +00:00
Android Build Merger (Role)
5a015facd7 Merge "Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88 am: 1697d48faf" into oc-dev-plus-aosp 2017-05-10 00:47:39 +00:00
Hugo Benichi
bca6c822ff Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88
am: 1697d48faf

Change-Id: I8b0cf31ef356aae9992f893ca35001d048999519
2017-05-10 00:44:51 +00:00
Hugo Benichi
286734b834 Merge "NetworkStatsFactory: fix double accounting on IPv6 only networks" am: ce730270bc am: 76dc14ec88
am: 1697d48faf

Change-Id: I7dbfe3c96678e2325eb533f31523ad10d861ad02
2017-05-10 00:40:28 +00:00