Commit Graph

210 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
7035b7949c Change the validation URL for Chinese SIMs
The default HTTPS and fallback validation URLs are not accessible from
China, so users in China never get a validated network on WiFi with the
default AOSP settings. OEMs selling devices targeting China typically
change the check URLs for that reason.

When the device uses a Chinese SIM card, change the default validation
URLs to URLs accessible accessible from China as of now.

Test: inserted China SIM, WiFi off/on, dumpsys network_stack shows new
      URL used
Bug: 111819230
Change-Id: Ib7f41f470ef1a9c7712f2477ebfab44e915cf1b9
Merged-In: Ib7f41f470ef1a9c7712f2477ebfab44e915cf1b9
(cherry picked from commit 990ea84d2d)
2019-04-18 13:30:00 +00:00
Remi NGUYEN VAN
5410580108 Merge "Add overlayable tag for NetworkStackConfig" into qt-dev 2019-04-18 05:36:34 +00:00
Chalard Jean
6a76b7e2e4 Move TrafficStats tags for the network stack constants
As per API council feedback, these constants should live in
a place that is private to the network stack, only with a
range defined in system API.

Bug: 129433383
Test: m
Change-Id: I84a90f84a9af6fef4667ee4d512ebd0413222086
(cherry picked from commit 79a6330650ca04bd7a08afbd63f8016a3b30bc72)
2019-04-16 00:41:54 +09:00
Remi NGUYEN VAN
d361ff3cb9 Freeze netd AIDL interface (framework)
This freezes the interface as of the latest beta build, although it has
not changed since then.
This change adds the necessary implementations for getInterfaceVersion.

Test: flashed, WiFi working
Bug: 128803828
Merged-In: Ib852b0555f0e20b858f9dd0b16dbd98dbbd22b55
Merged-In: I0c231bdce89474b53603cc15d55787c8c78a809d
(cherry picked from commit fd4eafe8f6)

Change-Id: Idc0e7ea98dbf57e07ee578bc1772c2111af2e563
2019-04-12 03:34:02 +00:00
Chiachang Wang
f5d37ae877 Merge "Address nit in NetworkStackUtils" into qt-dev 2019-04-12 03:15:00 +00:00
Chiachang Wang
44d36f6be3 Address nit in NetworkStackUtils
Follow up commit to fix nit in aosp/937891

Bug: 120013793
Test: Build
Change-Id: I61a6306d3c439a2d72323ab56e2b47771cc60d48
Merged-In: Ide4741305724a9e0d26305f8406c5445f9de12b3
(cherry picked from commit cfb4e06b14)
2019-04-12 01:01:50 +00:00
Chiachang Wang
e512b26913 Migrate NetworkStack metrics off StatsLog.write
Now that the new metrics API can be used, NetworkStack
metrics need to migrate off the legacy StatsLog.write.

Bug: 130323000
Test: Test with ./out/host/linux-x86/bin/statsd_testdrive 121
      to ensure log properly
Test: Ensure NetworkStackStatsLog will be generated as expected
Test: atest NetworkStackTest

Change-Id: I8c70503cf1d9f1d06f30a1936d2d88857d0cff53
2019-04-11 21:24:28 +08:00
Lorenzo Colitti
5beebde64d Add lifecycle tests to NetworkMonitorTest
- Ensure that NetworkMonitor quits when notifyNetworkDisconnected
  is called.
- Ensure that BroadcastReceivers are registered when a captive
  portal is detected and unregistered when the network validates
  or when NetworkMonitor quits.

Bug: 122164725
Test: atest FrameworksNetTests NetworkStackTests
Test: atest --generate-new-metrics 10 NetworkStackTests:com.android.server.connectivity.NetworkMonitorTest
Test: test fails if "Don't leak captive portal broadcast receivers." change reverted
Change-Id: I1202626face33cc1e1ec02016b95da487b3335c8
Merged-In: I1202626face33cc1e1ec02016b95da487b3335c8
(cherry picked from commit bb41c8f751)
2019-04-11 11:52:27 +00:00
Remi NGUYEN VAN
e0603420f8 Merge "Expose captive portal urls for configuration" into qt-dev 2019-04-11 03:44:08 +00:00
Remi NGUYEN VAN
1f8e5289c8 Add overlayable tag for NetworkStackConfig
This allows OEMs to customize the added resources with an overlay APK
installed in the product, system or vendor partition.

