Commit Graph

1911 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c9fc125bb4 Add DhcpServer
This first version can serve discover/request/release, although there
are some small behavior changes with current implementation which will
be addressed later.

Also removes final modifiers on start() and stop() in FdEventsReader, to
allow mocking the methods in tests with the current mockito lib.

Test: Added tests pass, manual: flashed a device using the server
Change-Id: I025366ff7d51c4ba31152af50f3dd2b5e280a54d
2018-08-28 12:50:47 +09:00
Remi NGUYEN VAN
7994a8e9e1 [automerger skipped] Merge "Fix testRegisterUsageCallback failure in setUp" am: 3e4562b391 am: 7026ccd445
am: 172c9ae72a  -s ours

Change-Id: I6ac57830e6c5669f24d7b2195632f578e2c7fb84
2018-08-17 02:15:34 -07:00
Remi NGUYEN VAN
172c9ae72a Merge "Fix testRegisterUsageCallback failure in setUp" am: 3e4562b391
am: 7026ccd445

Change-Id: I5723e356d1b6aa1a71ba693598a5796900fd9ddc
2018-08-17 02:02:08 -07:00
Remi NGUYEN VAN
7026ccd445 Merge "Fix testRegisterUsageCallback failure in setUp"
am: 3e4562b391

Change-Id: I516bab9b9b6c5f48845f18d0e2ab8b47f0f809de
2018-08-17 01:48:48 -07:00
Remi NGUYEN VAN
3e4562b391 Merge "Fix testRegisterUsageCallback failure in setUp" 2018-08-17 01:51:10 +00:00
Mathew Inwood
8825a29f2a [automerger skipped] Merge "Add @UnsupportedAppUsage annotations" am: 90660f8990 am: 7a5bf4e2dd
am: add296617f  -s ours

Change-Id: Ic0cc520e264f50d8425af1a026e109a96d5cd534
2018-08-16 04:09:37 -07:00
Mathew Inwood
d66eff2c34 [automerger skipped] Merge "Add @UnsupportedAppUsage annotations" am: d08509363c am: d825eeefa4
am: b5d1f26d20  -s ours

Change-Id: I9e06fc4bfabad995970d93b3ed281bd688f795a6
2018-08-16 03:36:28 -07:00
Mathew Inwood
add296617f Merge "Add @UnsupportedAppUsage annotations" am: 90660f8990
am: 7a5bf4e2dd

Change-Id: I99215dd5430968df2e2dd514d21b396b00c1403e
2018-08-16 03:29:58 -07:00
Mathew Inwood
b5d1f26d20 Merge "Add @UnsupportedAppUsage annotations" am: d08509363c
am: d825eeefa4

Change-Id: I52585645e23519cfc6d216e344710ad76aeea9e8
2018-08-16 03:10:41 -07:00
Mathew Inwood
7a5bf4e2dd Merge "Add @UnsupportedAppUsage annotations"
am: 90660f8990

Change-Id: I8f8c9106b494caa6dc5ad405111f2a285a01e49f
2018-08-15 10:12:01 -07:00
Mathew Inwood
90660f8990 Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 15:41:26 +00:00
Mathew Inwood
d825eeefa4 Merge "Add @UnsupportedAppUsage annotations"
am: d08509363c

Change-Id: I380a6ba241998dbc694716986521dfcbf66fa7d2
2018-08-15 07:57:40 -07:00
Mathew Inwood
98639c2c19 Merge "Add @UnsupportedAppUsage annotations" 2018-08-15 11:36:32 +00:00
Mathew Inwood
ce3a48c05f Add @UnsupportedAppUsage annotations
For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: Ie25423113ee1a8071cd5039382c00de6ce0af7fd
Merged-In: I520be7a4c79e68310c12e4f55bf66acaa94145a1
2018-08-14 14:44:29 +01:00
Mathew Inwood
ac005192ea Add @UnsupportedAppUsage annotations
For packages:
  android.net.wimax
  android.net.wifi.p2p.nsd
  android.net.wifi.p2p
  android.net.wifi.hotspot2.pps
  android.net.wifi.hotspot2.omadm
  android.net.wifi.hotspot2
  android.net.wifi.aware
  android.net.wifi
  android.net.util
  android.net.sip
  android.net.rtp
  android.net.nsd
  android.net.metrics
  android.net.lowpan
  android.net.http
  android.net.captiveportal
  android.net

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I520be7a4c79e68310c12e4f55bf66acaa94145a1
2018-08-14 14:39:24 +01:00
Mathew Inwood
cf9b6cd10a Add @UnsupportedAppUsage annotations
For packages:
  android.app.usage
  android.app.trust
  android.app.timezonedetector
  android.app.timezone
  android.app.timedetector
  android.app.job
  android.app.backup
  android.app.assist
  android.app.admin
  android.app

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I5d15d50344d7178617418846917f693cfabf006b
Merged-In: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
2018-08-14 14:25:44 +01:00
Mathew Inwood
ed334ebbd1 Add @UnsupportedAppUsage annotations
For packages:
  android.app.usage
  android.app.trust
  android.app.timezonedetector
  android.app.timezone
  android.app.timedetector
  android.app.job
  android.app.backup
  android.app.assist
  android.app.admin
  android.app

