Commit Graph

6678 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
1da5fac070 Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods
were added there because they could not be added as JNI inside
the NetworkStack. This was not possible because on Go devices,
the NetworkStack was a jar library. But now, Go also uses an APK.
Hence, move these methods to the NetworkStack.

Fixes: 129433183
Merged-In: I66d7b3e4fbfa32bb0bc853e8cf9399031daff8a9
(cherry picked from commit fe71be2b04a3213828dc0347a1dd4a3675d20562)

Change-Id: Ice433a41469e784385f19498c154345d7b9c69b5
2019-04-08 01:41:39 +00:00
Anil Admal
13bd6a8585 Merge "Extend support for requestRouteToHostAddress for backward compatibility"
am: 1470d8a3b8

Change-Id: I1ecdf945f60d09216e6e8b54754d4feba0437ac1
2019-04-07 17:09:20 -07:00
Treehugger Robot
1470d8a3b8 Merge "Extend support for requestRouteToHostAddress for backward compatibility" 2019-04-07 23:48:32 +00:00
Chenbo Feng
e1ab564e95 Merge "Move NetworkStatsFactory into service directory"
am: c832132056

Change-Id: If92f556cbf3badcb057a3b6e43bb3ef74d0c9ac0
2019-04-05 13:26:28 -07:00
Treehugger Robot
c832132056 Merge "Move NetworkStatsFactory into service directory" 2019-04-05 19:27:22 +00:00
Anil Admal
e1a2886f73 Extend support for requestRouteToHostAddress for backward compatibility
The gnss@2.0 HAL and the framework GNSS Location Provider code is
updated in Q to not call the deprecated requestRouteToHost() method.
However, devices upgrading to Q which are still using gnss@1.1 or
earlier HAL must continued to be supported.

Fixes: 121222025
Test: Tested with gnss@1.1 HAL and first API level P.  The
      ConnectivityService log message "This method exists only for
      app backwards compatibility and must not be called by system
      services" is not present for devices with first API level P.

Change-Id: I10199776ea413dc256dbf0771e6cb3eedb334495
2019-04-05 10:06:37 -07:00
Remi NGUYEN VAN
85c61fc88d Merge "Move attach*Filter() and addArpEntry() methods to NetworkStack" am: 82b74785d7
am: 6dad7305af

Change-Id: If5c236c85585a440bfb645cff9d3cb0bb4e11102
2019-04-05 03:31:36 -07:00
Remi NGUYEN VAN
a4752ea66b Merge "Call clearCallingIdentity before notifyDnsResponse" am: c7b33f7572
am: ffc15401f3

Change-Id: I5e3d6aacbeaba7346e014875a457a0ac52977ead
2019-04-05 03:22:16 -07:00
Remi NGUYEN VAN
6dad7305af Merge "Move attach*Filter() and addArpEntry() methods to NetworkStack"
am: 82b74785d7

Change-Id: I1d6a490a42f68d01e3d0649035cd0015cb522da3
2019-04-04 23:50:27 -07:00
Remi NGUYEN VAN
82b74785d7 Merge "Move attach*Filter() and addArpEntry() methods to NetworkStack" 2019-04-05 06:38:08 +00:00
Remi NGUYEN VAN
fb21e4697b Add common tests for FrameworksBaseTests and CTS
The common package covers tests that should be included both in CTS and
unit tests.

Test: atest FrameworksBaseTests
Bug: 129199908
Change-Id: Ic78ff947250871fa773252c924f1dee9395c6074
(cherry picked from commit 054e3e0f5ebfffe5d9fdd0095abac309552ae0cd)
2019-04-05 05:52:03 +00:00
Remi NGUYEN VAN
ffc15401f3 Merge "Call clearCallingIdentity before notifyDnsResponse"
am: c7b33f7572