Bug: 111819230
Test: Installed test APK, verified resources changed. Resources not
      mentioned in overlayable file were not changed.

Change-Id: I24670005ea940d2ac29b8a0ff93e1559604fd3a8
2019-04-11 03:32:43 +00:00
Akshay Thakker
9800d82743 Merge "Update version numbers to 0210000000" into qt-dev 2019-04-10 02:47:48 +00:00
Remi NGUYEN VAN
9ca4c62612 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 2977a40b1e)

Change-Id: I278f2888851d38edb59157f8623541fbe94549b6
2019-04-10 02:03:27 +00:00
Chiachang Wang
6839f419de Merge "Move data stall definitions out from Setting" into qt-dev 2019-04-09 11:52:54 +00:00
TreeHugger Robot
7c0d309886 Merge "Add a mechanism to pass the L2Key and group hint to IpClient" into qt-dev 2019-04-09 10:21:39 +00:00
Chiachang Wang
0b98441205 Move data stall definitions out from Setting
From mainline perspective, we should use android flag api
instead of using Settings. Thus, move the definitions into
NetworkStack.

Bug:120013793
Test: atest NetworkStackTests SettingsBackupTest
Change-Id: I8e1fb5b47fff3bf624131ba1f5732daabd991e6d
2019-04-09 08:32:55 +00:00
Chalard Jean
d3c34d4c59 Add a mechanism to pass the L2Key and group hint to IpClient
Test: IpClientTest
Bug: 128803828
Change-Id: I399b20ce29a385a74971b7a7248a48cb4d66deb6
(cherry picked from commit 3cab290648)
2019-04-09 07:55:17 +00:00
Lorenzo Colitti
15be2b1a36 Don't leak captive portal broadcast receivers.
Since aosp/937885, mLaunchCaptivePortalAppBroadcastReceiver is
nulled out, but not unregistered, when exiting MaybeNotifyState.
This causes the BroadcastReceiver to be leaked because it is no
longer unregistered when processing CMD_NETWORK_DISCONNECTED.

Fix this by unregistering the receiver in MaybeNotifyState#exit.
Also remove the unregister call in CMD_NETWORK_DISCONNECTED: it
is no longer necessary, because StateMachine, before quitting,
will call the exit method of the current state and all its
parent states.

Bug: 122164725
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I447b3cfd3821dda19482ed962dd59ec61fc5fc9b
Merged-In: I1db24fe05ada8b3a37a9a60aa568b6153bf51ad8
(cherry picked from commit 3a1c0ad3ee)
2019-04-09 06:26:23 +00:00
Lorenzo Colitti
462864489a Merge "Prevent SIGN_IN notification pop up several times" into qt-dev 2019-04-08 12:03:10 +00:00
lucaslin
2b14c799b8 Prevent SIGN_IN notification pop up several times
SIGN_IN notification may pop up several times before user
logged in the network if someone trigger
ConnectivityService#reportNetworkConnectivity().
Add a boolean to make sure SIGN_IN notification will only pop up
once to user before user logged in.

Bug: b/122164725
Test: Build pass.
Change-Id: I9c7f1d47fde8e5dfadd6646497023b05f3b0ed88
Merged-In: I9c7f1d47fde8e5dfadd6646497023b05f3b0ed88
2019-04-08 15:47:25 +08:00
Remi NGUYEN VAN
995aada788 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 fe71be2b04)

Change-Id: Ice433a41469e784385f19498c154345d7b9c69b5
2019-04-08 01:41:39 +00:00
Akshay
296acdfb88 Update version numbers to 0210000000
Update version number to 0210000000. The Beta 2 builds (which are in dogfood an public beta) will receive modules via the Play Store with version numbers 0200000000. Hence, we must bump the version in qt-dev and hence beta 3. This is so that prebuilts in the beta 3 OTA will be higher than any Play Store pushes on beta 2. We are bumping it by 10000000 so that we have name space to do intermediate cherrypick builds if needed.

