Commit Graph

7061 Commits

Author SHA1 Message Date
Lorenzo Colitti
fbac9eefb8 Merge "Transfer ownership of NetworkStatsFactory to NetworkStatsService." am: c657dd301f
am: 92292f556b

Change-Id: If897c9c95fc8571949183c45a99a5c28cb032ebb
2019-06-27 01:31:46 -07:00
Chalard Jean
c421078227 Merge "Simplify Exception expressions in CSTest" am: afbf997ad5
am: 8e3bf0f8e3

Change-Id: I32182775bf36918438868c5b77d8d1aa995c788a
2019-06-27 01:11:02 -07:00
Chalard Jean
546cdc06f8 Merge "Unify assertThrows" am: 0272942bca
am: 3f21f94616

Change-Id: If349f647b34a71bc4eb1ba25ca18d543437eb969
2019-06-27 01:05:16 -07:00
Lorenzo Colitti
c657dd301f Merge "Transfer ownership of NetworkStatsFactory to NetworkStatsService." 2019-06-27 07:53:30 +00:00
Chalard Jean
afbf997ad5 Merge "Simplify Exception expressions in CSTest" 2019-06-27 07:09:36 +00:00
Chalard Jean
0272942bca Merge "Unify assertThrows" 2019-06-27 07:08:59 +00:00
Lorenzo Colitti
f5af7fcf16 Transfer ownership of NetworkStatsFactory to NetworkStatsService.
NetworkStatsService is the only consumer of the data coming from
NetworkStatsFactory, but the factory itself is instantiated and
owned by NetworkManagementService.

Move it into NetworkStatsService instead.

Test: atest FrameworksNetTests
Change-Id: I52df1e545c646927952579da22845a12d1d7563b
2019-06-26 19:29:51 +09:00
Remi NGUYEN VAN
203bde59b4 [automerger skipped] Merge "Only show "Connected" note after opening portal" into qt-dev
am: 09a8de5530 -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 844ea18005 is in history

Change-Id: I50b62b92261b7386d7a15ab0e876661e8c4b0bac
2019-06-26 00:59:40 -07:00
Remi NGUYEN VAN
13a87dccd1 Only show "Connected" note after opening portal
The "Connected" notification would be shown every time a network
validates after being identified as a captive portal. This causes issues
on networks that have auto-login mechanisms, as a high priority
notification would be shown even though the user was not interacting
with the phone.

The "Connected" notification is intended to confirm to the user that
they successfuly logged in (manually), so only show it after the user
opens the portal on the network.

Bug: 134124044
Test: Flashed, connected to portal: notification shown
      Opened portal from command line + revalidate: no notification
      Tests passing with change, failing without
Merged-In: I99be7d312d020d242081971c7e522023bbbab072
Merged-In: I7dc1b3a313b255fe89313efb9117bb160efdb533
(cherry picked from commit 0b5a4d862190320d285413b1feb921144fee8420)

Change-Id: I67c124cc34f09c2f186706b5cec839f60d00a90a
2019-06-26 01:55:51 +00:00
Remi NGUYEN VAN
844ea18005 Merge "Only show "Connected" note after opening portal" am: 5c28780629
am: bad4d1c6e9

Change-Id: I99be7d312d020d242081971c7e522023bbbab072
2019-06-25 09:40:54 -07:00
Remi NGUYEN VAN
5c28780629 Merge "Only show "Connected" note after opening portal" 2019-06-25 15:20:33 +00:00
Chalard Jean
d209586554 Simplify Exception expressions in CSTest
Test: CSTest
Change-Id: I2c7d9e3092497526ab7d87b40a508f2d4bc3d7a2
2019-06-25 20:40:41 +09:00
Chalard Jean
045d5fca24 Unify assertThrows
Test: atest FrameworksTestsNet NetworkStackTests
Change-Id: Ib6d5d2577a5b95f90857d8d146b00af516e9944d
2019-06-25 20:40:39 +09:00
Remi NGUYEN VAN
705b46b900 Only show "Connected" note after opening portal
The "Connected" notification would be shown every time a network
validates after being identified as a captive portal. This causes issues
on networks that have auto-login mechanisms, as a high priority
notification would be shown even though the user was not interacting
with the phone.

