Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge changes I4c26aea7,I79911434 into pi-dev
* changes:
  Check mOwnedByTransform to avoid DELSA on SPI
  Expose add/removeAddress for IpSecInterfaces

Nathan Harold   authored and   Android (Google) Code Review   commited 2018-03-21 20:59:02 +00:00
4f1703787d
Merge "Added implementation for VTI add/remove address" into pi-dev
Benedict Wong   authored and   Android (Google) Code Review   commited 2018-03-21 17:03:52 +00:00
d99c2eb909
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
Merged-In: I79911434f9baa660e4d8564cc59d80da4a710c42
Change-Id: I79911434f9baa660e4d8564cc59d80da4a710c42
(cherry picked from commit a83601a511c3f11470109d78d1a736acdb9c6bd8)

Nathan Harold   commited 2018-03-20 16:01:28 -07:00
49cd8d7268
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
Merged-In: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
Change-Id: Idde9d943a5285d2c13c5c6b0f7b8a9faf718e6a5
(cherry picked from commit ecc9f7cc08804e3fa15fea04ae94ea1bc74edbfe)

Benedict Wong   authored and   Nathan Harold   commited 2018-03-20 16:01:27 -07:00
97c3c945d7
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)

Benedict Wong   commited 2018-03-20 12:34:52 -07:00
778327e548
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)

Nathan Harold   commited 2018-03-16 17:46:05 -07:00
e3536f066d
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

Jeff Sharkey   commited 2018-02-23 16:27:39 +00:00
1459069bb6
Merge "Copy IpSecConfig when IpSecTransforms are created" am: 2c8456b22e am: 3988c929ad
am: 4aa9fef2fc

Change-Id: I511e6b0cadfc24f24a492ae63c48a8b4baa89edb

Benedict Wong   authored and   android-build-merger   commited 2018-02-15 06:01:49 +00:00
5e58ea8a2f
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

Benedict Wong   commited 2018-02-13 23:23:13 +00:00
e5623e2b61
Merge "Require NETWORK_STACK Permission for IpSec Tunnel Mode" am: 43699e90f3 am: e736f83caf
am: 34c6697356

Change-Id: Ib33ccecfe2fc600c05a208d24df10a474addb0e5

nharold   authored and   android-build-merger   commited 2018-02-10 02:11:15 +00:00
c40b5fb671
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

Nathan Harold   authored and   nharold   commited 2018-02-08 21:16:51 +00:00
025aae1fc9
Merge "Enable multiple active Ethernet interfaces" am: cbcc1d6665 am: ac908d6728
am: f4c6c808a2

Change-Id: Ibd84c2ba3252e3d65ba4a63a0be912747ea18df9

Pavel Maltsev   authored and   android-build-merger   commited 2018-02-04 01:06:51 +00:00
f8505b7fae
Merge "Enable multiple active Ethernet interfaces"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-02 23:13:54 +00:00
cbcc1d6665
Merge "Return non-negetive value in getMobileStats method" am: 9fb04e29e5 am: 515a54a93e
am: 4ae5e0c06c

Change-Id: I304f42d473289ad876f6ceae8d6866e4248686a9

Chenbo Feng   authored and   android-build-merger   commited 2018-02-02 17:59:53 +00:00
c2a2f738ba
Merge "Return non-negetive value in getMobileStats method"
Treehugger Robot   authored and   Gerrit Code Review   commited 2018-02-02 04:22:34 +00:00
9fb04e29e5
Merge "Fix minor bugs with tunnel mode implementation" am: cb9cd96c50 am: b7afa3f6fb
am: 25cb38a9b7

Change-Id: Ie74c4edcc7586e0220ff948222010e126841e8f7

Benedict Wong   authored and   android-build-merger   commited 2018-02-01 04:12:18 +00:00
04514d3e4b
Fix minor bugs with tunnel mode implementation
This change makes sure tunnel mode transforms are properly activated
upon construction, and corrects bugs with how policy selectors were being
generated for tunnel mode policies. Specifically, the source/destination could
not be empty strings, even for cases where an empty selector was desired.

Bug: 72457770
Test: GTS tests run
Change-Id: I9a9f64c34b07883a02a5c996614f958486d214fc

