Commit Graph

4465 Commits

Author SHA1 Message Date
Christian Wailes
d9bce3cfff Merge "Revert "Revert "Remove a misleading "flush" function.""" 2019-09-11 18:23:50 +00:00
Christian Wailes
647fee87dc Revert "Revert "Remove a misleading "flush" function.""
This reverts commit 47da177405.

Reason for revert: Fixed the test broken by the original commit

Bug: 139192244
Bug: 140336855

Test: m -> flash -> boot
Test: atest CtsJvmtiAttachingHostTestCases

Change-Id: I4c67ad8709652c4710ef24564e0240f74f817f8c
2019-09-04 23:37:32 +00:00
Ian Kasprzak
783313acbf Merge "Revert "Remove a misleading "flush" function.""
am: 9fcf8b7cae

Change-Id: Ic6fafd4ed9bf6dfc001120dced903b14cf907d1d
2019-09-02 08:47:30 -07:00
Ian Kasprzak
9fcf8b7cae Merge "Revert "Remove a misleading "flush" function."" 2019-09-02 15:28:20 +00:00
Ian Kasprzak
47da177405 Revert "Remove a misleading "flush" function."
This reverts commit 9d8b926859.

Reason for revert: Driodcop: aosp-master test-mapping showing multiple failures (b/140336855).

Change-Id: If44e273dd111802db8b44db1e5a67a4628c72e3c
2019-08-31 21:28:50 +00:00
Christian Wailes
932b360d45 Merge "Remove a misleading "flush" function."
am: d6f04e744d

Change-Id: I31a2c6a8b49493ea85816071874c3e08841f233f
2019-08-30 16:24:39 -07:00
Christian Wailes
d6f04e744d Merge "Remove a misleading "flush" function." 2019-08-30 22:59:41 +00:00
Aurimas Liutikas
9b361c2674 Merge "Add missing nullability annotations." 2019-08-30 18:30:39 +00:00
Aurimas Liutikas
85c0a5a2be Merge "Add missing nullability annotations." into stage-aosp-master 2019-08-30 15:19:45 +00:00
Remi NGUYEN VAN
5af10311a3 Merge "Run callbacks on ConnectivityService thread"
am: bef5d2165d

Change-Id: I7a8d035ec7453c5351eb2646c631c19964cb0f88
2019-08-30 03:36:26 -07:00
Aurimas Liutikas
1da3bde08d Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:16:24 +00:00
Aurimas Liutikas
00be951a08 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:14:44 +00:00
Remi NGUYEN VAN
f9354793f9 Run callbacks on ConnectivityService thread
Run MultinetworkPolicyTracker and DataConnectionStats callbacks on the
ConnectivityService handler thread.

Previously the callbacks would be using the SystemServer foreground
thread (Looper.myLooper()), or the broadcast thread for the
MultinetworkPolicyTracker BroadcastReceiver. This is error-prone, can
cause threading issues and makes it difficult to test the components.

Test: atest FrameworksNetTests
Change-Id: I189213dd363004abed294659165bf5430d153bba
2019-08-28 10:10:04 +09:00
Chris Wailes
9d8b926859 Remove a misleading "flush" function.
This patch removes LocalSocketImpl.flush().  In practice this function
was simply a wrapper around `Thread.sleep(10)`.  All direct calls to
this function have been removed.  The `flush()` function is still called
on several objects that wrap a SocketOutputStream.

This will make booting a device 20ms faster than it currently is.

Bug: 139192244
Test: Build -> flash -> boot -> launch app
Change-Id: I0a96f4bc72461670370f61e847349f32af5ac774
2019-08-27 14:51:21 -07:00
Oscar Shu
65a98b4002 Merge "avoid generating reserved local MACs"
am: e5d5b73109

Change-Id: Ia6d0eb0c5e8101d9c4b4bc63de79157f7d1c2284
2019-08-23 02:24:15 -07:00
Oscar Shu
e5d5b73109 Merge "avoid generating reserved local MACs" 2019-08-21 17:45:00 +00:00
xshu
683b756b25 avoid generating reserved local MACs
Avoid generating WifiInfo.DEFAULT_MAC_ADDRESS as a randomized MAC
address since it's being used for another purpose.

Bug: 137796328
Test: atest MacAddressTest
Change-Id: Ia7beef0d0af5d7b39845e662cd343d81aef97702
2019-08-16 10:20:22 -07:00
Chiachang Wang
2afb11fbc8 Merge "Get resource based on subId for multi-SIM"
am: 55752cf8d4

Change-Id: I020c2546fa4432d05cf27b20fdb1943508aac671
2019-08-14 04:30:57 -07:00
Chiachang Wang
5f8ac27d79 Get resource based on subId for multi-SIM
The resource loading is done based on the last SIM to come up
which is not a deterministic design. Thus, update the way to get
the resource based on the subId.

Test: atest FrameworksNetTests
Test: manually test with avoid bad wifi feature supported sim
Bug: 138956509
Change-Id: Ib5b085d97103889600773d269e03b939c29ca47d
2019-08-14 13:56:37 +08:00
Aurimas Liutikas
fbcbeec03c Merge "Fix broken Javadoc links in frameworks/base"
am: 4a532813df

