Commit Graph

6464 Commits

Author SHA1 Message Date
Junyu Lai
b207526a0b Merge "Fix onBlockedStatusChanged does not work on multiple networks" into qt-dev 2019-04-11 06:58:48 +00:00
Remi NGUYEN VAN
c7a083a15e Merge "Expose captive portal urls for configuration" into qt-dev 2019-04-11 03:44:08 +00:00
Junyu Lai
52e795deeb Fix onBlockedStatusChanged does not work on multiple networks
There is a logic error in maybeNotifyNetworkBlockedForNewUidRules
that caused function to return if there is no status change in
the first network. This would cause CTS failed in devices which
has volte-enabled SIM inserted.

Bug: 129409153
Fix: 117969394
Test: 1. atest com.android.cts.net.HostsideNetworkCallbackTests \
         --generate-new-metrics 20
      2. atest FrameworksNetTests

Change-Id: I11168fd07a7c29e0605f2e874e9d9f41b5ad88b6
Merged-In: Ifd18d1c6ad708c1dbc793f03d8241f572af50317
(cherry picked from commit 6d3a92f7c2)
2019-04-10 03:23:58 +00:00
Remi NGUYEN VAN
fb6665c9cc Expose captive portal urls for configuration
Carriers in Mainland China need to customize certain captive portal
urls. The main issue is that google servers are not accessible in
Mainland China.

Added the following captive portal resources to be targeted for overlay.
- config_captive_portal_http_url
- config_captive_portal_https_url
- config_captive_portal_fallback_urls (string-array)
- config_captive_portal_fallback_probe_specs (string-array)

These values can be customized for e g diffent countries

Bug: 111819230
Test: atest FrameworksNetTests NetworkStackTests
Test: Add a product RRO that targets a specific country code,
insert a SIM card that matches that country code and check the log
what URL is used.

Merged-In: I54050b28bbfb93e0b7e509dbe0e987a0b902b7d9
Merged-In: I1f734c5f864bb2f2bc8ba1a66fe33d3480554f69
(cherry picked from commit e3896f71e1)

Change-Id: I278f2888851d38edb59157f8623541fbe94549b6
2019-04-10 02:03:27 +00:00
Benedict Wong
81e26c4f57 Fix remove-before-add for IpSecService RefcountedResource
This patch fixes a bug where if a binder dies before the linkToDeath
call, the cleanup will be performed before the entry is added to the
array. While it is safe in that quotas and tracking performs as per
normal, the RefcountedRecord may not be cleaned up.

Rethrowing this exception is safe, since the only paths that would hit
this are all on binder threads coming from applications. Further, it
seems there is only one real way of this getting hit - if the app that
called the creation died during the binder call.

Bug: 126802451
Test: Compiled, CTS tests passing
Change-Id: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
Merged-In: I6db75853da9f29e1573512e26351623f22770c5d
Merged-In: I416c2e43961ec0e1cc6b2fbcef970fbce858603b
Merged-In: Ib955acaa5e498c0e977cb5f2e48cffbc9fea8c7c
(cherry picked from commit a7bfdf8d8b)
2019-04-09 21:37:26 +00:00
TreeHugger Robot
35d521ed42 Merge "Address leftover comments on aosp/894233" into qt-dev 2019-04-09 13:39:29 +00:00
Chalard Jean
a2f3c1bf21 Address leftover comments on aosp/894233
Cherry-pick from commit 061f7a7eef,
with small conflict resolution.

Bug: 129510344
Test: m, boots, wifi connects, resolves DNS
Change-Id: Idf24f42a86bbfcc89e3ea8cf50d1b705d72ac613
Merged-In: Idf24f42a86bbfcc89e3ea8cf50d1b705d72ac613
Merged-In: Ia08104f839ef37139a8761e2e625bb10c94c275f
2019-04-09 12:16:52 +00:00
Lorenzo Colitti
0bf3e765f8 Merge "Fix ConnectivityServiceTest fail." into qt-dev 2019-04-09 10:25:10 +00:00
TreeHugger Robot
d74809c670 Merge "Fix flaky UdpEncapsulationSocket test" into qt-dev 2019-04-09 09:15:02 +00:00
paulhu
284eff450c 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: 128024100
Test: atest FrameworksNetTests
Change-Id: Ia1c80f9600a19c4aaf3f3c1b497b355d96c49c8e
Merged-In: I7f185e731db91c30a9b0f14aefbdbb067942190e
Merged-In: Ic77ef73841266da487401ffd657ef63562b6fc1e
(cherry picked from commit 716a9412cd)
2019-04-09 08:57:08 +00:00
Anil Admal
0e67b3543d 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
Merged-In: Ifa60d8f2d60aba4c4e2894dc612c224d45e3992d
Merged-In: Ifa4ec98d5c942522dfd569664f169fa841d495ed
(cherry picked from commit 4360e7f31c)
2019-04-09 06:45:57 +00:00
Lorenzo Colitti
9947ff22b4 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
Merged-In: Idf040a67e53d9b9ec6e6c647ce24f8ada501d355
Merged-In: Iad9aea4b42cd8b31a5a2659bb9cb54dd1c64e8b7
(cherry picked from commit a06b814245)
2019-04-09 06:44:32 +00:00
Remi NGUYEN VAN
9b27e1f8b8 Merge "Add common tests for FrameworksBaseTests and CTS" into qt-dev 2019-04-09 05:16:29 +00:00
Remi NGUYEN VAN
90a169ab37 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 4bc52348e7)