The "Connected" notification is intended to confirm to the user that
they successfuly logged in (manually), so only show it after the user
opens the portal on the network.

Bug: 134124044
Test: Flashed, connected to portal: notification shown
      Opened portal from command line + revalidate: no notification
      Tests passing with change, failing without

Change-Id: I89e7a7f49019bd7e4686712c56e00bd786eb3ef3
2019-06-25 19:18:16 +09:00
Lorenzo Colitti
ff811eea7e Merge "NetworkStats: Fix race condition causing system server crashes" am: f7d14dba58
am: f37da9a879

Change-Id: I0ab308d5215ddb174ffb115e36948685d68da3ec
2019-06-25 01:53:11 -07:00
Lorenzo Colitti
f7d14dba58 Merge "NetworkStats: Fix race condition causing system server crashes" 2019-06-25 07:54:17 +00:00
Hugo Benichi
5c8f9cf7ed NetworkStats: Fix race condition causing system server crashes
NetworkStatsService uses an internal boolean to know when it has
started for the purpose of preventing access to other internal
variables before they are initialized.

However that boolean is set to true in systemReady() non-atomically
with respect to the initialization of the other variables it guards,
which can cause the system server to crash.

This patch fixes this concurrency bug by moving setting the internal
boolean flag and the variable it guards in one atomic synchronized
block.

This patch also removes code checking if bandwidth control is enabled,
because this is now always true.

Bug: 132767673
Test: Compiled.
Change-Id: Ia089b5767ce271d669879c975508654d4dd03429
2019-06-25 10:51:51 +09:00
Lorenzo Colitti
693f58c378 [automerger skipped] Merge "Don't auto-connect to networks that have no/limited connectivity." am: df2b6ea27c
am: ebdd783a9b -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 336e846779 is in history

Change-Id: I116cea63ccbfd5346ca218486671abae5176c273
2019-06-24 08:50:02 -07:00
Lorenzo Colitti
df2b6ea27c Merge "Don't auto-connect to networks that have no/limited connectivity." 2019-06-24 10:45:51 +00:00
Lorenzo Colitti
2f2b961176 Don't auto-connect to networks that have no/limited connectivity.
Auto-reconnecting to a network with no or limited Internet
connectivity is not useful. This is because such networks cannot
be used unless the user taps the notification and interacts with
the resulting dialog. But the notification is only shown if the
user manually connects to the network, not if the system
auto-connects to it.

Bug: 130683832
Bug: 130766237
Test: atest FrameworksNetTests
Change-Id: I5413393529c4bad3a707df229307542486bcff33
Merged-In: I5413393529c4bad3a707df229307542486bcff33
2019-06-24 11:39:18 +09:00
Chalard Jean
500468fb90 Merge "Factorize custom asserts." am: 6c176efa3d
am: 99fbb40990

Change-Id: I65ea7497abb8b77ebd10ba622075ef3b6c49b2a8
2019-06-20 14:01:31 -07:00
Chalard Jean
af718367c2 Factorize custom asserts.
Also a few utilities that were in the way, and some opportunistic
cleanups.

Test: FrameworksNetTest NetworkStackTest
Change-Id: I385070e2044fd967cb18f1ffea9a86a4627b742e
2019-06-20 16:24:25 +09:00
Junyu Lai
893d1305c8 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev
am: e660a0a7e2 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

Change-Id: I6645b0b7be6f7d3b9e6fc2a547fad4df4e5e1cab
2019-06-19 23:01:08 -07:00
Junyu Lai
9205ceb27c [automerger skipped] Move the test of minimum supported keepalive slots to CTS
am: ca8b6ed19f -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

Change-Id: I793a942dc543573951b0cc527b3252c23f181a29
2019-06-19 22:54:47 -07:00
Junyu Lai
80b7c69d6f [automerger skipped] Correct value of supported keepalive count for cellular
am: 03e193c8a7 -s ours
am skip reason: change_id Ia3761f2e78d54866bb2e156d58004396bbc8adc3 with SHA1 ede0d5075b is in history