This is an automatically generated CL. See go/UnsupportedAppUsage
for more details.

Exempted-From-Owner-Approval: Mechanical changes to the codebase
which have been approved by Android API council and announced on
android-eng@

Bug: 110868826
Test: m
Change-Id: I618c5dc4462ae990d9df45c3e9ed3f092cc5138c
2018-08-14 14:17:44 +01:00
Remi NGUYEN VAN
2d18dc94ac Fix testRegisterUsageCallback failure in setUp
LocalServices.addService in NetworkStatsService is currently failing
with IllegalStateException "Overriding service registration". Setting up
LocalServices in the test to avoid this issue might be possible, but
moving the registration to the only non-test caller of that constructor
as done here solves the issue and avoids side-effects from a constructor.

Test: atest FrameworksNetTests does not choke on this test
Bug: b/78487385
Bug: b/80082746
Change-Id: I5dba98fc79aec0800c8b71e6c7e23d1cfbcae852
Merged-In: I884a7a8bd7db3fcd220b785ba9914ac8c77720f0
(Clean cherry-pick of go/ag/4061255)
2018-08-14 18:14:09 +09:00
Brett Chabot
02532fc4c2 Migrate frameworks/base/services/tests/servicestests to androidx.test
See go/jetpack-test-android-migration

cherrypicked from ag/4608401

Test: atest FrameworksServicesTests
Change-Id: I2d9641c681489135aa3167bb4c9b1296a1a6a4f7
2018-08-10 14:04:11 -07:00
android-build-team Robot
f540f847b8 Snap for 4916303 from c134e24a77 to pi-qpr1-release
Change-Id: Ib3033bf0876b52d2d579359681ff542d0bf34b7d
2018-07-27 03:13:32 +00:00
kopriva
5ea1eb31f0 docs: added Android P behavior change note to untagSocket reference am: c134e24a77
am: bc81ceab91

Change-Id: Ib4bb5d2d1b3f33bab69b5e109b23978a5f90da13
2018-07-26 17:25:49 -07:00
kopriva
bc81ceab91 docs: added Android P behavior change note to untagSocket reference
am: c134e24a77

Change-Id: I814224210475078c4ab01f53e42202a538c8a444
2018-07-26 17:17:16 -07:00
kopriva
c134e24a77 docs: added Android P behavior change note to untagSocket reference
staged here:
https://android-dot-devsite.googleplex.com/reference/android/net/TrafficStats#untagSocket(java.net.Socket)

Test: make ds-docs

Exempt-From-Owner-Approval: Docs-only change

Bug: 110484513
Change-Id: I24575e6f4451a019b60c5bf60e17e14a928c6cc3
2018-07-26 20:29:39 +00:00
Chiachang Wang
a9e29d059c [automerger skipped] Merge "DO NOT MERGE: use legacy way to get tcp packet count" into pi-dev am: 15cbfefb03
am: 7821223c41  -s ours

Change-Id: Ic8146ca44a5731d2ec1d7658274e5353434da908
2018-07-22 19:01:52 -07:00
Chiachang Wang
7821223c41 Merge "DO NOT MERGE: use legacy way to get tcp packet count" into pi-dev
am: 15cbfefb03

Change-Id: I7d0498bece672a482e2204424ca5d7780a6c7dc8
2018-07-22 18:57:43 -07:00
Neil Fuller
8b95a1f8f7 Merge "Track constructor changes in libcore/" am: f94eb29500 am: 33a26e3ee4
am: fa52de540c

Change-Id: I7e7115799180d17e4ad6468e155aed79fc8600cb
2018-07-05 05:34:45 -07:00
Neil Fuller
fa52de540c Merge "Track constructor changes in libcore/" am: f94eb29500
am: 33a26e3ee4

Change-Id: I1205219e1fead95ecdb8f9ce5d503ec416baf4c2
2018-07-05 05:25:35 -07:00
Neil Fuller
33a26e3ee4 Merge "Track constructor changes in libcore/"
am: f94eb29500