Change-Id: Ice433a41469e784385f19498c154345d7b9c69b5
2019-04-08 01:41:39 +00:00
Remi NGUYEN VAN
74bb94a6a3 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 1dd32bfb43)
2019-04-05 05:52:03 +00:00
TreeHugger Robot
63052bfe30 Merge "Move NetworkStatsFactory into service directory" 2019-04-03 23:44:26 +00:00
Bill Rassieur
8324718255 Merge master@5406228 into git_qt-dev-plus-aosp.
am: d831a04b97

Change-Id: I684e995988f5a8ef330fbbf55da7ae9230f0cfc2
2019-04-03 16:41:27 -07:00
Chenbo Feng
0b1e7e9243 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
5aac3d3b42 Merge "Straighten AIDL interface for the memory store" 2019-04-03 19:58:46 +00:00
Chenbo Feng
0c53fbe58f Merge "Clean up permissions when uids are no longer used" am: aa949eeae0 am: 26f1e2dbb1
am: 0bb39c6870

Change-Id: I7773132d11d6225eac91ab2fee1043159c295d83
2019-04-03 11:03:32 -07:00
Chenbo Feng
0bb39c6870 Merge "Clean up permissions when uids are no longer used" am: aa949eeae0
am: 26f1e2dbb1

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

Change-Id: I3c06a36368abb9a1e7885d281ea1155fce857eea
2019-04-03 10:38:57 -07:00
Treehugger Robot
aa949eeae0 Merge "Clean up permissions when uids are no longer used" 2019-04-03 17:15:48 +00:00
lucaslin
a024949a69 Merge "Fix NetworkMonitor won't do private dns resolution" am: 3c5b0fd9db am: cacb33bbe9
am: 3b8eb0b360

Change-Id: I2785e0aedd229aba6c1d8e8df09ee5c7a209b74c
2019-04-03 04:35:21 -07:00
lucaslin
3b8eb0b360 Merge "Fix NetworkMonitor won't do private dns resolution" am: 3c5b0fd9db
am: cacb33bbe9

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

Change-Id: I7c7a573bef77ba952219e6f6f56ab11f0211e0a7
2019-04-03 04:13:48 -07:00
Mark Chien
de9d6db457 Merge "Some cleanups for Tethering" am: 3f3d4bcb82 am: df676cf2d7
am: de38107021

Change-Id: I0f5c8f33f13dfa2366992a2b2e0ada7667b90e2f
2019-04-03 03:54:42 -07:00
Treehugger Robot
3c5b0fd9db Merge "Fix NetworkMonitor won't do private dns resolution" 2019-04-03 10:50:09 +00:00
Mark Chien
de38107021 Merge "Some cleanups for Tethering" am: 3f3d4bcb82
am: df676cf2d7

Change-Id: I0e00187f9a5eee9e55f961ce0458c9b91af19fb7
2019-04-03 03:45:05 -07:00
Mark Chien
df676cf2d7 Merge "Some cleanups for Tethering"
am: 3f3d4bcb82

Change-Id: Ifb60c76855a2bea5a1cccf26034e6c582ad16021
2019-04-03 03:35:42 -07:00
Mark Chien
3f3d4bcb82 Merge "Some cleanups for Tethering" 2019-04-03 10:16:25 +00:00
Remi NGUYEN VAN
c7ab6e6c67 Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: d2c44d4a82 am: ede0ad97a3
am: c70b764c2b