Change-Id: I5a6152fa6baab86dde980af57b84167b154b44c7
2019-08-04 00:49:17 -07:00
Aurimas Liutikas
92ff83bddc Fix broken Javadoc links in frameworks/base
Test: running metalava with syntax check enabled.
Change-Id: I13ec355b591b0ae3cfb5009794b1ed844d27cba8
2019-08-02 15:40:29 -07:00
Fedor Kudasov
c064c84b5f Return NonNull and other imports
Change-Id: Ia38b13209b45d8228ac02f06663e4dc12be9de60
2019-07-09 14:19:04 +00:00
Fedor Kudasov
8125047183 Merge changes from topic "fix_master_build"
am: 2e5319117a

Change-Id: If49999e7ce6149e847a678b03ccf8b4549f8365b
2019-07-09 06:10:01 -07:00
Fedor Kudasov
559e91e0ef Revert "Cherry-pick the relevant parts of master change"
This reverts commit dd16d44fe8.

Reason for revert: multiple build breakages b/137069068

Change-Id: If48bfa2d2cab0877a053743b3ec53820d0c4ed6b
2019-07-09 09:29:17 +00:00
Fedor Kudasov
e5cb0a2216 Revert "Remove providesRoutesToMostDestinations."
This reverts commit d85b09a06f.

Reason for revert: multiple build breakages b/137069068

Change-Id: I60a4f71e13fe82f970b177a07c0b58439cbc64ff
2019-07-09 09:23:25 +00:00
Chalard Jean
cbaed4e7ba Merge changes Ia43f8811,I7de4f672
am: 3ef04b8e3c

Change-Id: Ifcacd81d343a29b17fdb79f4c8b54c89a293a2b8
2019-07-09 00:56:57 -07:00
Chalard Jean
d85b09a06f Remove providesRoutesToMostDestinations.
This function is not used any more.

Test: FrameworksNetTests
Change-Id: Ia43f8811cb9d575e16735b0f4b76d91e7cd42ebc
2019-07-08 20:36:33 +09:00
Chalard Jean
dd16d44fe8 Cherry-pick the relevant parts of master change
I566437e4fe10e1346858149120c50b3c20ca073f to avoid a conflict

Test: atest FrameworksNetTests
Change-Id: I7de4f67234bf97d58bddffa22272c7670398f56d
2019-07-08 20:25:45 +09:00
Lorenzo Colitti
736194dfbf Merge "Unit tests for new explicitlySelected behaviour." am: d1379a4a80
am: 10c1a704c0

Change-Id: Id77a5d6a58e7ab4fdaa0b7c15b824270863b83fd
2019-06-29 02:01:55 -07:00
Lorenzo Colitti
b5ad613839 Unit tests for new explicitlySelected behaviour.
ag/7905088 added the ability to pass in acceptUnvalidated without
passing in explicitlySelected. Add unit tests for that code.

While I'm at it, convert a couple of "== 1"s to toBool(), and
update the comments in NetworkAgent.

Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I6b550bd621e3596975f83464c7b4b8a14269120b
2019-06-28 23:57:22 +09:00
Lorenzo Colitti
e6e57b2c8f Merge "Remove all static members from NetworkStatsFactory." am: 63f94f411b
am: 5409264cee

Change-Id: Iada14a1fea74197014e75a1112c7a5b35d6b1a1d
2019-06-27 19:40:01 -07:00
Neil Fuller
8a334f433b Merge "Track change of type from short -> int" am: d854e6e0b4
am: 9881c6f3d7

Change-Id: Iab8db7985b5cdd52b22aa2b72e3273c2d8f2f892
2019-06-27 02:43:34 -07:00
Lorenzo Colitti
4aa8760a68 Remove all static members from NetworkStatsFactory.
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.

Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89
2019-06-27 17:39:05 +09:00
Neil Fuller
d854e6e0b4 Merge "Track change of type from short -> int" 2019-06-27 08:26:31 +00:00
Neil Fuller
9ec43cc7fe Merge "Switch to a single PacketSocketAddress constructor" am: 2d24f7a39e
am: a357696c2f

Change-Id: I7db11188d9dd42e25b0aebd79acc92a9ba2f56a0
2019-06-20 14:06:50 -07:00
Chalard Jean
f1eab99357 Merge "Factorize custom asserts." am: 6c176efa3d
am: 99fbb40990

Change-Id: I65ea7497abb8b77ebd10ba622075ef3b6c49b2a8
2019-06-20 14:01:31 -07:00
Neil Fuller
f8d8fc1247 Track change of type from short -> int
Remove (now) unnecessary cast: PacketSocketAddress
uses ints.