Change-Id: I344d9210bd173f78651318366c852f65afe969d6
2018-07-05 05:14:26 -07:00
Neil Fuller
4b6b8dee0d Track constructor changes in libcore/
The 2-arg constructor is being removed.

Test: build / boot
Bug: 111055375
Change-Id: I72413a8c7885f9514a88f59deb649fa755deff92
2018-07-03 19:22:45 +01:00
junyulai
0b4a66a1c2 DO NOT MERGE: use legacy way to get tcp packet count
The current networkStats getIfaceStats implementation check if
bpf is enabled, and use bpf to get all traffic stats. However,
the bpf implementation did not contain tcp packet counts. So
data stall detection in DcTracker could not get the packet
count to trigger data stall. Hence the data stall never
triggers for device that enables bpf.

This solution is for short term solution that rollback the
design to use xt_qtaguid for bpf enabled device.

Bug: 110443385
Test: 1. fake data stall to trigger data stall recovery
      2. enable debug log to make sure tcp packet count is
         correct
      3. runtest frameworks-net
      4. run cts -m CtsUsageStatsTestCases

Change-Id: I1ce9e92fe194da2ea0a3eec014fd50bb50cdd44a
2018-06-26 15:46:48 +08:00
Nathan Harold
ebe4aa77d4 Merge "Disable the AppOp Restriction for IpSec Tunnels" into stage-aosp-master am: bda7c96038
am: 48474a78ad

Change-Id: Idb6ff2adc72d0a293e1d99c287d0df68df88fe79
2018-06-09 09:43:53 -07:00
Nathan Harold
48474a78ad Merge "Disable the AppOp Restriction for IpSec Tunnels" into stage-aosp-master
am: bda7c96038

Change-Id: I98f2a964b3035daf93b54dc2b72561b16d2ded92
2018-06-09 09:25:32 -07:00
Xin Li
e7e5a5a0db Skip ef9f2740a7 in proposed pi-dev-plus-aosp-without-vendor merge. am: 97b2524e94
am: a2734cfc87

Change-Id: Iec38af6624b30fcdcef4a6b3df45033eb3e15588
2018-06-09 05:49:22 -07:00
Xin Li
a2734cfc87 Skip ef9f2740a7 in proposed pi-dev-plus-aosp-without-vendor merge.
am: 97b2524e94

Change-Id: I1a6504799a83d2736881b149a5181e78bc212193
2018-06-09 02:18:01 -07:00
nharold
995534e7a9 [automerger skipped] Merge changes from topic "ipsec-sync-with-pi" am: a8cfde3d35 am: ef9f2740a7 -s ours
am: 46744cdd5d

Change-Id: I19c12917e4048eba6cb1552fa176e2ad1a2571a4
2018-06-08 18:39:08 -07:00
nharold
46744cdd5d [automerger skipped] Merge changes from topic "ipsec-sync-with-pi" am: a8cfde3d35
am: ef9f2740a7  -s ours

Change-Id: Ib18c4a534b8b1f611d0d5b02897afe73055fed6e
2018-06-08 18:31:25 -07:00
Nathan Harold
7c250aedb1 Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Manually merging this due to skipping a merge
conflict at ef9f2740a790feceaa47a24b1a179e93c4ffb5e6

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-08 23:23:04 +00:00
Xin Li
97b2524e94 Skip ef9f2740a7 in proposed pi-dev-plus-aosp-without-vendor merge.
Bug: 79597307
Change-Id: I8ac04fdd94b069434e2f00b0bfab63eb916f6129
2018-06-08 14:36:00 -07:00
nharold
a8cfde3d35 Merge changes from topic "ipsec-sync-with-pi"
* changes:
  Disable the AppOp Restriction for IpSec Tunnels
  Rework Exception Handling for IpSecManager
  Update IpSecManager to use InetAddress and prefixLen
  Add AppOps Checks for MANAGE_IPSEC_TUNNELS
  Add MANAGE_IPSEC_TUNNELS Permission
2018-06-08 17:07:11 +00:00
Nathan Harold
147f7386da Disable the AppOp Restriction for IpSec Tunnels
This CL temporarily removes the AppOp restriction
that disallows creation of IpSec tunnels due to
the lack of the appropriate AppOp in AOSP/master.
When the relevant framework merges out to master,
this CL should be reverted.