Change-Id: I5c37a44b17e75e439b7de21a3217237fad6e120b
2019-06-19 22:54:32 -07:00
Junyu Lai
e660a0a7e2 Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev 2019-06-20 05:35:07 +00:00
Junyu Lai
03e193c8a7 Correct value of supported keepalive count for cellular
Cellular only supports 1 keepalive connection so correct the default
supported value to 1.

Bug: 134037217
Bug: 134352656
Test: - atest FrameworksNetTests
      - atest android.net.cts.ConnectivityManagerTest \
        #testSocketKeepaliveLimitTelephony

Merged-In: Ia3761f2e78d54866bb2e156d58004396bbc8adc3
Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8
(cherry picked from commit 680abbb591d9c084d1a1e3f9dea1ed8d4e3b1ae8)
2019-06-20 04:02:38 +00:00
Junyu Lai
ca8b6ed19f Move the test of minimum supported keepalive slots to CTS
This change also enables log when keepalive is started.

Bug: 134352656
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest FrameworksNetTests
Merged-In: I408750fa0bceb0c1c26afb5fead4e44fb824fbc1
Change-Id: Ib9b06d3458782a648a2f5b8fd5a9ca1d34bd11f9
(cherry picked from commit aed835f086440f721c279e33d6b5d4b4bc270296)
2019-06-20 02:26:58 +00:00
Junyu Lai
59cc58b295 Merge "Move the test of minimum supported keepalive slots to CTS" am: c961e03526
am: 6ff00fee75

Change-Id: Ib9b06d3458782a648a2f5b8fd5a9ca1d34bd11f9
2019-06-19 07:29:11 -07:00
Junyu Lai
bafc7c9b8f Merge "Correct value of supported keepalive count for cellular" am: 7423873ac8
am: 056eeae27c

Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8
2019-06-19 07:28:53 -07:00
Junyu Lai
c961e03526 Merge "Move the test of minimum supported keepalive slots to CTS" 2019-06-19 14:08:31 +00:00
Junyu Lai
7423873ac8 Merge "Correct value of supported keepalive count for cellular" 2019-06-19 14:08:31 +00:00
junyulai
5b3b486b8f Move the test of minimum supported keepalive slots to CTS
This change also enables log when keepalive is started.

Bug: 134352656
Test: 1. atest android.net.cts.ConnectivityManagerTest#testSocketKeepaliveLimitTelephony
      2. atest FrameworksNetTests
Change-Id: I408750fa0bceb0c1c26afb5fead4e44fb824fbc1
2019-06-19 16:25:19 +08:00
Paul Hu
232ad69eaa Merge "Add SocketUtils CTS tests" am: 37377069ba
am: f97246a87c