Bug: 129977903
Change-Id: Ibacb2a5a232e1d4491d14e89404c99d50fe314ae
2019-04-04 22:41:12 +00:00
Yifan Hong
654b1e69bb Fix NetworkStackTests.
NetworkStackTests dlopens library which indirectly
uses libcgrouprc. Add it to jni_libs.

Test: atest
Fixes: 129902619
Change-Id: I0d60d7a317fa60607d6fdaea15f61b458aefd2f0
Merged-In: I0d60d7a317fa60607d6fdaea15f61b458aefd2f0
2019-04-04 13:20:12 -07:00
Chalard Jean
943e7405f2 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
Paul Hu
d3c115b26a Merge "Make CaptivePortalProbeSpec and CaptivePortalProbeResult as a library" am: 3db9cfe660 am: 2d20cd2378
am: 4bf4e79766

Change-Id: Iccf60b710df5895d8d269b6c918a8b2f252e93a6
2019-04-02 21:19:14 -07:00
paulhu
b0f53b84cc Make CaptivePortalProbeSpec and CaptivePortalProbeResult as a library
These two classes were added to @SystemApi because they are used
both by NetworkMonitor and CaptivePortalLogin. However it turns
out they are not needed in the framework, so having them as a
library sounds better.

Change-Id: Iadf77ec5952b6da8812dc6d006a39bd4e93d2bd9
Fix: 129433264
Test: atest NetworkStackTests FrameworksNetTests
2019-04-02 17:55:42 +08:00
Paul Hu
5428e660ca Merge "[IPMS] Implement regular maintenance" am: 7f10bb1c11 am: c308297bc2
am: 7da31a0cf5

Change-Id: I5be38b1eb3d05d5e7c8fa93094816bb3dab7b5d4
2019-04-01 19:32:54 -07:00
Paul Hu
7f10bb1c11 Merge "[IPMS] Implement regular maintenance" 2019-04-02 01:39:38 +00:00
Remi NGUYEN VAN
073e73a0c1 Merge "Rename NetworkStackPermissionStub" 2019-04-02 01:31:51 +00:00
Chalard Jean
cf7b25e013 Merge "Cleanup SystemReady in the network stack" am: e0ef7ce4f7 am: 4b130e8567
am: aafb4b0576

Change-Id: I0e57236ede9dd176cd30ea034d05205776662c91
2019-04-01 18:13:24 -07:00
Chiachang Wang
ec35d666c1 Merge "Link to android experimental flags API" 2019-04-02 00:51:51 +00:00
Remi NGUYEN VAN
fc6b247d35 Rename NetworkStackPermissionStub
Use NetworkStackPermissionConfig instead.

Bug: 129317412
Test: Flashed, booted, WiFi working
Merged-In: I7bdc058dddfa483823074055ad5c9d7d2efd37b9
Change-Id: I45299c12598cd3b33bfd78ae8698d98b77b18dc0
2019-04-02 00:14:05 +00:00
Remi NGUYEN VAN
1fc0bd6aaa Merge "Rename NetworkStackPermissionStub" 2019-04-02 00:10:19 +00:00
Chalard Jean
e0ef7ce4f7 Merge "Cleanup SystemReady in the network stack" 2019-04-01 23:28:47 +00:00
paulhu
028d7a55fd [IPMS] Implement regular maintenance
Implement regular maintenance of IpMemoryStoreService. Regular
maintenance is scheduled for when the device is idle with access
power and a minimum interval of one day.

Bug: 113554482
Test: atest NetworkStackTests
Change-Id: Id3985e30d12307fc2e9fcbe782caaf97a627cef3
2019-04-01 23:35:36 +08:00
Remi NGUYEN VAN
6ba6b79e51 Merge "Add comment for NetworkStack permissions" am: 154a0d0b38 am: b4493ea049
am: 0737917d03