Benedict Wong   commited 2018-01-31 01:16:53 +00:00
7660370a83
Return non-negetive value in getMobileStats method
The current implementation of getMobileRxBytes and all the similiar
method adds up the return values for multiple calls to getRxBytes so if
all of them return UNSUPPORTED for any reason, getMobileRxBytes() would
return a value such as -3. This behavior is not compliance with the cts
TrafficStatsTest which always assume getMobileRxBytes to return a
non-negetive value. The method now will check tha stats get from
getRxBytes method and add them up only if the stats is valid.

Bug: 72473294
Test: run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
Change-Id: I656970ebc8f6506cf17c4353ad46c0178bb65cfd

Chenbo Feng   commited 2018-01-29 12:19:26 -08:00
905f034c57
Enable multiple active Ethernet interfaces
- add Ethernet interface configurations to config.xml; no vendors can
specify network capabilities (in particular they can mark network as
restricted which make sense for embedded applications + static IP
configuration)
- extend EthernetManager to support multiple interfaces, use interface
name as an identificator
- extend IpConfigStore to store IP configuration based on string
identifier (e.g. ethernet name)

Test: runtest -x frameworks/base/services/tests/servicestests/ -c com.android.server.net.IpConfigStoreTest
Change-Id: Ic1e70003f2380ca8edb4469d6b34e27c5e8cf059

Pavel Maltsev   commited 2018-01-29 10:11:05 -08:00
50ec1f33c6
Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4 am: bbb4b05a64
am: b9d614d4df

Change-Id: Ic554e34d9b16f522156bc7e8b176f96693e8e32c

nharold   authored and   android-build-merger   commited 2018-01-25 07:59:57 +00:00
c20e9c8b4b
Move Keepalive out of IpSecTransform.Builder
The lifecycle of Keepalive offloading is, unfortunately
different from that of an IpSecTransform. Because starting
a keepalive is fundamentally asynchronous, and isn't valid
until after a transform exists, it will now be a separate
optional procedure that may succeed or fail. It remains
linked with a Transform by the need for a Transform to exist
in order to initiate a Keepalive.

Bug: 38350389
Test: compilation
Change-Id: Ia76fccee41f86d694dff436043293d0c0762c041

Nathan Harold   commited 2018-01-24 19:32:04 -08:00
b559164017
Merge "Add TunnelInterface API and KernelResourceRecords" am: e02b700032 am: e1aa92f1c1
am: 5c3eb9ce8e

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 09:54:06 +00:00
45828d7122
Merge "Add xfrm mark in IpSecConfig" am: 6b3456b253 am: 4077e802ad
am: fc2bcb4153

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 09:48:25 +00:00
f86780fa1f
Add TunnelInterface API and KernelResourceRecords
This change adds one KernelResourceRecord type (TunnelInterfaceRecord),
and adds methods for the creation of TunnelInterfaces, as well as the
application of Transforms to the given TunnelInterfaces

As part of the generation of ikeys/okeys, a ReserveKeyTracker manages a
java bitset to avoid collisions and reserve/release keys.

Bug: 63588681
Test: Compiles, CTS, unit tests all pass on AOSP_marlin
Change-Id: I9e9b6455e27073acd4491eae666aa966b3b10e0f

Benedict Wong   commited 2018-01-24 07:24:27 +00:00
8bc907311b
Merge "Add xfrm mark in IpSecConfig"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-24 05:53:29 +00:00
6b3456b253
Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9 am: c2253ff48d
am: 82d8e1a25d

Change-Id: Ia1f81f5696814f5b9479882e1102a5f8508a4512

Benedict Wong   authored and   android-build-merger   commited 2018-01-24 02:58:17 +00:00
7ea128e242
Expose applyTunnelModeTransform as a system API
Simple change to expose systemAPI for applyTunnelModeTransform

Bug: 36033193
Test: All CTS, unit tests passing
Change-Id: I2d857c048bc0dc80c3949387f946b1f5adf0527e

Benedict Wong   commited 2018-01-23 23:25:54 +00:00
03e732a299
Support passing a template to NetworkStatsManager queries.
Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9
Merged-In: Iab4afa26b34544299d2a9c501c1b0feb470e90a9