Bug: 124232146
Bug: 135660232
Test: build only
Change-Id: Ifa99e0d2e970f1b8f605afe8a394c4f575bc6eca
2019-06-20 17:09:40 +01:00
Neil Fuller
2d24f7a39e Merge "Switch to a single PacketSocketAddress constructor" 2019-06-20 14:09:15 +00:00
Neil Fuller
6ae89f2f9c Switch to a single PacketSocketAddress constructor
Switch to a single PacketSocketAddress constructor to
avoid multiple unnecessary overloads in the
Core Platform API.

Bug: 133196453
Bug: 124232146
Test: build only
Change-Id: I30533ac3aa99c2cd09e8c624fedf6000b0f52c11
2019-06-20 09:24:43 +01:00
Chalard Jean
9c0ff1b005 Factorize custom asserts.
Also a few utilities that were in the way, and some opportunistic
cleanups.

Test: FrameworksNetTest NetworkStackTest
Change-Id: I385070e2044fd967cb18f1ffea9a86a4627b742e
2019-06-20 16:24:25 +09:00
Junyu Lai
aed835f086 Merge "Move the test of minimum supported keepalive slots to CTS" am: 579a99e558
am: 6ff00fee75

Change-Id: Ib9b06d3458782a648a2f5b8fd5a9ca1d34bd11f9
2019-06-19 07:29:11 -07:00
Junyu Lai
680abbb591 Merge "Correct value of supported keepalive count for cellular" am: 68a4599a37
am: 056eeae27c

Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8
2019-06-19 07:28:53 -07:00
Junyu Lai
579a99e558 Merge "Move the test of minimum supported keepalive slots to CTS" 2019-06-19 14:08:31 +00:00
Junyu Lai
68a4599a37 Merge "Correct value of supported keepalive count for cellular" 2019-06-19 14:08:31 +00:00
junyulai
edde28b709 Move the test of minimum supported keepalive slots to CTS
This change also enables log when keepalive is started.

Bug: 134352656
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest FrameworksNetTests
Change-Id: I408750fa0bceb0c1c26afb5fead4e44fb824fbc1
2019-06-19 16:25:19 +08:00
Varun Anand
2471441b2d Merge changes Ieb8645ac,I6466ec14,I87deb82b,I995b108e,Ib6521459 am: f4c10e8bc2
am: 48f59a0fdf

Change-Id: I960e94b03b29282ae2b03f78a19ed2692bd88e05
2019-06-17 10:33:53 -07:00
Varun Anand
f4c10e8bc2 Merge changes Ieb8645ac,I6466ec14,I87deb82b,I995b108e,Ib6521459
* changes:
  Remove VPN info arrays from NetworkStats(Observer|Recorder)
  NetworkStatsFactory: Take VPNs into account for network/battery stats
  Remove duplicate line in clat_simple test file
  Remove unused lastStats parameter
  Revert "Revert "Take all VPN underlying networks into account when migrating traffic for""
2019-06-17 15:56:24 +00:00
Chalard Jean
b199795653 Merge "Remove the <= P restriction for WIFI_P2P" am: 4e8973e9a8
am: bb754c9c8d

Change-Id: I14f5865249740587d550ac31b59883f4a87fd4a1
2019-06-17 08:20:18 -07:00
Chalard Jean
2253ff94e3 Remove the <= P restriction for WIFI_P2P
This is still sent in an intent.

Bug: 975059
Change-Id: I56c86b0c1912064d5a642991df32d2cefb6a8d5b
2019-06-17 19:46:34 +09:00
Benedict Wong
9fbbdebc61 NetworkStatsFactory: Take VPNs into account for network/battery stats
This change fixes detailed UID stats to ensure network and battery stats
both take VPNs into account. NetworkStatsFactory is being made aware of
VPNs enabled, and the full set of underlying networks present.

Since traffic can only be migrated over a NetworkStats delta, NSF
maintains a NetworkStats snapshot across all UIDs/ifaces/tags.

This snapshot gets updated whenever NSF records a new snapshot
(based on various hooks such as VPN updating its underlying networks,
network getting lost, etc.), or NetworkStatsService's
getDetailedUidStats() method being called.

This change widens the scope of the existing mPersistentSnapshot lock,
renaming it to mPersistentDataLock, and ensures that TUN migrations are
not done in parallel. Additionally, mVpnInfos is updated via
pointer-swapping, to reduce the scope of the mPersistentDataLock.

The safety of this change is predicated on:
1. NetworkStatsFactory lock not held, so services cannot deadlock through
the cyclical lock.

2. The broadening of the scope of the lock in NetworkStatsFactory has no
threading implications, as it is always the last (leaf node) lock held,
and therefore is impossible to have lock inversion.

Additionally, to ensure VPNs work with 464xlat, the VPN info passed to
the NetworkStatsFactory includes all underlying interfaces, instead of
only passing the first one.

This (partially) re-applies changes from:
aosp/972848: Add one more test for VPN usage stats.
aosp/972847: Addressing comments for http://ag/7700679.
aosp/885338: NetworkStatsService: Fix getDetailedUidStats to take VPNs
             into account.
Co-developed with: Varun Anand <vaanand@google.com>

Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Change-Id: I6466ec1411fc5ed6954125d27d353b6cd1be719e
2019-06-14 11:41:31 -07:00