Change-Id: If9c8d887e04bf173badb6b147d9a4379daf6d93f
2019-04-01 08:13:16 -07:00
Treehugger Robot
154a0d0b38 Merge "Add comment for NetworkStack permissions" 2019-04-01 14:45:18 +00:00
Xiao Ma
60a54acbbf Merge "Add DHCP address lease expiry in IpMemoryStore." am: 17ea70c6d3 am: 23f6cd281a
am: 8e6c80f238

Change-Id: Ib09ee6a702fb25a682d4782a8822237ebb9a0dfb
2019-04-01 06:35:34 -07:00
Xiao Ma
17ea70c6d3 Merge "Add DHCP address lease expiry in IpMemoryStore." 2019-04-01 12:59:20 +00:00
Paul Hu
b2913320cd Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: f9d61f1c6d am: 96f34c3151
am: bf3e6f5e75

Change-Id: I599dcdb2312a3e1bb1de8e03f349df207c7cc075
2019-04-01 00:52:53 -07:00
Chiachang Wang
ede84b60dd Link to android experimental flags API
Bug: 120013793
Test: Build and atest NetworkStackTests
Change-Id: I5c12b48e886e124025ecaa8548b70f26ebd20263
2019-04-01 15:41:06 +08:00
Paul Hu
f9d61f1c6d Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." 2019-04-01 07:20:53 +00:00
Chiachang Wang
5640a8d124 Merge "Provide link to android experimental flags API" am: 9876efdabe am: a94479c120
am: 8724b66c2d

Change-Id: I4045d54066cf1c8270bb6eca030daf0193721723
2019-03-31 22:25:35 -07:00
Chiachang Wang
9876efdabe Merge "Provide link to android experimental flags API" 2019-04-01 04:49:33 +00:00
Remi NGUYEN VAN
b93bfa1d69 Merge "Fix race when starting NetworkMonitor" am: 78454f3c46 am: f75ba075e4
am: 940cbf970a

Change-Id: I595ecdbf0b8e91fec4287c3476239a1e6c9c80a7
2019-03-31 21:35:25 -07:00
Chalard Jean
d74219ba4a Cleanup SystemReady in the network stack
The system server (in SystemServer.java) defines the boot
sequence, during which an event called SystemReady happens.
This corresponds to a time when critical system services
that are depended upon by other components in the system
server are ready to handle requests from their dependencies.
Some system services are listening to this event to defer
initializations that depend on the critical services.

Because the network stack is only started after SystemReady,
there is no way any NetworkMonitor may be started before
SystemReady. Remove the associated mechanism.

Fix: 129376083
Test: FrameworksNetTests
Change-Id: I071eeb10d0b7c4f71af6653d322c7b442b2cc7ee
2019-04-01 13:32:25 +09:00
Remi NGUYEN VAN
e799f84de0 Add comment for NetworkStack permissions
Clarify that permissions must not be in the base package to avoid
crashes on devices using a network stack running in the system server
process.

Test: m
Change-Id: Ib13df84a43e960d01217c208d1c6775d1f81edc4
2019-04-01 04:24:14 +00:00
Remi NGUYEN VAN
95c5375a85 Merge "Move permissions from base to standard manifest" 2019-04-01 04:20:41 +00:00
Remi NGUYEN VAN
78454f3c46 Merge "Fix race when starting NetworkMonitor" 2019-04-01 03:54:03 +00:00
Remi NGUYEN VAN
3962f678c3 Fix race when starting NetworkMonitor
NetworkMonitor obtained LinkProperties and NetworkCapabilities via
synchronous calls to ConnectivityManager after receiving an asynchronous
notification, which is prone to races: the network could be gone before
the LinkProperties/NetworkCapabilities can be fetched.

Fix the race by passing LinkProperties/NetworkCapabilities directly to
NetworkMonitor in the asynchronous notifications.

Test: atest FrameworksNetTests NetworkStackTests
Test: booted, WiFi works
Bug: 129375892
Change-Id: I200ac7ca6ff79590b11c9be705f650c92fd3cb63
2019-04-01 11:33:10 +09:00
paulhu
819e0aff30 Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues.
Fix: 129362082
Fix: 129361362
Fix: 129360330
Fix: 129362379
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I05fbc6f98207d5cf002e3cbc5829040af7d6be52
2019-04-01 10:23:51 +08:00