Commit Graph

1502 Commits

Author SHA1 Message Date
Benedict Wong
778327e548 Add support for auth-only transforms
Kernel limitations prevent auth-only SAs from being created. Explicitly
request a null encryption algorithm instead of omitting the algorithm
to comply with the kernel requirement for ESP.

Bug: 75049573
Test: CTS tests for auth-only, crypt-only transforms added for all
combinations of (UDP, TCP, IPv4, IPv6, UDP-encap) Also added unit
tests to ensure correct triggering of NULL_CRYPT usage.
Merged-In: Ia9a5cfee9c7786412846bc039f326420f6211c08
Change-Id: Ia9a5cfee9c7786412846bc039f326420f6211c08
(cherry picked from commit bf013a3820c69348e034c6340b28e95f3441ebe8)
2018-03-20 12:34:52 -07:00
Nathan Harold
e4a6258658 Expose add/removeAddress for IpSecInterfaces
When exposing the APIs, these were missed.
The outer structure is exposed, so this exposes
the addAddress and removeAddress methods.

Bug: 75234273
Test: compilation
Change-Id: I79911434f9baa660e4d8564cc59d80da4a710c42
2018-03-20 12:32:20 -07:00
Treehugger Robot
22b39848a6 Merge "Add support for auth-only transforms" 2018-03-20 18:36:04 +00:00
Nathan Harold
feebc885a2 Check mOwnedByTransform to avoid DELSA on SPI
The owned by transform flag prevents the removal
of an SPI from accidentally deleting an associated
SA in the kernel. That flag wasn't actually being
checked, so deleting an SPI would result in the
transform being removed.

The existing code already guarantees that the SA is
deleted when the transform is deleted

Bug: 73258845
Test: runtest frameworks-net
Change-Id: I4c26aea7af817a5d9e54da5db1cdf4f943bcae06
2018-03-20 11:26:29 -07:00
Benedict Wong
0fd27deb7f Merge "Added implementation for VTI add/remove address" am: 8c05fd7155
am: 9dda91f806

Change-Id: Idaab45998f4765655bde6cf0274f2ba3c1b3ecf1
2018-03-20 00:09:15 +00:00
Benedict Wong
8c05fd7155 Merge "Added implementation for VTI add/remove address" 2018-03-19 22:05:09 +00:00
android-build-team Robot
c95fa12d4e Snap for 4662252 from c5d0ed9f3c9c7472354b2cd34fb158f72c219b3a to pi-release
Change-Id: Idceaaf72503dfebc1c23739907977c2846c6b734
2018-03-18 07:27:15 +00:00
Nathan Harold
0d6111feab Merge "Docstring Updates for applyTransportModeTransform" into pi-dev
am: 685288127d  -s ours

Change-Id: I98698ebd0a3aa97250274830dadb4c70e41a7e3e
2018-03-17 03:59:36 +00:00
nharold
15c9f6d269 Merge "Docstring Updates for applyTransportModeTransform" am: 00ef20e853
am: e3a6b678c3

Change-Id: I58ab2b451ef1d0c20efe80d30a679e8870a39a8e
2018-03-17 02:16:38 +00:00
Nathan Harold
e3536f066d Docstring Updates for applyTransportModeTransform
-Add anotations to usages of PolicyDirection for
 apply...() methods.
-Update the comments on DIRECTION_IN and DIRECTION_OUT
 to better reflect their current usage.
-Add a better explanation to the rekey procedure doc.
-Remove disused createTunnelInterface() stub.

Bug: 73751066
Test: make docs
Merged-In: I9f2ec864466148a18899f1e952c74a525902ccbc
Change-Id: I9f2ec864466148a18899f1e952c74a525902ccbc
(cherry picked from commit f4cdf25a906d0f52ffd76508d660b843b13b3ff8)
2018-03-16 17:46:05 -07:00
Benedict Wong
2ba4a65fe0 Add support for auth-only transforms
Kernel limitations prevent auth-only SAs from being created. Explicitly
request a null encryption algorithm instead of omitting the algorithm
to comply with the kernel requirement for ESP.

Bug: 75049573
Test: CTS tests for auth-only, crypt-only transforms added for all
combinations of (UDP, TCP, IPv4, IPv6, UDP-encap) Also added unit
tests to ensure correct triggering of NULL_CRYPT usage.
Change-Id: Ia9a5cfee9c7786412846bc039f326420f6211c08
2018-03-16 17:36:59 -07:00
Nathan Harold
e917321c4e Docstring Updates for applyTransportModeTransform
-Add anotations to usages of PolicyDirection for
 apply...() methods.
