Commit Graph

885 Commits

Author SHA1 Message Date
Di Lu
aa32c400ce Merge "Add user quota information into the IpSecService dump" am: fedd856546 am: 318ca31081
am: 759696c47c

Change-Id: I8f958d4967e02a58d8baf7b4a4058cf15ca50cc6
2017-08-16 17:12:05 +00:00
Di Lu
318ca31081 Merge "Add user quota information into the IpSecService dump"
am: fedd856546

Change-Id: I1f64ab03918ece154fe31a07b698825315d39c0f
2017-08-16 16:33:18 +00:00
ludi
529fdecc4c Add user quota information into the IpSecService dump
Bug: 64093788
Test: runtest frameworks-net
Change-Id: I6c5fc9e2db4ba57e0db4f6380a1251c4e444951b
2017-08-14 16:10:55 -07:00
nharold
c83a829a57 Merge "Add UserQuotaTracker to IpSecService" am: a0c97b3ddb am: b1d39a7aff
am: 31e299220a

Change-Id: Icc10cf54879e8f5b103392418edc1947593a8b39
2017-08-09 18:36:13 +00:00
nharold
b1d39a7aff Merge "Add UserQuotaTracker to IpSecService"
am: a0c97b3ddb

Change-Id: I43a9617b077ecd5fc2b445a1ade8b76c00562640
2017-08-09 17:49:42 +00:00
Nathan Harold
6e4681c7e2 Add UserQuotaTracker to IpSecService
Add a small tracking object to enforce maximum
quotas for SPIs, Transforms, and Encap sockets. The
current quota limits are intentionally conservative
with the expectation that we can relax them more
easily than we can shrink them.

Bug: 37688603
Test: tbd
Change-Id: Iee59ac59ef9f4a7ab75a2e04f9ca72da82fc3229
2017-08-08 18:28:47 -07:00
Hugo Benichi
b9d28344e0 Merge "NetworkStats: more robust subtraction for deltas" into oc-dr1-dev
am: 5e24152e33

Change-Id: I2ac0bc3914cb65ae8ee27921856d698dc59624b2
2017-08-08 16:01:07 +00:00
Hugo Benichi
d78311f267 NetworkStats: more robust subtraction for deltas
This patch ensures that subtract() between two NetworkStats object will
return a delta with no negative entries in all cases.

When the stats delta contains some negative values, there are clamped to
0. Some logging is added when this happens.

This is what's expected by NetworkStatsHistory#recordData().

Bug: 64365917
Test: runtest frameworks-net
Change-Id: I16e97e73f600225f80e0ce517e80c07c6f399196
2017-08-08 09:19:05 +09:00
Hugo Benichi
38e4783a60 NsdManager: remove duplicated argument validation
This patch simplifies argument validation in NsdManager public api and
regroup duplicated validation into common methods.

This makes stack traces more actionable as now specific errors will
cause the api to throw exception from specific methods, whereas before
IllegalArgumentException would be thrown from inside the same api method
for different reasons.

This patch also includes a couple of other small cleanups.

Test: $ runtest -x frameworks/base/tests/net/../NsdManagerTest.java
Bug: 37013369

(cherry picked from commit f2c64f8725)

Change-Id: Icf047532aa551fbe0a70721cfb95507eaa84d51e
2017-08-03 14:19:43 +09:00
ludi
16853ff14c Merge "Add dump info to IpSecService" am: ec5fc4872e am: b47cb8b03c
am: c628b22fe5

Change-Id: I1a5d4c424a3c9e1638d86d177cbf98f0d1bce05d
2017-07-25 03:26:23 +00:00
ludi
b47cb8b03c Merge "Add dump info to IpSecService"
am: ec5fc4872e

Change-Id: Idd4c051e4536d32504718fdfd201c7effdeb62e3
2017-07-25 03:07:00 +00:00
ludi
89194d6e45 Add dump info to IpSecService
Bug:38350824

Test: runtest frameworks-net

Change-Id: Ifa11d55e9d337016ad865baada627db3aa8c2db3
2017-07-24 16:03:33 -07:00
Di Lu
cfb337087c Merge "Add unit test for IpSecService" am: 9e3f886dca am: 8cdceb2fed
am: 345db82674

Change-Id: Ia4d85bcf5c42774d7b48cb1cd648754b6dd16b69
2017-07-20 07:50:21 +00:00
Di Lu
8cdceb2fed Merge "Add unit test for IpSecService"
am: 9e3f886dca

Change-Id: I16fb89239e641ac39a8a7adeafd72b7fe03935ed
2017-07-20 07:36:19 +00:00
ludi
5e623eaa02 Add unit test for IpSecService
Test: runtest frameworks-net

Bug:38259578
Change-Id: I4a049d5fdec79e36692e3b12306bd0758c19ad75
2017-07-20 04:26:24 +00:00
Steven Moreland
c79573c26d Merge "frameworks/base: use proper nativehelper headers" am: 826eafd958 am: 4f846495a4
am: c840945a78

Change-Id: I654e14f0d1b495450db81592a2e564e308746350
2017-07-20 03:05:02 +00:00
Steven Moreland
4f846495a4 Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2017-07-20 02:50:53 +00:00
Steven Moreland
881296fa45 frameworks/base: use proper nativehelper headers
libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
2017-07-19 10:06:40 -07:00
nharold
fbdd1f3245 Merge "Launch NetD in a different thread" am: 3608598388 am: e18d235c28
am: cd3633fc01

Change-Id: Ifaaa918e1ade21609ef1615d9315c44d89a23a6d
2017-07-18 22:23:55 +00:00
nharold
e18d235c28 Merge "Launch NetD in a different thread"
am: 3608598388

Change-Id: I0edeac83cc31b7ff9b264c35e225707ebb8418f2
2017-07-18 20:18:10 +00:00
nharold
3608598388 Merge "Launch NetD in a different thread" 2017-07-18 17:56:35 +00:00
Nathan Harold
12accd0d1b Launch NetD in a different thread
Calling run() launches in the current thread;
we want to call start() to launch in a separate
thread to unblock system initialization.

Bug: none
Test: compilation
Change-Id: Ia85059100add6a44a5e3262500b00ba8ca21e125
2017-07-17 20:22:35 -07: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
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
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
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