Commit Graph

7795 Commits

Author SHA1 Message Date
Aurimas Liutikas
1224bc8ec2 Merge "Add missing nullability annotations." into stage-aosp-master
am: 9fe20bf048

Change-Id: Ic9ea2b9840fbb678bbb6ab77038415581feba918
2019-08-30 08:35:52 -07:00
junyulai
bfa8b89ed1 Merge "Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN"
am: c07aed0fd4

Change-Id: If5b3f6f1d397d3ac35b509a2e634a60933f2df6c
2019-08-30 08:30:10 -07:00
Aurimas Liutikas
9fe20bf048 Merge "Add missing nullability annotations." into stage-aosp-master 2019-08-30 15:19:45 +00:00
Aurimas Liutikas
829146bee8 Merge "Add missing nullability annotations." 2019-08-30 15:14:37 +00:00
paulhu
22e2195a8a Fix flaky testTcpBufferReset
If EVENT_NETWORK_INFO_CHANGED was handled after waitForIdle()
method done, this test will be failed due to
INetd#setTcpRWmemorySize() was not executed yet. Instead of
waiting for idle state, it's better to use NetworkCallback to
ensure events completely on ConnectivityService.

Bug: 140206578
Test: atest ConnectivityServiceTest#testTcpBufferReset\
      --generate-new-metrics 500

Change-Id: Iad77415db38038603881d9ebe0e37586b549a45c
2019-08-30 20:21:03 +08:00
junyulai
0c27ddf71b Fix LockdownVpnTracker deadlock when resetting legacy Always-On VPN
When resetting legacy Always-On VPN, the intent is handled by
main thread. And it will also initialize VPN shutdown process,
which will cause networkInfo changed event on
ConnectivityService internal thread. These two events need to
hold their corresponding lock and ask for the other one, which
causes the deadlock.

This patch move the event handling to the same thread to prevent
such deadlock, and cleanup some unused variables.

Change-Id: I5b656c0d0381acb4e33409a11f502db9b180296c
Fix: 139122208
Test: atest FrameworksNetTests, manual test
2019-08-30 19:56:59 +08:00
Remi NGUYEN VAN
d9d2e3f37a Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f am: 904ee8f635 am: 11e0de0f30 am: 33d70e8fbd
am: f12ae468ae

Change-Id: I382db90c318495244a42a2d4af6e5ebf54f05750
2019-08-30 04:17:08 -07:00
Remi NGUYEN VAN
f12ae468ae Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f am: 904ee8f635 am: 11e0de0f30
am: 33d70e8fbd

Change-Id: I8ada7ccf94e0ade83c0d810daba9703da60a6f59
2019-08-30 04:05:18 -07:00
Remi NGUYEN VAN
33d70e8fbd Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f am: 904ee8f635
am: 11e0de0f30

Change-Id: I12d7b8fca85502807288bba03417f2ceb0c9f533
2019-08-30 03:53:46 -07:00
Remi NGUYEN VAN
11e0de0f30 Merge "Run callbacks on ConnectivityService thread" am: 08e1dae42f
am: 904ee8f635

Change-Id: I288994ccfdd044453aa818681745b8e69881264a
2019-08-30 03:47:09 -07:00
Remi NGUYEN VAN
904ee8f635 Merge "Run callbacks on ConnectivityService thread"
am: 08e1dae42f

Change-Id: I7a8d035ec7453c5351eb2646c631c19964cb0f88
2019-08-30 03:36:26 -07:00
Treehugger Robot
08e1dae42f Merge "Run callbacks on ConnectivityService thread" 2019-08-30 10:18:28 +00:00
Aurimas Liutikas
07be422126 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
03b44c560f 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
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-29 17:15:44 -07:00
Aurimas Liutikas
8fae993514 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
96521fb87d 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
Lorenzo Colitti
99d364008e Merge changes I69cdbb16,I6975e0b7 am: d889cb5098 am: c3a98bbd65 am: 16b3189142 am: 163106855c
am: eea2b12014

Change-Id: Ie87981017bf2d4deef2092407c31fb3df4464dc8
2019-08-27 04:24:55 -07:00
Lorenzo Colitti
eea2b12014 Merge changes I69cdbb16,I6975e0b7 am: d889cb5098 am: c3a98bbd65 am: 16b3189142
am: 163106855c

Change-Id: I77ca7b17bea79dee5156839d1164b0fc78b31fe5
2019-08-27 04:12:45 -07:00
Lorenzo Colitti
163106855c Merge changes I69cdbb16,I6975e0b7 am: d889cb5098 am: c3a98bbd65
am: 16b3189142

Change-Id: Id2ef4273b32f804f2a5b935fe9a9d59424baa85a
2019-08-27 03:58:57 -07:00
Lorenzo Colitti
16b3189142 Merge changes I69cdbb16,I6975e0b7 am: d889cb5098
am: c3a98bbd65