-Update the comments on DIRECTION_IN and DIRECTION_OUT
 to better reflect their current usage.
-Add a better explanation to the rekey procedure doc.
-Remove disused createTunnelInterface() stub.

Bug: 73751066
Test: make docs
Change-Id: I9f2ec864466148a18899f1e952c74a525902ccbc
2018-03-16 17:29:45 -07:00
Benedict Wong
23b86a6d99 Added implementation for VTI add/remove address
This change adds implementation details for add/remove addresses onto a
VTI.

Bug: 73675031
Test: New tests added, passing on Walleye
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
2018-03-16 10:25:43 -07:00
Remi NGUYEN VAN
4950f3c810 Merge "Allow null subscriberId in NetworkStatsManager." am: 6bd13af46a
am: a6905db1d8

Change-Id: I1e4e283c6eaecf33d12488e41e0c524f6ff83954
2018-03-06 19:52:57 +00:00
Lorenzo Colitti
1546bc83fc Merge "Minor cleanups to NetworkStats interface tracking." am: 6455e31b76
am: 65777e4b61

Change-Id: Ifa76adb79440b1d97c6cfc637509c0ddaefa76fa
2018-03-06 07:47:11 +00:00
Remi NGUYEN VAN
41737af07d Allow null subscriberId in NetworkStatsManager.
Use a MATCH_MOBILE_WILDCARD template to avoid filtering by
subscriberId when querying statistics from NetworkStatsService.

Bug: 74038898
Change-Id: I4b39e7031416cb33b23d89aa36ff0f774eaa942f
Fixes: 74038898
Test: runtest frameworks-net, CTS tests pass
2018-03-06 13:28:19 +09:00
Lorenzo Colitti
8f5d138277 Minor cleanups to NetworkStats interface tracking.
Currently, when a network goes into CONNECTED state, we call
updateLinkProperties and then notifyIfacesChangedForNetworkStats.
The latter is unnecessary, as there are exactly two cases:

1. networkAgent.linkProperties != null: updateLinkProperties will
   call notifyIfacesChangedForNetworkStats, because oldLp is null
   and networkAgent.linkProperties is not null.
2. networkAgent.linkProperties is null: there is no need to call
   notifyIfacesChangedForNetworkStats, because no interfaces were
   added or removed. When they are, updateLinkProperties will be
   called again.

Removing the call to notifyIfacesChangedForNetworkStats avoids
a stats poll, which is a minor performance improvement.

Also, remove the NetworkStatsService code to do asynchronous
interface updates, since it has no callers.

Bug: 72107146
Test: builds, boots
Test: runtest frameworks-net
Change-Id: I9337ea26c0505a1c66ceda01254b68e25cd7972c
2018-03-05 15:48:23 +09:00
android-build-team Robot
90b14389f7 Snap for 4623514 from 3a1b5d186786bf41a73370f31f90033b23a5a70a to pi-release
Change-Id: Ibc8214e4308dcb2cd5a235568017ab2d37db089e
2018-02-27 08:20:48 +00:00
Tetsutoki Shiozawa
3920dd7584 Merge "Definitely abort reconnecting to native daemon during shutdown" am: 65a583bb6a am: 282c038240
am: 31a35289ee

Change-Id: I74677602cd4642c2b441fb353a9f0824a238deae
2018-02-26 08:05:10 +00:00
Tetsutoki Shiozawa
31a35289ee Merge "Definitely abort reconnecting to native daemon during shutdown" am: 65a583bb6a
am: 282c038240

Change-Id: I034072b89d0a8b9362940155ae2e2d173fde1b33
2018-02-26 07:50:37 +00:00
Treehugger Robot
65a583bb6a Merge "Definitely abort reconnecting to native daemon during shutdown" 2018-02-26 06:49:52 +00:00
android-build-team Robot
0962590191 Snap for 4620899 from 55a3fe78c3f642c873193c4fd1cf2fcc1849ea55 to pi-release
Change-Id: Id2dd2991781763dd72552cc35ffb13b7f896a8d6
2018-02-25 08:29:09 +00:00
Jeff Sharkey
1459069bb6 Name specific app for rapid data usage.
When a single app is responsible for more than half of the data usage
that caused us to trigger a "rapid usage" alert, name that app in the
notification.  Tests to verify.

Move NPMS->NSS direct calls to "Internal" pattern, following
best-practices to avoid unnecessary AIDL exposure.

