Commit Graph

5202 Commits

Author SHA1 Message Date
Bernie Innocenti
825c739486 apf: Add immediate encoding tests for LI
This tests that ApfGenerator knows how to optimally encode positive and
negative immediates of various sizes.

Equivalent tests will follow for LDDW and STDW.

Change-Id: Ia904aecb155c78569e3cf32a2431570281570481
Bug: 73804303
Test: runtest tests/net/java/android/net/apf/ApfTest.java
(cherry picked from commit 18050000d7)
2018-04-24 21:28:49 +09:00
Chalard Jean
26400490a2 Make sure getActiveNetwork is consistent with default callbacks
Bug: 77737389
Test: runtest framework-net
      new test don't pass without the main code change, but they
      do with it
Change-Id: I0cd83a935ab0b349aa47e065b830e5a43ab9a091
2018-04-24 17:32:00 +09:00
Chalard Jean
fb0c87e8b4 Add tests for getActiveNetwork.
Bug: 77737389
Test: runtest frameworks-net
Change-Id: I03ae2bbb08559f2cd44979e291c1f5d50eb215da
2018-04-24 15:23:28 +09:00
Chalard Jean
f0f364f2c5 Let DnsManager fill in LinkProperties for private DNSes
Test: new tests pass
Bug: 73641539
Change-Id: I971ef4d27b22a435d7459e1c4b31a8715ef6e610
2018-04-23 13:58:42 +09:00
TreeHugger Robot
580a1ed904 Merge "Adjust APF interpreter tests to match APFv4" into pi-dev 2018-04-20 11:41:52 +00:00
TreeHugger Robot
f12a2130a4 Merge "Add the list of private DNS addresses to LinkProperties" into pi-dev 2018-04-20 11:23:56 +00:00
Bernie Innocenti
deb145d233 Adjust APF interpreter tests to match APFv4
Change-Id: I4311c754f1cb79633d49c5c1c0b4e27c8dde727e
Bug: 73804303
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
(cherry picked from commit 545d9367e2)
2018-04-20 17:37:09 +09:00
Chalard Jean
9419b11458 Add the list of private DNS addresses to LinkProperties
Test: atest android.net.LinkPropertiesTest, also new tests pass
Bug: 73641539
Change-Id: If33a35b1354a67db09411ff098f20064797296ad
2018-04-20 16:48:43 +09:00
gopinath
21799f8b05 Add more trace categories.
Add tracing for additional filters as well.

Bug : b/78244687, b/78301352

Test: atest hot-nodropcache-stable-test
Change-Id: Ie6fd109b645c92dcfa414e3c41cc5f43032fe6fd
2018-04-20 00:59:12 +00:00
Bernie Innocenti
1b144e6dab Merge "Teach ApfGenerator about the new opcodes for accessing data memory" into pi-dev 2018-04-18 11:26:55 +00:00
Jeff Sharkey
6b64925737 Protect usage data with OP_GET_USAGE_STATS.
APIs that return package usage data (such as the new StatsManager)
must ensure that callers hold both the PACKAGE_USAGE_STATS permission
and the OP_GET_USAGE_STATS app-op.

Add noteOp() method that can be called from native code.

Also add missing security checks on command interface.

Bug: 77662908, 78121728
Test: builds, boots
Change-Id: Ie0d51e4baaacd9d7d36ba0c587ec91a870b9df17
2018-04-16 12:44:32 -06:00
Bernie Innocenti
408dbda4c1 Teach ApfGenerator about the new opcodes for accessing data memory
Bug: 73804303
Bug: 36221302
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
Change-Id: Iaf92ca0bbebaaf66d0f2f7adc1a9014607f3ecf6
(cherry picked from commit a9949e9e25)
2018-04-16 21:22:41 +09:00
Jeff Sharkey
5a8bcd9031 OP_GET_USAGE_STATS should be noted, not checked.
Per email feedback, we should be using "noteOp" instead of "checkOp"
when testing if caller holds OP_GET_USAGE_STATS, so that we record
that caller used the operation.