Change-Id: I21d52314f332a12bdd96d8f20e68a3eb38f70d6b
2019-04-04 19:02:18 -07:00
Remi NGUYEN VAN
c7b33f7572 Merge "Call clearCallingIdentity before notifyDnsResponse" 2019-04-05 01:54:08 +00:00
Remi NGUYEN VAN
732b67a250 Merge "Add common tests for FrameworksBaseTests and CTS" am: e2908b64dd
am: 25a8bf080c

Change-Id: I863ffea6358a353986cee7b1c76622c434310bba
2019-04-04 09:25:22 -07:00
Lorenzo Colitti
97a2e106c5 Merge "Fix flaky UdpEncapsulationSocket test" am: 95e8a2b5c3
am: 3b7fefe97e

Change-Id: Idf040a67e53d9b9ec6e6c647ce24f8ada501d355
2019-04-04 09:18:29 -07:00
Remi NGUYEN VAN
25a8bf080c Merge "Add common tests for FrameworksBaseTests and CTS"
am: e2908b64dd

Change-Id: I1616831ad8f143298b80ebce9af205f8e50de1f8
2019-04-04 05:42:21 -07:00
Treehugger Robot
e2908b64dd Merge "Add common tests for FrameworksBaseTests and CTS" 2019-04-04 12:29:44 +00:00
Lorenzo Colitti
3b7fefe97e Merge "Fix flaky UdpEncapsulationSocket test"
am: 95e8a2b5c3

Change-Id: I4d6cc85fcd539a38674fc3daff1af57fa1bdd2f7
2019-04-04 01:38:02 -07:00
Lorenzo Colitti
95e8a2b5c3 Merge "Fix flaky UdpEncapsulationSocket test" 2019-04-04 08:09:06 +00:00
paulhu
c999faee0e Merge "Fix ConnectivityServiceTest fail." am: 362d9fb687
am: f55f77908d

Change-Id: I7f185e731db91c30a9b0f14aefbdbb067942190e
2019-04-04 00:57:26 -07:00
Benedict Wong
b5bc70dc6a Fix flaky UdpEncapsulationSocket test
This commit reduces the flakiness of the
testOpenAndCloseUdpEncapsulationSocket by retrying up to three times.
Unfortunately, testing port-selected socket creation is racy against
other applications. This helps to handle the same race condition as done
in IpSecService#bindToRandomPort

Bug: 128024100
Test: 200x runs of testOpenAndCloseUdpEncapsulationSocket
Change-Id: I7e036ce821019dbac6c50899bd0894e89d2fe82a
2019-04-03 17:52:03 -07:00
paulhu
f55f77908d Merge "Fix ConnectivityServiceTest fail."
am: 362d9fb687

Change-Id: If3f7a3cbf2ed1a180a3b09872512a5f91bddd89c
2019-04-03 17:24:39 -07:00
Treehugger Robot
362d9fb687 Merge "Fix ConnectivityServiceTest fail." 2019-04-03 23:54:38 +00:00
TreeHugger Robot
76e2c02339 Merge "Move NetworkStatsFactory into service directory" 2019-04-03 23:44:26 +00:00
Bill Rassieur
d150242aeb Merge master@5406228 into git_qt-dev-plus-aosp.
am: 7a129c706d

Change-Id: I684e995988f5a8ef330fbbf55da7ae9230f0cfc2
2019-04-03 16:41:27 -07:00
Chenbo Feng
6566d1b82f Move NetworkStatsFactory into service directory
In order to notify netd to swap eBPF maps before pulling the
networkStats from eBPF maps, NetworkStatsFactory need to use the
NetdServices to issue binder calls. So it need to be moved from
framework/base/core to framework/base/service since object in
framework/base/core cannot get any system services. This change is also
necessary for setting up a lock inside NetworkStatsFactory to prevent
racing between two netstats caller since the lock need to be hold before
netd trigger the map swap.

Also fix the compile problem caused by moving the NetworkStatsFactory
and the related tests. Rename the packages and the jni functions to a
more proper name.