Lorenzo Colitti   commited 2018-01-23 18:38:48 +09:00
f1b197b23b
Add metered, roaming, and defaultNetwork info to NetworkTemplate.
This will allow data usage clients to query for and receive
callbacks on data usage matching these conditions.

Bug: 35142602
Test: atest FrameworksNetTests
Change-Id: I4d985a2734eeab7ee454c09cc2098b6b3c671c23
Merged-In: I4d985a2734eeab7ee454c09cc2098b6b3c671c23

Lorenzo Colitti   commited 2018-01-23 18:38:48 +09:00
75ec1aed18
Add the defaultNetwork element to the netstats.proto.
This is in its own commit because AOSP has diverged from internal
master.

Bug: 35142602
Test: builds, boots
Change-Id: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379
Merged-In: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379

Lorenzo Colitti   commited 2018-01-23 18:38:48 +09:00
0ba426b8a1
Add getDefaultNetwork to the NetworkStats public API.
This allows an app using the public API to know whether the
traffic in a particular bucket was on the default network
(i.e., the network was selected by the system), or not (i.e.,
the network was selected by the app).

Bug: 35142602
Test: builds, boots
Test: added coverage to NetworkUsageStatsTest CTS test, still passes
Change-Id: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db
Merged-In: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db

Lorenzo Colitti   commited 2018-01-23 18:28:07 +09:00
92a946d09f
Merge "Support passing a template to NetworkStatsManager queries."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2018-01-23 04:02:58 +00:00
1d81c1317f
Merge "Remove obsolete NetworkStats.Entry constructor." am: ebb1d92eb8 am: cdeb50aa48
am: 56cc2e9765

Change-Id: Id6a664fd5ad8c182468b742e810e65afee248ad5

Lorenzo Colitti   authored and   android-build-merger   commited 2018-01-23 02:35:08 +00:00
942df30e22
Merge changes I4d985a27,Ic6f2bc18
* changes:
  Add metered, roaming, and defaultNetwork info to NetworkTemplate.
  Unbreak frameworks-net tests broken by missing libutilscallstack.

Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2018-01-23 00:28:39 +00:00
ecf2a65eb7
Merge "Remove obsolete NetworkStats.Entry constructor."
Lorenzo Colitti   authored and   Gerrit Code Review   commited 2018-01-23 00:15:15 +00:00
ebb1d92eb8
Merge "Rename create/delete transform methods" am: da6956a702 am: 5b71c4a0a5
am: f5aae7f1a3

Change-Id: Ie07b0b608b3dfcbfc4228a15e26fe6f6559315f9

Benedict Wong   authored and   android-build-merger   commited 2018-01-22 20:03:48 +00:00
f9040dea3b
Merge "Rename create/delete transform methods"
Benedict Wong   authored and   Gerrit Code Review   commited 2018-01-22 17:57:15 +00:00
da6956a702
Support passing a template to NetworkStatsManager queries.
Currently, NetworkStatsManager queries and callbacks only allow
selecting network traffic based on network identifiers:
networkType, subscriptionId and networkId.  The code ends up
converting these into a template under the hood.

Now that templates can express more fine-grained queries (e.g.,
select only roaming traffic, or select only traffic that's not
on the default network) add a hidden method to pass in a
template. This should have no security implications, as all the
access controls are performed in NetworkStatsService.

Bug: 35142602
Test: android.app.usage.cts.NetworkUsageStatsTest passes
Change-Id: Iab4afa26b34544299d2a9c501c1b0feb470e90a9

Lorenzo Colitti   commited 2018-01-22 22:30:27 +09:00
81bd73ba98
Add metered, roaming, and defaultNetwork info to NetworkTemplate.
This will allow data usage clients to query for and receive
callbacks on data usage matching these conditions.

Bug: 35142602
Test: atest FrameworksNetTests
Change-Id: I4d985a2734eeab7ee454c09cc2098b6b3c671c23

Lorenzo Colitti   commited 2018-01-22 21:41:20 +09:00
e47bf09f9b
Merge changes from topic "multipath-datausage"
* changes:
  Add the defaultNetwork element to the netstats.proto.
  Add getDefaultNetwork to the NetworkStats public API.

Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2018-01-21 16:07:29 +00:00
d5059166ac
Remove obsolete NetworkStats.Entry constructor.
The only caller is telephony code, and it's being fixed in this
topic.