Remove 3G/4G split mobile plan support, which has been deprecated for
years and was never supported in a shipping product.

Move MultipathPolicyTracker in tree to reflect its package name.

Test: bit FrameworksNetTests:*
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69263587, 64221505, 73431080, 72746951
Exempt-From-Owner-Approval: approved in previous PS
Change-Id: I3e4ec1ae2222d51b232f76f32faca93d4f8cd272
2018-02-23 16:27:39 +00:00
android-build-team Robot
3fd05abd0a Snap for 4615953 from 61b44dca6e002389fd75b36d0d04e99294dc1f4a to pi-release
Change-Id: Ice53dcc93d82e4aff6812bf2515db95e757a611b
2018-02-22 08:21:26 +00:00
Jeff Sharkey
ddd09dfbe7 Only emit debug logging when requested.
Test: builds, boots
Bug: 72556865
Change-Id: I69d5d760221ef907eeea38490f56243f0a3b9dcb
2018-02-20 13:36:23 -07:00
android-build-team Robot
4bbdaa182f Snap for 4610834 from ce5665485f to pi-release
Change-Id: I7b18ec81c66b69ff80b795eb26dddf116b0ddf32
2018-02-18 08:27:25 +00:00
Jeff Sharkey
ce5665485f Merge "Leave NetworkStatsService around during shutdown." 2018-02-17 18:16:02 +00:00
Jeff Sharkey
a0626d7f40 Leave NetworkStatsService around during shutdown.
We've seen system code continue to ask about network statistics
during a shutdown, so keep our objects around to avoid crashing
with NPEs.

Test: builds, boots
Bug: 73323432
Change-Id: I2654d37a59eb830ff32a2151ae6ad6a999a41677
2018-02-16 16:28:27 -07:00
Jeff Sharkey
77bd2dfb9f Better handling of NTP-based clocks.
Now that we have a nice Clock abstraction, we can use it to represent
a clock backed by an NTP fix.  (This makes testing logic much easier
to write.)

We now rely completely on NetworkTimeUpdateService to keep our NTP
fix up to date, instead of trying to refresh in the middle of
critical paths which could trigger random ANRs.

Add internal FallbackClock to make it easier to handle missing NTP
fixes.  Add internal SimpleClock to let implementers focus on single
millis() method.

Test: bit FrameworksNetTests:com.android.server.net.NetworkStatsServiceTest
Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 69714690, 72320957
Change-Id: Ic32cdcbe093d08b73b0e4b23d6910b23ea8e1968
Exempt-From-Owner-Approval: approved in previous PS
2018-02-16 22:11:35 +00:00
android-build-team Robot
54e0e968f8 Snap for 4605948 from ce3f5d00f953203442dfbe07841d1c36a4eba00f to pi-release
Change-Id: Ic9f6a9f833e8022a85cc58d0d5ccf9c18e245d01
2018-02-15 08:21:09 +00:00
Benedict Wong
5e58ea8a2f Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e am: 3988c929ad
am: 4aa9fef2fc

Change-Id: I511e6b0cadfc24f24a492ae63c48a8b4baa89edb
2018-02-15 06:01:49 +00:00
Benedict Wong
4aa9fef2fc Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e
am: 3988c929ad

Change-Id: I041cd94be9cefc997b95478444661b557d95e3dc
2018-02-14 21:25:08 +00:00
Benedict Wong
e5623e2b61 Copy IpSecConfig when IpSecTransforms are created
This change prevents IpSecTransforms from being inadvertently modified
by changes to the IpSecConfig. Specifically, once the transform is
created, it takes a copy of the config, rather than a reference.

Bug: 69385347
Test: New tests added, and all test passing
Change-Id: I89b8660c175ca20aa70352dcda893434ff7fd42b
2018-02-13 23:23:13 +00:00
android-build-team Robot
8fa902a066 Snap for 4598635 from 049ecedd92d91fb692ec424311318cd8b8977b0d to pi-release
Change-Id: Ica483c727fc2da3c722fdf11e521fab348e2ac8a
2018-02-11 08:23:00 +00:00
nharold
c40b5fb671 Merge "Require NETWORK_STACK Permission for IpSec Tunnel Mode" am: 43699e90f3 am: e736f83caf
am: 34c6697356

Change-Id: Ib33ccecfe2fc600c05a208d24df10a474addb0e5
2018-02-10 02:11:15 +00:00
nharold
34c6697356 Merge "Require NETWORK_STACK Permission for IpSec Tunnel Mode" am: 43699e90f3
am: e736f83caf