Change-Id: Icda65fe4a009a754b6a1a763d402820652d55391
2019-04-03 02:28:11 -07:00
Chenbo Feng
68f006c092 Merge "Add tests for PermissionMonitor" am: 5758c87a8f am: a75a64640c
am: 9c4ca1ae28

Change-Id: Ifcb29bfded1b1675231c397ed886506a70267279
2019-04-03 02:19:30 -07:00
Remi NGUYEN VAN
c70b764c2b Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: d2c44d4a82
am: ede0ad97a3

Change-Id: I82eee20855710de2b4fb541dd5e2b887140ed364
2019-04-03 02:12:22 -07:00
lucaslin
b2d1084807 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
9c4ca1ae28 Merge "Add tests for PermissionMonitor" am: 5758c87a8f
am: a75a64640c

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

Change-Id: Ia36ba5946e8dc956c5c71cbebe7dc02658fdb7a0
2019-04-03 01:21:38 -07:00
Chenbo Feng
a75a64640c Merge "Add tests for PermissionMonitor"
am: 5758c87a8f

Change-Id: I2079c4ce13aae962c1d907009edc107e861bb3b5
2019-04-03 01:10:07 -07:00
Remi NGUYEN VAN
d2c44d4a82 Merge "Fix API in CaptivePortal, StaticIpConfiguration" 2019-04-03 06:51:35 +00:00
Chalard Jean
a4aff26c51 Straighten AIDL interface for the memory store
Some names were still wrong somehow, and the wrappers were
missing.

Test: NetworkStack & FrameworkNetTests
Change-Id: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad
2019-04-03 15:18:08 +09:00
Treehugger Robot
5758c87a8f Merge "Add tests for PermissionMonitor" 2019-04-03 06:12:12 +00:00
markchien
d378cd342f Some cleanups for Tethering
Bug: 126481523
Test: -build, flash, boot
      -FrameworksNetTests

Change-Id: I904646efa87eb5434124c7828aca4ab09c5dc38e
2019-04-03 13:56:00 +08:00
Chenbo Feng
092d3a5997 Clean up permissions when uids are no longer used
The kernel eBPF maps have a blacklist to store all the uids that doesn't
have internet permission. When an app is unintalled from the device and
it is the last package on device that uses that uid, make sure we
cleaned the uid from the map and do not add no longer used uids into the
eBPF map. This action helps reduce the number of entries stored in the
map and reduce the chance of overflow the eBPF map.

Bug: 128944261
Test: PermissionMonitorTest
Change-Id: I10dd0113d00d6cf9ca39902d9721f2591d387d4a
2019-04-02 20:31:57 -07:00
Chenbo Feng
9866258883 Add tests for PermissionMonitor
Add more tests to PermissionMonitor to verify the functionality related
to INTERNET permission and UPDATE_DEVIE_STATS permission. Modified some
of the class design of PermissionMonitor so that it is easier to test
the new functionalities.

Bug: 111560570
Test: PermissionMonitorTest

Change-Id: Ic5585f337db5de48e2f87bf4f01ed7d85c349827
2019-04-02 20:31:49 -07:00
Junyu Lai
43fae5d9e3 Merge "Ignore the asynchronous result while stopping keepalive" am: d1723694a4 am: c82200fb29
am: d20b14db24

Change-Id: I5f1709f35a5faec7d9a110f3fa24e89ed1b05fbe
2019-04-02 04:24:18 -07:00
Junyu Lai
d20b14db24 Merge "Ignore the asynchronous result while stopping keepalive" am: d1723694a4
am: c82200fb29

Change-Id: I25daef8b1bbbbe93e636c320a032a486751ebcc9
2019-04-02 04:15:07 -07:00
Junyu Lai
c82200fb29 Merge "Ignore the asynchronous result while stopping keepalive"
am: d1723694a4

Change-Id: Idc6d76ca412f7bbae3b32e81756c419d84dc2c80
2019-04-02 04:05:49 -07:00
Junyu Lai
d1723694a4 Merge "Ignore the asynchronous result while stopping keepalive" 2019-04-02 10:48:23 +00:00
Paul Hu
91252ebe9a Merge "Address leftover comments on 923337 and 930217." am: b5db40605c am: 5d94f74e87
am: 426f2771e0

Change-Id: I75eadb66c81d72c768e77feddd383d60f8accd65
2019-04-02 01:29:08 -07:00
Paul Hu
426f2771e0 Merge "Address leftover comments on 923337 and 930217." am: b5db40605c
am: 5d94f74e87

Change-Id: Ibbc8dd7bb869f76515c9f57793db02953dd07804
2019-04-02 01:14:24 -07:00