Bug: 77662908
Test: builds, boots
Exempt-From-Owner-Approval: keep tests passing
Change-Id: I3a60345d590534fdbc2c1248e0d30dc85a5d6772
2018-04-13 19:32:25 +00:00
TreeHugger Robot
878d0e90b5 Merge "Add a new ssid field in NetworkCapabilities." into pi-dev 2018-04-13 08:59:23 +00:00
Chalard Jean
b03a6229b8 Add a new ssid field in NetworkCapabilities.
Bug: 77891227
Test: frameworks-net
Change-Id: Ifba33ecd48ccecce7e8f8d05ff70bb85653f6163
2018-04-13 15:38:35 +09:00
Chavi Weingarten
9553a11557 Merge "Synchronize stack position and size update for split screen" into pi-dev 2018-04-11 16:53:42 +00:00
Lorenzo Colitti
4df92ef6f1 Merge "Don't unnecessarily reevaluate tethering provisioning" into pi-dev 2018-04-11 03:01:25 +00:00
Remi NGUYEN VAN
cf54c0451a Merge "Added tests for MultipathPolicyTracker." into pi-dev 2018-04-11 02:53:14 +00:00
chaviw
be43ac8686 Synchronize stack position and size update for split screen
When entering split screen, the secondary window changes position so
it's below the primary split screen when minimized. The WSA at the same
time is also changing size to fit the area. However, the size doesn't
change until the client requests a new size and a frame with the correct
size comes in. This causes the stack to update position before the
resize which causes content to get cut off and then a jump when the resize
completes.

This change updates the WSA position as soon as it recognizes that the
stack changed position due to entering split screen secondary. The WSA
sets its position as the negative of the stack position, making the
calculated window position at (0,0). When a relayout is requested, the
WSA's position is requested back to (0,0), deferring until the new frame.
This will put the WSA position at (0,0) when a frame with the correct size
is drawn. This places the window position at the stack's new position in
the same transaction that a WSA frame with the new size is drawn.

Change-Id: I8c88d7784f827d66926fb5c382af2346028dc48f
Fixes: 74354855
Test: Entering split screen with quick step is smooth
Test: Entering split screen with old launcher still works
2018-04-10 18:11:19 -07:00
TreeHugger Robot
0e675bd901 Merge "Exempt tests for hidden APIs." into pi-dev 2018-04-10 16:34:05 +00:00
Remi NGUYEN VAN
6a7a5a1c3b Added tests for MultipathPolicyTracker.
Test: atest com.android.server.connectivity.MultipathPolicyTrackerTest
Bug: b/72631572
Bug: b/72877610
Change-Id: I33d9cd77948ff76008a125e4e2786fbbc2b03032
2018-04-10 15:27:59 +09:00
dalyk
1fcb7398d1 Trigger NetworkCallback events when private DNS usage has changed.
Relies on events sent from netd in aosp/578162.

Test: Added tests to ConnectivityServiceTest. Added a new test
class DnsManagerTest. Built a simple app that appears to
receive onLinkProperties events correctly upon manual changes
to the private DNS settings on a Pixel.
Bug: 71828272

Merged-In: I1e6c54ba016f6a165a302bd135a29d9332aaa235
Merged-In: I7705412803fb9aa707a18ae5a1c50292e084d851
Change-Id: I3223c1285a73d5d531c5051ce70007857caa57e3
(cherry picked from commit 7301aa4140)
2018-04-09 23:04:20 -07:00
Erik Kline
80b7a9f1b5 Don't unnecessarily reevaluate tethering provisioning
Registering for carrier config changes can deliver a sticky broadcast
and can cause Tethering to think something has changed and reevaluate
provisioning status, even though this has been checked before it
entered tethering mode alive state.

Additionally, move the provisioning_app{,no_ui} resources into the
TetheringConfiguration, if for no other reason than now we can log
it in .toString().

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
    - manual USB tethering toward WiFi works
Bug: 69565814
Change-Id: Ib8b2620ce44c55e5eb0afd3f00f3f5aa4fc8a593
(cherry picked from commit 8067d78c32)
2018-04-09 21:17:29 -07:00
Benedict Wong
d74a971fc2 Merge "Force creation of Socket upon Transform application" into pi-dev 2018-04-09 20:55:30 +00:00
Erik Kline
d7375ac9d7 Support bluetooth not using MultinetworkPolicyTracker
This required advancing the IpManager to IpClient refactoring
(Bluetooth used IpManager and friends). Most importantly, the
Bluetooth code used WaitForProvisioningCallback, so this is
moved into IpClient proper now. Also: some more renaming
cleanup.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net passes
Bug: 62476366
Bug: 72663849