Change-Id: If7330b4fdf5d2ccbddb590ab81a4b19c1f612b66
2018-02-10 01:57:50 +00:00
android-build-team Robot
764b2faea9 Merge cherrypicks of [3594560, 3594912, 3594913, 3594914, 3594915, 3594916, 3594917, 3594918, 3594919, 3594822, 3594823, 3594561, 3594495, 3594496, 3594123, 3594124, 3594125] into pi-release
Change-Id: I8b524220d30725418e1a6dca23c873f41baa2d13
2018-02-09 23:44:11 +00:00
Jeff Sharkey
563017099b Shore up dividing by zero protections.
We're already trying to protect against zero elsewhere in this file,
but we've seen evidence of it still happening, so add last-ditch
protections.

Test: builds, boots
Bug: 73060623
Change-Id: I0549ed08f906521a8dbd9ff6162f80fa9b388434
(cherry picked from commit 1e80651d2a)
2018-02-09 23:43:35 +00:00
TreeHugger Robot
5a89c8e36e Merge "Shore up dividing by zero protections." 2018-02-09 18:54:31 +00:00
Jeff Sharkey
1e80651d2a Shore up dividing by zero protections.
We're already trying to protect against zero elsewhere in this file,
but we've seen evidence of it still happening, so add last-ditch
protections.

Test: builds, boots
Bug: 73060623
Change-Id: I0549ed08f906521a8dbd9ff6162f80fa9b388434
2018-02-09 10:06:59 -07:00
Nathan Harold
025aae1fc9 Require NETWORK_STACK Permission for IpSec Tunnel Mode
At least until further permissions are agreed upon,
the NETWORK_STACK permission is sufficient to ensure
that access to the tunnel mode APIs is secure, and
this permission will always be a sufficient condition.
Thus, adding NETWORK_STACK.

Bug: 66955045
Test: compilation
Change-Id: I2dc36896a52d2e71fad55041507d68ca91191ffc
2018-02-08 21:16:51 +00:00
Andreas Gampe
49ccde2dfb Frameworks: Annotate trivial @GuardedBy in services/core
Add @GuardedBy for simple functions that require a single lock
and are named XYZLocked.

Derived by errorprone.

Bug: 73000847
Test: m
Test: m javac-check-framework RUN_ERROR_PRONE=true
Change-Id: I6993325b11c71a4ec27c21935fb54a954d95455f
2018-02-08 02:19:42 -08:00
android-build-team Robot
3f4a4ee66c Snap for 4585119 from 76be79a7c97064906b58222936c0d9c58eb290c9 to pi-release
Change-Id: Ie04482e204076f9f6230756811fe8f4d4334dd0b
2018-02-05 08:22:26 +00:00
Pavel Maltsev
f8505b7fae Merge "Enable multiple active Ethernet interfaces" am: cbcc1d6665 am: ac908d6728
am: f4c6c808a2

Change-Id: Ibd84c2ba3252e3d65ba4a63a0be912747ea18df9
2018-02-04 01:06:51 +00:00
Pavel Maltsev
f4c6c808a2 Merge "Enable multiple active Ethernet interfaces" am: cbcc1d6665
am: ac908d6728

Change-Id: I95a4e5d519857950297f5948525990c4808cd5fd
2018-02-03 01:25:34 +00:00
Treehugger Robot
cbcc1d6665 Merge "Enable multiple active Ethernet interfaces" 2018-02-02 23:13:54 +00:00
Chenbo Feng
c2a2f738ba Merge "Return non-negetive value in getMobileStats method" am: 9fb04e29e5 am: 515a54a93e
am: 4ae5e0c06c

Change-Id: I304f42d473289ad876f6ceae8d6866e4248686a9
2018-02-02 17:59:53 +00:00
Chenbo Feng
4ae5e0c06c Merge "Return non-negetive value in getMobileStats method" am: 9fb04e29e5
am: 515a54a93e

Change-Id: I54a400b4231c38db25aa1b717f302a8a52e1773e
2018-02-02 17:02:10 +00:00
Treehugger Robot
9fb04e29e5 Merge "Return non-negetive value in getMobileStats method" 2018-02-02 04:22:34 +00:00
android-build-team Robot
7048498b58 Snap for 4579913 from b3dc01059967e42066961931ba6723e3260ba89b to pi-release
Change-Id: Id3bf4f67c62adadf59033e2c7db0fd9e1960948f
2018-02-01 08:55:53 +00:00