Commit Graph

253 Commits

Author SHA1 Message Date
Chiachang Wang
e06af927c9 Merge "Move Setting constants for NetworkStack" am: 587ee7240e
am: a158ee1975

Change-Id: I6820300c412f94989a5fce7bd6c6f2a3b983b96e
2019-04-18 01:10:50 -07:00
Chiachang Wang
587ee7240e Merge "Move Setting constants for NetworkStack" 2019-04-18 07:35:19 +00:00
Remi NGUYEN VAN
6f7f3b7f0a Merge "Add overlayable tag for NetworkStackConfig" into qt-dev
am: 5410580108

Change-Id: I98780c1197802f26883d683d63be675c9d72024f
2019-04-17 22:49:07 -07:00
Remi NGUYEN VAN
5410580108 Merge "Add overlayable tag for NetworkStackConfig" into qt-dev 2019-04-18 05:36:34 +00:00
Chiachang Wang
8b2a8821a9 Move Setting constants for NetworkStack
From mainline perspective, we should use android flag api
instead of using Settings. Thus, move the definitions into
NetworkStack and apply new flag design.

Bug: 123167629
Test: atest NetworkStackTests
Change-Id: I9602263f0bff5d8e942bd652de69ccfcb3034a2f
2019-04-17 17:00:54 +08:00
Chalard Jean
896245a1e2 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
Merged-In: I4882686a86e7c6d42f4b0619b921d02619ed6d4c
Merged-In: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-17 05:45:40 +00:00
Chalard Jean
c728f75abd Merge "Move TrafficStats tags for the network stack constants" into qt-dev
am: e7ef0a61f2

Change-Id: I9b648ed6c687d56db61a54570c7880c51c1bae51
2019-04-16 15:06:03 -07: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
990ea84d2d Merge "Change the validation URL for Chinese SIMs" am: 08d4a537ec
am: bea65fa482

Change-Id: I79f0c73f1a5c3edf64c347611555e00c3a9a6516
2019-04-12 05:54:46 -07: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
fb21fb8724 Merge "Migrate NetworkStack metrics off StatsLog.write" into qt-dev
am: fa124d7bf4

Change-Id: I1bfe856d771bf56fe33790aea22eceae2001921a
2019-04-11 18:26:16 -07:00
Remi NGUYEN VAN
08d4a537ec Merge "Change the validation URL for Chinese SIMs" 2019-04-12 01:18:12 +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
Xiao Ma
186bf7c679 Merge "provide a resource overlay to configure customized DNS Server." am: 7db7b331ef
am: c116de19c3

Change-Id: Iba867a3b7bda1f5db9dfa1b7521d4a4badbf88e0
2019-04-11 11:27:53 -07:00
Chiachang Wang
ea1a7389d4 Merge "Address nit in NetworkStackUtils" am: 076317a01f
am: df598dc827

Change-Id: Ide4741305724a9e0d26305f8406c5445f9de12b3
2019-04-11 11:21:36 -07:00
Remi NGUYEN VAN
bff270bec1 Merge "Freeze netd AIDL interface (framework)" am: eb8d81ca14
am: e427c17917

Change-Id: Ib852b0555f0e20b858f9dd0b16dbd98dbbd22b55
2019-04-11 10:29:59 -07: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
Treehugger Robot
7db7b331ef Merge "provide a resource overlay to configure customized DNS Server." 2019-04-11 11:06:51 +00:00
Chiachang Wang
076317a01f Merge "Address nit in NetworkStackUtils" 2019-04-11 10:48:58 +00:00
Remi NGUYEN VAN
de568f7289 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
2019-04-11 17:23:35 +09:00
Xiao Ma
a4d0122048 provide a resource overlay to configure customized DNS Server.
Bug: 122621524
Test:  atest FrameworksNetTests NetworkStackTests
Change-Id: I123b3d4516cc6ba6d17629eb74daf448ba7121eb
2019-04-11 15:30:23 +09: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
Chiachang Wang
b805040fef Address nit in NetworkStackUtils
Follow up commit to fix nit in aosp/937891

Bug: 120013793
Test: Build
Change-Id: I61a6306d3c439a2d72323ab56e2b47771cc60d48
2019-04-11 11:10:51 +08:00
Remi NGUYEN VAN
eb8d81ca14 Merge "Freeze netd AIDL interface (framework)" 2019-04-11 00:13:29 +00:00
Lorenzo Colitti
bb41c8f751 Merge "Add lifecycle tests to NetworkMonitorTest" am: 047940eff0
am: 7509e6e5a1

Change-Id: Ib4b6084c4969d9e99ba338c558a41fd56c0e9024
2019-04-10 02:57:17 -07:00
Lorenzo Colitti
047940eff0 Merge "Add lifecycle tests to NetworkMonitorTest" 2019-04-10 09:30:03 +00:00
Akshay Thakker
e19bd90b87 Merge "Update version numbers to 0210000000" into qt-dev
am: 9800d82743

Change-Id: I996cd2c48fe24e7c31cad915d4d14a5e96504ec7
2019-04-09 21:56:24 -07:00
Chiachang Wang
e9a39ceb6b Merge "Move data stall definitions out from Setting" 2019-04-10 03:27:19 +00:00
Akshay Thakker
9800d82743 Merge "Update version numbers to 0210000000" into qt-dev 2019-04-10 02:47:48 +00:00
Chiachang Wang
2449e583d8 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
Merged-In: I8e1fb5b47fff3bf624131ba1f5732daabd991e6d
Merged-In: I0a2a1e5d3de14ea86556ca471e26064df3481412
2019-04-10 02:37:57 +00:00
Remi NGUYEN VAN
eec0ed4056 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
Change-Id: I43a6a38685d5fbc669cd573c4d7e7f99bd596952
2019-04-10 11:26:25 +09: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
Lorenzo Colitti
cdef556adf 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
2019-04-09 23:12:33 +09:00
Chiachang Wang
574705c4d1 Merge "Move data stall definitions out from Setting" into qt-dev
am: 6839f419de

Change-Id: I0a2a1e5d3de14ea86556ca471e26064df3481412
2019-04-09 05:30:34 -07: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
Remi NGUYEN VAN
8beec384fd Merge "Expose captive portal urls for configuration" am: 7bb487a582
am: 2877796f70

Change-Id: I54050b28bbfb93e0b7e509dbe0e987a0b902b7d9
2019-04-08 23:40:05 -07: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
Remi NGUYEN VAN
7bb487a582 Merge "Expose captive portal urls for configuration" 2019-04-09 04:37:48 +00:00
Lorenzo Colitti
3a1c0ad3ee Merge "Don't leak captive portal broadcast receivers." am: 873badbd1c
am: c097e76769

Change-Id: I1db24fe05ada8b3a37a9a60aa568b6153bf51ad8
2019-04-08 21:35:03 -07:00
Niklas Lindgren
afc5f9bd3d 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.
Change-Id: I38a294a5e14417f65e96e76235ea153c53c4d7cc
2019-04-09 10:23:53 +09:00
Lorenzo Colitti
ad85847666 Merge "Prevent SIGN_IN notification pop up several times" into qt-dev
am: 462864489a

Change-Id: I19bc873221e1200fd935d7759aa76ec113de4325
2019-04-08 05:15:50 -07:00
Lorenzo Colitti
e35374386b 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
2019-04-08 21:14:23 +09: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