Bug: none
Test: compilation
Change-Id: Ic06c193f85f6bcdd0ead4238825c1add78703cde
2018-06-07 18:44:34 -07:00
Nathan Harold
d21e909fd3 Rework Exception Handling for IpSecManager
In order to properly support EOPNOTSUPP this CL
applies a consistent approach to handling Exceptions.
Hereafter, all exceptions that aren't of a special
method-specific type (such as SpiUnavailableException)
will all be returned to the calling process unchanged.
At the API call site, the ServiceSpecificException,
which is really an Errno, will be inspected and either
converted to an unchecked exception for types we know,
or it will be converted to an IOException in cases where
that method can return a checked exception. In cases
where we do not expect an errno, we will simply throw
a generic RuntimeException. This means all API calls
will now properly throw UnsupportedOperationException
and may be CTS tested accordingly.

Bug: 72420898
Test: runtest frameworks-net
Merged-In: I4a00e221618896223fcdb4b4279fb14cd14e34d8
Change-Id: I4a00e221618896223fcdb4b4279fb14cd14e34d8
(cherry picked from commit beed0b61b7)
2018-06-07 18:42:52 -07:00
Benedict Wong
b25e678b4b Update IpSecManager to use InetAddress and prefixLen
LinkAddress constructors are currently @hide; this change updates
IpSecManager to use InetAddress and prefixLen, and then construct a
LinkAddress internally. LinkAddress is used over the binder interface to
IpSecService to ensure validity.

Bug: 77528639
Test: CTS, Java unit tests ran on walleye
Merged-In: I19e124adef6d9f4992d8293db3190bcf74c95848
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
(cherry picked from commit d39837f7e2)
2018-06-07 18:42:52 -07:00
Nathan Harold
cac8775b2a Add AppOps Checks for MANAGE_IPSEC_TUNNELS
Adds support for a new AppOp to permit services to
use IpSec tunnel mode. The IpSecService now needs
a context so change the service mode to a cached
service rather than a static service.

Bug: 66955045
Test: runtest frameworks-net
Merged-In: I17a4a286225b432c3e15ea1587d946189931b4f4
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
(cherry picked from commit 65ef843176)
2018-06-07 18:42:52 -07:00
Nathan Harold
b9df8b1fca Add MANAGE_IPSEC_TUNNELS Permission
Add a new MANAGE_IPSEC_TUNNELS permission and
protect all IPsec Tunnel mode APIs with it.
This permission is only granted to the system or
through an AppOp.

Bug: 66955045
Test: compilation
Merged-In: I0f618373b500c493ef2211bece681f74652a1833
Change-Id: I0f618373b500c493ef2211bece681f74652a1833
(cherry picked from commit 00e77247eb)
2018-06-07 18:42:52 -07:00
Remi NGUYEN VAN
47df8a66e4 Merge "Fix testRegisterUsageCallback failure in setUp" 2018-05-31 00:05:53 +00:00
Chenbo Feng
1966722418 [automerger skipped] Merge "Check for bpf support at NetworkStatsService start" am: 0defa6e72c am: 8196301e24 -s ours
am: 5e006b9300  -s ours

Change-Id: I744e7fd2e6e8d4a68404c7a9d924da321ff94ba0
2018-05-30 15:32:01 -07:00
Chenbo Feng
5e006b9300 [automerger skipped] Merge "Check for bpf support at NetworkStatsService start" am: 0defa6e72c
am: 8196301e24  -s ours

Change-Id: I4b8e1669b80040287dd96423e8384e189db4af2d
2018-05-30 15:17:21 -07:00
Chenbo Feng
2cb46550f7 Check for bpf support at NetworkStatsService start
The current implementation check for bpf map existance whenever a
NetworkStats request comes in. The check is not efficient and may
require additional permission for threads. So a member variable is added
to NetworkStatsService to store the bpf configuration status and is
initialized when NetworkStatsService start.

Test: -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
      -m CtsUsageStatsTestCases -t android.app.usage.cts.NetworkUsageStatsTest
Bug: 79994577

Change-Id: I872ae18fb3e9631a4e6c4d773fefbba32e60a03b
Merged-In: I872ae18fb3e9631a4e6c4d773fefbba32e60a03b
2018-05-30 18:15:25 +00:00
android-build-team Robot
a858ecf2a0 Snap for 4801384 from b82d3d7e741ff8fe6bf7d1cae79d519fe4922d9a to pi-release
Change-Id: I43f3badb9f29c0d8d748b896eb3d83cf740a8d49
2018-05-24 07:26:26 +00:00
Jeff Sharkey
d811e74b93 Merge "Last-ditch clamping of negative NetworkStats." into pi-dev am: 0026f5eb18
am: eecce38819

Change-Id: I572ef538dafb59d8947958df8eac155e890d08f0
2018-05-23 17:43:05 -07:00