Change-Id: I6f6458883392a396ff831c6ddd74295e00daae0f
2019-08-27 03:44:40 -07:00
Lorenzo Colitti
c3a98bbd65 Merge changes I69cdbb16,I6975e0b7
am: d889cb5098

Change-Id: I3c8ddf7809a0d443587c1c4c06ef56ac302fc80f
2019-08-27 03:31:02 -07:00
Paul Hu
7f7c15143d [automerger skipped] Merge "Add SocketUtils CTS tests am: a60f654b1e" into qt-dev-plus-aosp am: 364c77f92e am: 247abfc850
am: 2a78a2a904 -s ours
am skip reason: change_id I36252fdf516cf4a9d4506b615cdb38f5413739e5 with SHA1 6bb555b289 is in history

Change-Id: I42f498e0596eb2dce855f0267b76b4f04c4f31aa
2019-08-26 15:16:41 -07:00
Paul Hu
2435bd3c88 [automerger skipped] Merge "Add SocketUtils CTS tests am: a60f654b1e am: 8d273c0606" into qt-r1-dev-plus-aosp am: f5f95fce12
am: e0d431f11d -s ours
am skip reason: change_id I36252fdf516cf4a9d4506b615cdb38f5413739e5 with SHA1 6bb555b289 is in history

Change-Id: Id31da8aaa8782d340d77dc81c784ee603cb2458e
2019-08-26 15:11:04 -07:00
Paul Hu
2a78a2a904 Merge "Add SocketUtils CTS tests am: a60f654b1e" into qt-dev-plus-aosp am: 364c77f92e
am: 247abfc850

Change-Id: Ib9a37cb7def991896fba61fbefe61eb8b583a1fb
2019-08-26 14:01:10 -07:00
Paul Hu
e0d431f11d Merge "Add SocketUtils CTS tests am: a60f654b1e am: 8d273c0606" into qt-r1-dev-plus-aosp
am: f5f95fce12

Change-Id: I26b15368b078084158ad91df5d26cea93aff8cd4
2019-08-26 13:53:50 -07:00
Paul Hu
247abfc850 Merge "Add SocketUtils CTS tests am: a60f654b1e" into qt-dev-plus-aosp
am: 364c77f92e

Change-Id: I99307d7aeb0e8c96de51e53a5bc373e570715860
2019-08-25 20:39:10 -07:00
Paul Hu
77d701610e Add SocketUtils CTS tests am: a60f654b1e
am: 8d273c0606

Change-Id: I83abe9535018a161241c4d57f69960254f310c17
2019-08-25 20:33:52 -07:00
Paul Hu
47da8b0b36 Add SocketUtils CTS tests
am: a60f654b1e

Change-Id: I1cf2c12592f4a43a31f1e91c7a4bd933107d4f70
2019-08-25 20:21:56 -07:00
Paul Hu
8d273c0606 Add SocketUtils CTS tests
am: a60f654b1e

Change-Id: I92a6b3e5cb1fa993dfaeacb442cbf6b401dd5996
2019-08-25 20:21:52 -07:00
wangmingming1
478ba7a6d9 notify netd about uid internet permission changes when package replaced
1. If a previous version of an app doesn't declare internet permission;
2. The User upgraded it to a new version and the new one does declare the
internet permission;
3. The new app are not allowed to access the internet until next boot

Bug: 137864893
Test: Manual, just make sure the onPackageChanged would be executed on package changes
Change-Id: I69cdbb16a027a9c4e974b32371b1f64a23a51a23
Signed-off-by: wangmingming1 <wangmingming1@xiaomi.com>
2019-08-26 09:30:59 +09:00
Oscar Shu
6eddab4dcb Merge "avoid generating reserved local MACs" am: 464e1b5e6f am: 6fcb2696cd am: 4f05f46f13 am: ddc3459236
am: 8841a3a1a1

Change-Id: If0fdc7bd46f711714986440a9a905f2ccb154830
2019-08-24 01:33:53 -07:00
Oscar Shu
8841a3a1a1 Merge "avoid generating reserved local MACs" am: 464e1b5e6f am: 6fcb2696cd am: 4f05f46f13
am: ddc3459236

Change-Id: Ib6e9917c555ab4ef5769aaca1ef6987dfbc185c1
2019-08-23 22:03:56 -07:00
Oscar Shu
ddc3459236 Merge "avoid generating reserved local MACs" am: 464e1b5e6f am: 6fcb2696cd
am: 4f05f46f13

Change-Id: Icce1e14fae4293d747d0f9a57c99bb52fee31ba0
2019-08-23 03:14:04 -07:00
Oscar Shu
6fcb2696cd Merge "avoid generating reserved local MACs"
am: 464e1b5e6f