Change-Id: I11e638a2fab004979298708a5c75bb7c2f208f67
2019-06-18 04:12:27 -07:00
Paul Hu
37377069ba Merge "Add SocketUtils CTS tests" 2019-06-18 10:46:30 +00:00
Chalard Jean
dd6df6a38f [automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev
am: 2ae76cdbe8 -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 a070aaa88f is in history

Change-Id: Ib3b27436b44e678f026ce5026abf23db2f50a4cf
2019-06-17 23:35:11 -07:00
Chalard Jean
c34b699c2e Remove the <= P restriction for WIFI_P2P
This is still sent in an intent.

Bug: 131764329
Fixes: 131764329
Merged-In: I56c86b0c1912064d5a642991df32d2cefb6a8d5b
Change-Id: I64b9d632be97dc51e6085162371bb8c19f410258
(cherry picked from commit e546cb0bd16b7359feeb3c46ba52e64cf91ae4d3)
2019-06-18 06:15:58 +00:00
Varun Anand
950e0419c0 Merge changes Ieb8645ac,I6466ec14,I87deb82b,I995b108e,Ib6521459 am: 2ce04660f6
am: 48f59a0fdf

Change-Id: I960e94b03b29282ae2b03f78a19ed2692bd88e05
2019-06-17 10:33:53 -07:00
Varun Anand
2ce04660f6 Merge changes Ieb8645ac,I6466ec14,I87deb82b,I995b108e,Ib6521459
* changes:
  Remove VPN info arrays from NetworkStats(Observer|Recorder)
  NetworkStatsFactory: Take VPNs into account for network/battery stats
  Remove duplicate line in clat_simple test file
  Remove unused lastStats parameter
  Revert "Revert "Take all VPN underlying networks into account when migrating traffic for""
2019-06-17 15:56:24 +00:00
Chalard Jean
649a5747ef Merge "Remove the <= P restriction for WIFI_P2P" am: 43a52d0aaa
am: bb754c9c8d

Change-Id: I14f5865249740587d550ac31b59883f4a87fd4a1
2019-06-17 08:20:18 -07:00
Treehugger Robot
43a52d0aaa Merge "Remove the <= P restriction for WIFI_P2P" 2019-06-17 14:58:21 +00:00
Chalard Jean
990438b35b [automerger skipped] Merge changes I80bebcd0,I35f3718f into qt-dev
am: 08793a3b64 -s ours
am skip reason: change_id Iad0e9a28670e96a3c953518a0d0ccd77e2f2fa80 with SHA1 6988872c91 is in history

Change-Id: I9094b83959e1f75f90edac095060240c129b73b0
2019-06-17 07:21:50 -07:00
Chalard Jean
5411bda0ca Simplification of code to prevent a Log.wtf in expected cases.
This mostly serves to unindent code to make it locally more
readable. It is a functional no-op.

Bug: 135043192
Test: atest FrameworksNetTests
Merged-In: Iad0e9a28670e96a3c953518a0d0ccd77e2f2fa80
Change-Id: I80bebcd04c277f6e4b0665fe1253b2309e3bc535
(cherry picked from commit e1f5759319a4559b3cf89029449878dc56f92bb7)
2019-06-17 13:16:46 +00:00
Chalard Jean
164ce6f0da Merge "Simplification of code to prevent a Log.wtf in expected cases." am: 3cc6f6627f
am: fbc68b975a

Change-Id: I5f5fa22468c8db09e4eeb3d446220b4ebc396d98
2019-06-17 04:24:08 -07:00
Chalard Jean
a070aaa88f Remove the <= P restriction for WIFI_P2P
This is still sent in an intent.

Bug: 975059
Change-Id: I56c86b0c1912064d5a642991df32d2cefb6a8d5b
2019-06-17 19:46:34 +09:00
Chalard Jean
3cc6f6627f Merge "Simplification of code to prevent a Log.wtf in expected cases." 2019-06-17 10:37:50 +00:00
Chalard Jean
6988872c91 Simplification of code to prevent a Log.wtf in expected cases.
This mostly serves to unindent code to make it locally more
readable. It is a functional no-op.

Bug: 135043192
Test: atest FrameworksNetTests
Change-Id: Iad0e9a28670e96a3c953518a0d0ccd77e2f2fa80
2019-06-17 18:01:35 +09:00
Xiao Ma
6033e849b2 Merge "Restore the Private DNS settings to default mode upon network resets." into qt-dev
am: 49fd0568b5

Change-Id: I42959ec5d1194851294e007e6e3d872678a85b6d
2019-06-16 21:15:04 -07:00
Chiachang Wang
799bf5a8cc Suppress the wtf log for notifications that are expected
PARTIAL and NO_INTERNET may happen in the real world for
those transport types that provide internet. These two
notification types should be reasonable notificaitons, not a
terrible failure as the log. For Q, it may be too risky to
display more notifications with other information instead of
SSID. Thus, suppress the wtf log for these two notifications.

Bug: 135043192
Test: atest FrameworksNetTests
Change-Id: I35f3718fa93b403858587d918f0bc596f6c92f3e
Merged-In: I91b92249dc7905aadbc59df50c3bc6da30a8590e
Merged-In: Ia1c2a765b0fb0cc8d440c02533bdc15774a5a3ef
(cherry picked from commit ed0a54bd07ea1c9072459bafeaf796eaa4dad4c5)
2019-06-17 02:09:27 +00:00
TreeHugger Robot
49fd0568b5 Merge "Restore the Private DNS settings to default mode upon network resets." into qt-dev 2019-06-17 01:08:00 +00:00