Bug: 35142602
Test: builds, boots
Change-Id: Ia77a1c2c297037f311c2355610c206cd8e3192c4

Lorenzo Colitti   commited 2018-01-21 23:01:35 +09:00
9ab3929812
Merge "Add Tunnel Interface APIs to IpSecManager" am: a82dbcb3c7 am: 696cff166c
am: e7e979071c

Change-Id: I094751d965b679e85a0f200b2382f1715d69e400

nharold   authored and   android-build-merger   commited 2018-01-19 20:25:18 +00:00
1b818c5bc4
Merge "Add Tunnel Interface APIs to IpSecManager"
nharold   authored and   Gerrit Code Review   commited 2018-01-19 19:43:17 +00:00
a82dbcb3c7
Rename create/delete transform methods
CreateTransportModeTransform and DeleteTransportModeTransform are both
agnostic as far as which mode of transform it creates/deletes. As such,
to facilitate the implementation of tunnel mode, this patch renames them
to CreateTransform and DeleteTransform, along with all test names.

Bug: 63588681
Test: frameworks/base unit tests and CTS tests run, passed
Change-Id: I1f015eb7ad0e85fca966658a9402485ca2b44091

Benedict Wong   commited 2018-01-19 10:43:01 -08:00
0fff56eae5
Add the defaultNetwork element to the netstats.proto.
This is in its own commit because AOSP has diverged from internal
master.

Bug: 35142602
Test: builds, boots
Change-Id: I75fc85b961bc919e3d6c2adce6d6861c6f2c8379

Lorenzo Colitti   commited 2018-01-20 02:26:58 +09:00
76a6f956dd
Add getDefaultNetwork to the NetworkStats public API.
This allows an app using the public API to know whether the
traffic in a particular bucket was on the default network
(i.e., the network was selected by the system), or not (i.e.,
the network was selected by the app).

Bug: 35142602
Test: builds, boots
Test: added coverage to NetworkUsageStatsTest CTS test, still passes
Change-Id: I9f6669908fa119743b9c0aa0c31a03e5ebafa7db

Lorenzo Colitti   commited 2018-01-20 02:26:58 +09:00
b8e79f3312
Merge changes Id8776d14,Ifa291c62,I5ea9d200 am: c48f4cb7f1 am: b36b423230
am: 0d74e0554c

Change-Id: I12108d96e29bfe71406106c2af950a6d6a9f8351

Lorenzo Colitti   authored and   android-build-merger   commited 2018-01-19 16:46:11 +00:00
d99f4ff71f
Track and persist in stats whether traffic is on the default network.
This change adds the defaultNetwork to the ident based on current
system networking state, and persists that value to flash.

Bug: 35142602
Test: runtest frameworks-net
Test: downloaded files using default/non-default networks while watching dumpsys netstats
Change-Id: Id8776d149b2977548a9eb455ad4926af55e25aba

Lorenzo Colitti   commited 2018-01-19 19:49:16 +09:00
ab7807a5bb
Add the default network to NetworkStats and NetworkStatsCollection.
This allows us to maintain NetworkStats entries that track
whether the traffic was on the default network.

At the moment, the stats collection code always passes in
DEFAULT_NETWORK_NO. However, this value is a no-op, since it is
not persisted to disk. Only the ident, the uid/set/tag, and the
packet/byte/operation counters are persisted.

A future change will add defaultNetwork to the ident and start
persisting it.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: Ifa291c62c0fa389b88e5561086a29dcd7cee2253

Lorenzo Colitti   commited 2018-01-19 19:49:16 +09:00
3e85855083
Pass all default networks to NetworkStatsService
This will allow NetworkStatsService to treat traffic on these
networks differently from traffic where the app selects a network
that is not the default.

Bug: 35142602
Test: runtest frameworks-net
Change-Id: I5ea9d200d9fb153490c6108bb9390bf152f297da

Lorenzo Colitti   commited 2018-01-19 16:40:10 +09:00
28d1a529d5