Bug: 124764595
Bug: 128900919
Test: NetworkStatsFactoryTest
      android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Change-Id: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
2019-04-03 14:28:41 -07:00
Chalard Jean
8aaebde014 Merge "Straighten AIDL interface for the memory store" 2019-04-03 19:58:46 +00:00
Chenbo Feng
550ed56426 Move NetworkStatsFactory into service directory
In order to notify netd to swap eBPF maps before pulling the
networkStats from eBPF maps, NetworkStatsFactory need to use the
NetdServices to issue binder calls. So it need to be moved from
framework/base/core to framework/base/service since object in
framework/base/core cannot get any system services. This change is also
necessary for setting up a lock inside NetworkStatsFactory to prevent
racing between two netstats caller since the lock need to be hold before
netd trigger the map swap.

Also fix the compile problem caused by moving the NetworkStatsFactory
and the related tests. Rename the packages and the jni functions to a
more proper name.

Bug: 124764595
Bug: 128900919
Test: NetworkStatsFactoryTest
      android.app.usage.cts.NetworkUsageStatsTest
      android.net.cts.TrafficStatsTest

Merged-In: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
Change-Id: Ifcfe4df81caf8ede2e4e66a76552cb3200378fa8
2019-04-03 11:33:40 -07:00
Chenbo Feng
9a10bb92b7 Merge "Clean up permissions when uids are no longer used" am: 9235821478 am: 6825c65462
am: c3a583e52e

Change-Id: I7773132d11d6225eac91ab2fee1043159c295d83
2019-04-03 11:03:32 -07:00
Chenbo Feng
c3a583e52e Merge "Clean up permissions when uids are no longer used" am: 9235821478
am: 6825c65462

Change-Id: I256ca6f16ea1fcd240a1b7cd2b3199d4504e6c33
2019-04-03 10:50:39 -07:00
Chenbo Feng
6825c65462 Merge "Clean up permissions when uids are no longer used"
am: 9235821478

Change-Id: I3c06a36368abb9a1e7885d281ea1155fce857eea
2019-04-03 10:38:57 -07:00
Treehugger Robot
9235821478 Merge "Clean up permissions when uids are no longer used" 2019-04-03 17:15:48 +00:00
paulhu
451b1c8609 Fix ConnectivityServiceTest fail.
NetdService#getInstance() will get null object in
WrappedConnectivityService constructor. Then pass this null
INetd object to PermissionMonitor will case NPE in
PermissionMonitor#sendPackagePermissionsToNetd()

Bug: None
Test: atest FrameworksNetTests
Change-Id: Ia1c80f9600a19c4aaf3f3c1b497b355d96c49c8e
2019-04-04 00:07:40 +08:00
lucaslin
73ac951566 Merge "Fix NetworkMonitor won't do private dns resolution" am: e121a329b8 am: 39810500f0
am: 266e2c5ac2

Change-Id: I2785e0aedd229aba6c1d8e8df09ee5c7a209b74c
2019-04-03 04:35:21 -07:00
lucaslin
266e2c5ac2 Merge "Fix NetworkMonitor won't do private dns resolution" am: e121a329b8
am: 39810500f0

Change-Id: I5ec0cb096f2704e21e0c0f296d5cf81ab8808627
2019-04-03 04:25:18 -07:00
lucaslin
39810500f0 Merge "Fix NetworkMonitor won't do private dns resolution"
am: e121a329b8

Change-Id: I7c7a573bef77ba952219e6f6f56ab11f0211e0a7
2019-04-03 04:13:48 -07:00
Mark Chien
5ca20d48aa Merge "Some cleanups for Tethering" am: 7cf4907b89 am: 997009af45
am: e28dc820e4

Change-Id: I0f5c8f33f13dfa2366992a2b2e0ada7667b90e2f
2019-04-03 03:54:42 -07:00
Treehugger Robot
e121a329b8 Merge "Fix NetworkMonitor won't do private dns resolution" 2019-04-03 10:50:09 +00:00
Mark Chien
e28dc820e4 Merge "Some cleanups for Tethering" am: 7cf4907b89
am: 997009af45