Change-Id: Ia6d0eb0c5e8101d9c4b4bc63de79157f7d1c2284
2019-08-23 02:24:15 -07:00
Paul Hu
a60f654b1e Add SocketUtils CTS tests
Test APIs below:
makeNetlinkSocketAddress(int, int)
makePacketSocketAddress(short, int)
makePacketSocketAddress(int, byte[])
closeSocket(java.io.FileDescriptor)

Bug:129200596
Test: atest FrameworksNetTests
      atest CtsNetTestCases --instant
Merged-In: I36252fdf516cf4a9d4506b615cdb38f5413739e5
(cherry picked from commit 93a53224d3a1cd6fc1de7d94955e03116b744e4a)

Change-Id: I0963acaf00c5bdd93db0503c426f190f409ca076
2019-08-23 02:13:40 +00:00
Oscar Shu
464e1b5e6f Merge "avoid generating reserved local MACs" 2019-08-21 17:45:00 +00:00
Chiachang Wang
cecdefd8dd Merge "[automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev am: 559e7a3de1 am: c3c41babff -s ours
am: 613aa66e20 -s ours
am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 0dc044aac7 is in history

Change-Id: I89c6875e66f3223a9b86ff0a721694bbaa271937
2019-08-17 07:56:18 -07:00
Chiachang Wang
1cc264ebd4 [automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev am: 559e7a3de1 am: c3c41babff -s ours
am: bd49c5e8eb -s ours
am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 0dc044aac7 is in history

Change-Id: Id9ee99550980efa1f12d44dc7db30a23c7766087
2019-08-17 07:44:03 -07:00
Chiachang Wang
0519896a5b [automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev am: 559e7a3de1 -s ours am: 5048e4a80d -s ours
am: 9e0e6dca6d -s ours
am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 5fed8d9ee3 is in history

Change-Id: Ibedf0c2e42da973414f90b1250c2434c377b57e0
2019-08-17 07:37:20 -07:00
Android Build Merger (Role)
613aa66e20 Merge "[automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev am: 559e7a3de1 am: c3c41babff -s ours am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 5fed8d9ee3 is in history" into qt-qpr1-dev-plus-aosp 2019-08-17 14:28:18 +00:00
Chiachang Wang
bd49c5e8eb [automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev am: 559e7a3de1
am: c3c41babff -s ours
am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 5fed8d9ee3 is in history

Change-Id: If85845ae5b8af10afdb9422d92cdbf599b294d2f
2019-08-17 07:27:18 -07:00
Chiachang Wang
5048e4a80d [automerger skipped] Merge "Get resource based on subId for multi-SIM" into qt-r1-dev
am: 559e7a3de1 -s ours
am skip reason: change_id Ib5b085d97103889600773d269e03b939c29ca47d with SHA1 5fed8d9ee3 is in history

Change-Id: I405bb51787bce13441aa4c3b985ef2b92df18826
2019-08-17 07:17:49 -07:00
xshu
8438a85683 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
b239e45d1f Merge "Get resource based on subId for multi-SIM" am: 55752cf8d4 am: 85ff8a6902 am: 2b7f2fbb5b am: 115b77593c
am: 953f3a62ce

Change-Id: Ief32e4d6376062ba6e86472e39d84681f562980a
2019-08-14 05:21:30 -07:00
Chiachang Wang
0dc044aac7 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
Merged-In: Ib5b085d97103889600773d269e03b939c29ca47d
(cherry picked from commit 5e994ea02c7a820543f3726186240548676f4b4e)
2019-08-14 12:15:56 +00:00
Chiachang Wang
115b77593c Merge "Get resource based on subId for multi-SIM" am: 55752cf8d4 am: 85ff8a6902
am: 2b7f2fbb5b

Change-Id: I1e69a49c88f6123f735075934f2f2e08f15f2bff
2019-08-14 04:54:59 -07:00
Chiachang Wang
85ff8a6902 Merge "Get resource based on subId for multi-SIM"
am: 55752cf8d4

Change-Id: I020c2546fa4432d05cf27b20fdb1943508aac671
2019-08-14 04:30:57 -07:00
Chiachang Wang
5fed8d9ee3 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
Remi NGUYEN VAN
f37a3ed07d Merge "Extract test utilities for ConnectivityService" am: ecaff61c4b am: 9e23af5f90 am: 6d34ffb4e6 am: b0cbc5d051
am: e2967d9830

Change-Id: I0bb8a965d11e9f16ac70f62a2319e1dc8e7544df
2019-08-06 16:31:01 -07:00
Remi NGUYEN VAN
b0cbc5d051 Merge "Extract test utilities for ConnectivityService" am: ecaff61c4b am: 9e23af5f90
am: 6d34ffb4e6

Change-Id: Ib760ef922a440d54bab8c1647d8444ab2a717094
2019-08-06 15:57:04 -07:00