Merged-In: I5e5b2c59ad3ea9ad574e8e683bcab3b09cfe0791
Merged-In: I89b45310181d952129fb2294db63654da9b4057f
Change-Id: I9eee2a9d5c31cdd48a054a7edc3403584efb1864
(cherry picked from commit 8d1fe54be1)
2018-04-09 03:05:37 -07:00
Nicolas Geoffray
b0284fb5de Exempt tests for hidden APIs.
Bug: 64382372
Bug: 74963051
Test: m
Change-Id: I5234dd6230f2bdd6ffccbf12b25a02d929d20161
2018-04-06 14:54:39 +01:00
Erik Kline
8d8a35a90e Merge "Move the logic of (re)evaluation of Private DNS" into pi-dev 2018-04-06 06:48:25 +00:00
Erik Kline
79c6d0590e Move the logic of (re)evaluation of Private DNS
Moves this out of ConnectivityService and into each NetworkMonitor
(where it's more self-contained).

Test: as follows
    - builds, flashes, boots
    - runtest frameworks-net passes
    - manual testing with working and non-working hostnames behaves
      somewhat (but not entirely) as expected, and not always quickly
Bug: 64133961
Bug: 72345192
Bug: 73872000
Bug: 77140445
Merged-In: I5dc90ecfe6f6f10967b7501645ad8e030cb38982
Merged-In: Ida4967d22f0781524f0f269e30e653b8ec867258
Change-Id: Ic4322af3cb49149f2d975cb31f54b2ac7927f907
(cherry picked from commit 736353a584)
2018-04-05 19:18:47 -07:00
Benedict Wong
3f2c54b782 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
Change-Id: I19e124adef6d9f4992d8293db3190bcf74c95848
2018-04-05 17:41:11 +00:00
TreeHugger Robot
71c632367a Merge "WM Tests: Use a separate WindowManager instance per test" into pi-dev 2018-04-05 00:25:34 +00:00
Benedict Wong
5e9b4c7c33 Force creation of Socket upon Transform application
This change forces Socket and DatagramSocket to populate the
SocketImpl, ensuring that the socket file descriptor can be
retrieved when applying Transport mode Transforms

This is done by calling getSoLinger(), triggering a getImpl(), which
triggers setImpl() if needed.

Bug: 77491294
Test: Added tests in IpSecManagerTest, ran on walleye
Merged-In: I40da08b031357710eb794e0f866aec5660c79594
Change-Id: I40da08b031357710eb794e0f866aec5660c79594
(cherry picked from commit d175a3d3a0)
2018-04-04 10:33:49 -07:00
TreeHugger Robot
c4020ffcab Merge "Mark networks with OEM_PAID always restricted" into pi-dev 2018-04-04 16:54:46 +00:00
Lorenzo Colitti
83c1e74b1e Mark networks with OEM_PAID always restricted
Bug: 68762530
Test: runtest -x frameworks/base/tests/net/ -c android.net.NetworkCapabilitiesTest

Cherry-picked from AOSP with no conflicts

Merged-in: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
Change-Id: I173ee0a3bc1797d03ba34c5f025844eaada87ee4
(cherry picked from commit efbacc0ccb)
2018-04-04 05:35:54 +00:00
Nathan Harold
592dadbd43 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
Change-Id: I17a4a286225b432c3e15ea1587d946189931b4f4
2018-04-03 18:23:11 +00:00
Bernie Innocenti
5be71dcb03 APF: drop multicast ICMPv6 while in doze mode
Some WiFi hotspots send excessive multicast IPv6 ping requests which
cause considerable power drain. Thus, drop all multicast ICMPv6 ping
requests while the device is in doze mode.

Bug: 66930077
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
Test: manual - compared generated APF bytecode using apf_disassembler
Test: manual - force idle mode while sending multicast pings to device
Change-Id: I25dbf99985cf4413b4d0e3920d281fe6d663197a
(cherry picked from commit e2c70f8a60)
2018-04-03 16:16:14 +09:00
TreeHugger Robot
5a36b3b6ea Merge "Refactor isTetheringSupported() calls" into pi-dev 2018-04-03 02:25:49 +00:00
Erik Kline
7a26ba37f6 Refactor isTetheringSupported() calls
Tethering currently wants access to complex isTetheringSupported
logic that is only available in ConnectivityService. Instead of
trying to access that via ConnectivityManager, pass this capability
in to Tethering directly, in the TetheringDependencies object.

Also:
    - ConnectivityManager is only a source of static constants now,
      so "import static" all the constants that are actually used.

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net works
    - manual USB towards WiFi tethering works
Bug: 68951715

Merged-In: Ifa121b057f9959ddb980edc940327929e48ea973
Merged-In: Iad6358dc2f1d10b322d22ec90543adc50882962d
Change-Id: Ia64faaadefb4a5d84a50da98bdebd544b6fda101
(cherry picked from commit 465ff3a0c1)
2018-04-02 16:59:23 -07:00
Remi NGUYEN VAN
75525b39f4 Fix network usage stats on 464xlat tethered.
Usage stats corrections for 464xlat in NetworkStatsFactory are not applied
to tethered traffic. Add adjustments in NetworkStatsService. After
migrating external callers off NetworkStatsFactory, we will be able to
only apply adjustments in NetworkStatsService and remove stacked
interface tracking from NetworkStatsFactory.
Bug: 72107146
Fixes: 72107146
Test: runtest frameworks-net & manual - checked corrected network usage
Merged-In: Ieb25c41c651499fdd01225ae5ac21d95e3d823f5
Merged-In: I016722f3a0ae2ae0a1d48bfacc4fe07ee3578ef7
(cherry-pick of aosp I5ce450e616b4fddf21f2a491fe5d0c9e9f969bda)

Change-Id: Id41cf22a0f9a63cb1832e9375bfb045861f08e52
2018-04-02 13:30:02 +00:00
TreeHugger Robot
6e66280d35 Merge "Fix PermissionMonitorTest that has been failing." into pi-dev 2018-04-02 09:42:26 +00:00
TreeHugger Robot
4a3ccc18e6 Merge "apf: adjust JNI to accept_packet()'s new signature" into pi-dev 2018-04-02 08:37:20 +00:00
Chalard Jean
577164bd45 Fix PermissionMonitorTest that has been failing.
The fail is related to a recent fix to PermissionMonitor
that went into pi-dev only : ag/3799094, which fixed getting
the remote package name for the correct macro user instead of
the default. That fix had broken the test, this change fixes it.

Test: test now passes
Bug: 77315205
Change-Id: I26f8276eafe80478d5fefcff92e7dc2f12128bb4
2018-04-02 07:44:21 +00:00
Bernie Innocenti
035dbd438a apf: adjust JNI to accept_packet()'s new signature
Bug: 73804303
Test: runtest -x tests/net/java/android/net/apf/ApfTest.java
Merged-Id: I0a3ad562496f3e06bc9527af4e038be3cdfe25c6
Merged-Id: I1674ac22f00af037ad415a4436b94b2eec6a02b7
Merged-Id: I966776e6574cbf167a6148e20d40e2bdcc887327
Change-Id: Id5c3cec5459ce6f9693457448002e60bbca6c09b
(cherry picked from commit 64bc32c5d4)
2018-04-02 16:27:08 +09:00
Remi NGUYEN VAN
6f5a8db2e9 Merge "Add method to NetworkStatsService for UID stats." into pi-dev 2018-04-02 05:40:04 +00:00
Calin Juravle
ddc4e1ab06 Merge "Fix BackgroundDexOptTest" into pi-dev 2018-03-30 23:12:31 +00:00
Calin Juravle
7fc0f633bc Fix BackgroundDexOptTest
Test: atest BackgroundDexOptServiceIntegrationTests
Bug: 76425903
Change-Id: I19b72b95ee19ebe1807e1ce108a39dec6196a097
2018-03-30 14:04:48 -07:00
Benedict Wong
36f2d8a4e1 Merge changes from topic "encap-api" into pi-dev
* changes:
  Require explicitly supplied truncation length
  Clarify UDP encapsulation socket API
2018-03-30 20:28:19 +00:00
Remi NGUYEN VAN
b6a920124f Add method to NetworkStatsService for UID stats.
Useful for clients such as BatteryStats which currently rely
on NetworkStatsFactory. Data at that stage is incomplete as
it does not account for tethering, VT data and corresponding
464xlat corrections.

Test: runtest frameworks-net, CTS tests pass.
Bug: b/72107146
Merged-In: I31c5b9b4a7c6e72910152415894a137f000a5858
Merged-In: I2527d95000c7500c824ede70f87ecb38e21ed323
(cherry picked from aosp 088ff6824f)

Change-Id: Ie80f1bb21124241f3414f9be77aceac9a44ec6d1
2018-03-30 18:58:18 +09:00
Remi NGUYEN VAN
671547b224 Merge "Use InterfaceSet for upstream interfaces." into pi-dev 2018-03-30 09:15:13 +00:00
Remi NGUYEN VAN
4140cc106e Merge "Add tests for IPv4 of dual stack tethering." into pi-dev 2018-03-30 09:13:50 +00:00
Remi NGUYEN VAN
6c02f9942a Use InterfaceSet for upstream interfaces.
Allows using different upstream interfaces for IPv4 and IPv6.

Bug: 38218697
Bug: 64382985
Bug: 64976379
Bug: 64995262
Bug: 64380515
Test: runtest frameworks-net, manual (with aosp/644099 applied)
(cherry-pick of aosp I3db63f7aa5255a0229253187def7590a386c5133)
Merged-In: Ic8602dd029b5a9626aaf6651315b82ab6327037c
Merged-In: I015ac946afa581be1d94f10ab766ac00f5a4ede0

Change-Id: I8c48dab5eb67e60dadbfa974122fc884f4badd15
2018-03-30 18:08:52 +09:00