Change-Id: I0e00187f9a5eee9e55f961ce0458c9b91af19fb7
2019-04-03 03:45:05 -07:00
Mark Chien
997009af45 Merge "Some cleanups for Tethering"
am: 7cf4907b89

Change-Id: Ifb60c76855a2bea5a1cccf26034e6c582ad16021
2019-04-03 03:35:42 -07:00
Mark Chien
7cf4907b89 Merge "Some cleanups for Tethering" 2019-04-03 10:16:25 +00:00
Remi NGUYEN VAN
49b15870a9 Add common tests for FrameworksBaseTests and CTS
The common package covers tests that should be included both in CTS and
unit tests.

Test: atest FrameworksBaseTests
Bug: 129199908
Change-Id: I9c138d49ce010edde095e4bd3c47e36ca301634a
2019-04-03 18:53:04 +09:00
paulhu
fd7c030082 Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods
were added there because they could not be added as JNI inside
the NetworkStack. This was not possible because on Go devices,
the NetworkStack was a jar library. But now, Go also uses an APK.
Hence, move these methods to the NetworkStack.

Change-Id: I1d88a0f0be23f2b15d5103fa092b9bf982329d7c
Fix: 129433183
Test: atest NetworkStackTests FrameworksNetTests
2019-04-03 17:49:36 +08:00
Remi NGUYEN VAN
99d282d2f6 Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: cf0f380f4e am: fb943d00ca
am: 69528af3db

Change-Id: Icda65fe4a009a754b6a1a763d402820652d55391
2019-04-03 02:28:11 -07:00
Chenbo Feng
ade2fe930a Merge "Add tests for PermissionMonitor" am: 4e39721f18 am: e11632e768
am: 073ca45f14

Change-Id: Ifcb29bfded1b1675231c397ed886506a70267279
2019-04-03 02:19:30 -07:00
Remi NGUYEN VAN
69528af3db Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: cf0f380f4e
am: fb943d00ca

Change-Id: I82eee20855710de2b4fb541dd5e2b887140ed364
2019-04-03 02:12:22 -07:00
lucaslin
45e639b041 Fix NetworkMonitor won't do private dns resolution
NetworkMonitor cannot do the private dns resolution due to lack
"mNetworkCapabilities". ConnectivityService will call
NetworkStackService#notifyPrivateDnsChanged() before doing
network validation. After NetworkMonitor received
CMD_PRIVATE_DNS_SETTINGS_CHANGED, it will call
isValidationRequired to check if the validation is required.
But mNetworkCapabilities didn't be set, so the
mPrivateDnsProviderHostname will be set to empty and make
EvaluatingPrivateDnsState doesn't do private dns resolution.

Bug: 129375892
Test: 1. Build pass
      2. atest FrameworksNetTests
      3. atest NetworkStackTests

Change-Id: I637212fb4746bb2e9a2f4a4457fd36c4c2701149
2019-04-03 17:09:28 +08:00
Chenbo Feng
073ca45f14 Merge "Add tests for PermissionMonitor" am: 4e39721f18
am: e11632e768

Change-Id: I9be22991bd590a7aee4d0a4b2908e0023870d0b6
2019-04-03 02:05:07 -07:00
Remi NGUYEN VAN
fb943d00ca Merge "Fix API in CaptivePortal, StaticIpConfiguration"
am: cf0f380f4e

Change-Id: Ia36ba5946e8dc956c5c71cbebe7dc02658fdb7a0
2019-04-03 01:21:38 -07:00
Chenbo Feng
e11632e768 Merge "Add tests for PermissionMonitor"
am: 4e39721f18

Change-Id: I2079c4ce13aae962c1d907009edc107e861bb3b5
2019-04-03 01:10:07 -07:00