Commit Graph

7196 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c60936d4d3 [automerger skipped] Merge "Only show "Connected" note after opening portal" into qt-dev am: 09a8de5530 -s ours
am: ee36403e14 -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 45955ea176 is in history

Change-Id: I8ec96985154e8fedc64f6f9233930f2d1a9ee581
2019-06-26 01:15:05 -07:00
Remi NGUYEN VAN
71890d1c44 [automerger skipped] Merge "Only show "Connected" note after opening portal" into qt-dev am: 09a8de5530
am: d58de80141 -s ours
am skip reason: change_id I99be7d312d020d242081971c7e522023bbbab072 with SHA1 45955ea176 is in history

Change-Id: I087da26c8b643e8dad055955388c1b032a73f558
2019-06-26 01:07:44 -07:00
Remi NGUYEN VAN
d58de80141 Merge "Only show "Connected" note after opening portal" into qt-dev
am: 09a8de5530

Change-Id: I0113a80675f93cb95b3dccaba9777bfc31715130
2019-06-26 00:59:48 -07:00
Remi NGUYEN VAN
ee36403e14 [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 45955ea176 is in history

Change-Id: I50b62b92261b7386d7a15ab0e876661e8c4b0bac
2019-06-26 00:59:40 -07:00
Remi NGUYEN VAN
345e6cbf5f 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
a2d4439691 Merge "Only show "Connected" note after opening portal" am: 9840b88ffc am: bad4d1c6e9
am: 45955ea176

Change-Id: I2eaa815beba4240a8258202fc5fcaac1547cd1bc
2019-06-25 09:58:44 -07:00
Remi NGUYEN VAN
45955ea176 Merge "Only show "Connected" note after opening portal" am: 9840b88ffc
am: bad4d1c6e9

Change-Id: I99be7d312d020d242081971c7e522023bbbab072
2019-06-25 09:40:54 -07:00
Remi NGUYEN VAN
9840b88ffc Merge "Only show "Connected" note after opening portal" 2019-06-25 15:20:33 +00:00
Remi NGUYEN VAN
1ef1b0f482 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
cebe0fd9bb Merge "NetworkStats: Fix race condition causing system server crashes" am: 6420d3eaab am: f37da9a879
am: 45fb3b5615

Change-Id: Ieb9f17b6e3eed82c450a5b90dd67a00e4ede8b3f
2019-06-25 02:21:15 -07:00
Lorenzo Colitti
45fb3b5615 Merge "NetworkStats: Fix race condition causing system server crashes" am: 6420d3eaab
am: f37da9a879

Change-Id: I0ab308d5215ddb174ffb115e36948685d68da3ec
2019-06-25 01:53:11 -07:00
Lorenzo Colitti
6420d3eaab Merge "NetworkStats: Fix race condition causing system server crashes" 2019-06-25 07:54:17 +00:00
Hugo Benichi
e534caa644 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
a1580d0dea [automerger skipped] Merge "Don't auto-connect to networks that have no/limited connectivity." am: f7e4f831e3 am: ebdd783a9b -s ours
am: 0e5fb0af27 -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 1ec284f9d2 is in history

Change-Id: I44723afb20ec488e620fe792d7268ba0bcd6de9c
2019-06-24 09:11:15 -07:00
Lorenzo Colitti
0e5fb0af27 [automerger skipped] Merge "Don't auto-connect to networks that have no/limited connectivity." am: f7e4f831e3
am: ebdd783a9b -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 1ec284f9d2 is in history

Change-Id: I116cea63ccbfd5346ca218486671abae5176c273
2019-06-24 08:50:02 -07:00
Lorenzo Colitti
4130f57b08 [automerger skipped] Merge changes If7d41052,I66f263d7,Id45ae956,Iba752fed,I575a7e4f, ... into qt-r1-dev
am: 636e28a155 -s ours
am skip reason: change_id If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3 with SHA1 8c9d8c5e05 is in history

Change-Id: I5b525feb1e7df2a89dea4f38b521973ccaac0746
2019-06-24 08:17:26 -07:00
Lorenzo Colitti
f7e4f831e3 Merge "Don't auto-connect to networks that have no/limited connectivity." 2019-06-24 10:45:51 +00:00
Lorenzo Colitti
636e28a155 Merge changes If7d41052,I66f263d7,Id45ae956,Iba752fed,I575a7e4f, ... into qt-r1-dev
* changes:
  Inline readNetworkStatsDetailInternal, make mUseBpfStats final
  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-24 03:37:23 +00:00
Lorenzo Colitti
5050180784 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
Benedict Wong
1f282ae3a4 Remove VPN info arrays from NetworkStats(Observer|Recorder)
This change removes the now-unused VPN arrays in the network stats
observer and recorder classes. These are always null values in every
call site.

Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Merged-In: Ieb8645acc400fdaeb0df7092c5369b96f9f35af9
Change-Id: I66f263d7e12bce7668901306c0c2ecdda634abaf
(cherry picked from commit 255eebc51e)
2019-06-21 01:12:34 +00:00
Benedict Wong
176b66d170 NetworkStatsFactory: Take VPNs into account for network/battery stats
This change fixes detailed UID stats to ensure network and battery stats
both take VPNs into account. NetworkStatsFactory is being made aware of
VPNs enabled, and the full set of underlying networks present.

Since traffic can only be migrated over a NetworkStats delta, NSF
maintains a NetworkStats snapshot across all UIDs/ifaces/tags.

This snapshot gets updated whenever NSF records a new snapshot
(based on various hooks such as VPN updating its underlying networks,
network getting lost, etc.), or NetworkStatsService's
getDetailedUidStats() method being called.

This change widens the scope of the existing mPersistentSnapshot lock,
renaming it to mPersistentDataLock, and ensures that TUN migrations are
not done in parallel. Additionally, mVpnInfos is updated via
pointer-swapping, to reduce the scope of the mPersistentDataLock.

The safety of this change is predicated on:
1. NetworkStatsFactory lock not held, so services cannot deadlock through
the cyclical lock.

2. The broadening of the scope of the lock in NetworkStatsFactory has no
threading implications, as it is always the last (leaf node) lock held,
and therefore is impossible to have lock inversion.

Additionally, to ensure VPNs work with 464xlat, the VPN info passed to
the NetworkStatsFactory includes all underlying interfaces, instead of
only passing the first one.

This (partially) re-applies changes from:
aosp/972848: Add one more test for VPN usage stats.
aosp/972847: Addressing comments for http://ag/7700679.
aosp/885338: NetworkStatsService: Fix getDetailedUidStats to take VPNs
             into account.
Co-developed with: Varun Anand <vaanand@google.com>

Bug: 113122541
Bug: 120145746
Bug: 129264869
Bug: 134244752
Test: FrameworksNetTest passing
Test: Manual tests show data usage fixes maintained.
Merged-In: I6466ec1411fc5ed6954125d27d353b6cd1be719e
Change-Id: Id45ae956ad7165be346ecc010e17d260563ac1c0
(cherry picked from commit b98e069317)
2019-06-21 01:12:27 +00:00
Benedict Wong
89189b6489 Remove duplicate line in clat_simple test file
This change removes a redundant line in the xt_qtaguid_with_clat test
file.

Bug: 113122541
Bug: 134244752
Test: FrameworksNetTest passing
Merged-In: I87deb82ba960102b617ab27362e8c5899fa478f8
Change-Id: Iba752fed5600c8a470d14ccdf1dd437668d8dc15
(cherry picked from commit de27c6d055)
2019-06-21 01:12:17 +00:00
Benedict Wong
6eed854a32 Revert "Revert "Take all VPN underlying networks into account when migrating traffic for""
This reverts commit 9863ba9f09.

Reason for revert: Fix available for deadlocks.

Bug: 113122541
Bug: 134244752
Merged-In: Ib65214598837289bd39dbf040b56ab7835f893ba
Change-Id: Ia90bf2c72ef686e80800d113d03548e0efcadb66
(cherry picked from commit b393d28d65)
2019-06-21 01:09:49 +00:00
Chalard Jean
d01acc2c52 Merge "Factorize custom asserts." am: 6c176efa3d am: 99fbb40990
am: 1cf6627d18

Change-Id: I8774ea64f004999ddb46223a76a671388687d455
2019-06-20 14:06:58 -07:00
Chalard Jean
1cf6627d18 Merge "Factorize custom asserts." am: 6c176efa3d
am: 99fbb40990

Change-Id: I65ea7497abb8b77ebd10ba622075ef3b6c49b2a8
2019-06-20 14:01:31 -07:00
Chalard Jean
6480287469 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
d9cc092ae9 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev am: 94103bdf04 -s ours
am: 158be36637 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 c7fc2f7745 is in history

Change-Id: I275dec24a2e4519265b7b50cd0a0f68fd62f2968
2019-06-19 23:50:00 -07:00
Junyu Lai
5159a96cbb [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev am: 94103bdf04
am: 8ffb2b0106 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 c7fc2f7745 is in history

Change-Id: I2efc2fa71b1fa94f0010020f504eaaf7d11be8af
2019-06-19 23:32:40 -07:00
Junyu Lai
927e20cca0 [automerger skipped] Move the test of minimum supported keepalive slots to CTS am: f2ae439d82 -s ours
am: c01cd42a56 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 c7fc2f7745 is in history

Change-Id: I1f97cf977eb04ded8da003f3f56547ca70fa1d6e
2019-06-19 23:20:16 -07:00
Junyu Lai
7475417828 [automerger skipped] Correct value of supported keepalive count for cellular am: f55045649a -s ours
am: f2553dea50 -s ours
am skip reason: change_id Ia3761f2e78d54866bb2e156d58004396bbc8adc3 with SHA1 59fc443325 is in history

Change-Id: I9caaa1a09ecc37735ef741e5ce43f42fa9a779e5
2019-06-19 23:19:46 -07:00
Junyu Lai
158be36637 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev
am: 94103bdf04 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 c7fc2f7745 is in history

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

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

Change-Id: I5c37a44b17e75e439b7de21a3217237fad6e120b
2019-06-19 22:54:32 -07:00
Junyu Lai
94103bdf04 Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev 2019-06-20 05:35:07 +00:00
Junyu Lai
f55045649a 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
f2ae439d82 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
414cc31635 Merge "Move the test of minimum supported keepalive slots to CTS" am: 18e3198519 am: 6ff00fee75
am: 301bafa22e

Change-Id: If063ff023bf386884c6e42d2acb281763975ac8f
2019-06-19 07:36:52 -07:00
Junyu Lai
7e08862acb Merge "Correct value of supported keepalive count for cellular" am: d20d6e9f1e am: 056eeae27c
am: fca2e7c85c

Change-Id: Ia0c1e0511bffd630af4aae87cafd99e68a042149
2019-06-19 07:36:43 -07:00
Junyu Lai
301bafa22e Merge "Move the test of minimum supported keepalive slots to CTS" am: 18e3198519
am: 6ff00fee75

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

Change-Id: If833b813ba00eeff913160598f1ea9c74e6e35d8
2019-06-19 07:28:53 -07:00
Junyu Lai
18e3198519 Merge "Move the test of minimum supported keepalive slots to CTS" 2019-06-19 14:08:31 +00:00
Junyu Lai
d20d6e9f1e Merge "Correct value of supported keepalive count for cellular" 2019-06-19 14:08:31 +00:00
junyulai
c7fc2f7745 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
90f0cad875 Merge "Add SocketUtils CTS tests" am: c534d8ba36 am: f97246a87c
am: f1ecafec13

Change-Id: I36fb368217ff50319ae6f853f0d22cfc79541b40
2019-06-18 04:19:31 -07:00
Paul Hu
f1ecafec13 Merge "Add SocketUtils CTS tests" am: c534d8ba36
am: f97246a87c

Change-Id: I11e638a2fab004979298708a5c75bb7c2f208f67
2019-06-18 04:12:27 -07:00
Paul Hu
c534d8ba36 Merge "Add SocketUtils CTS tests" 2019-06-18 10:46:30 +00:00
Android Build Merger (Role)
2f7b97e9b5 Merge "[automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 -s ours am: 4f9407b6e9 -s ours am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 6eb4a5893b is in history" into qt-r1-dev-plus-aosp 2019-06-18 06:47:03 +00:00
Chalard Jean
1b56ee8e25 [automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 -s ours
am: 4f9407b6e9 -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 6eb4a5893b is in history

Change-Id: I45912237edf2f485e6e747c7b4878eb440096f18
2019-06-17 23:46:20 -07:00
Chalard Jean
0853c50f94 [automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8
am: 5fa9d376ea -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 6eb4a5893b is in history

Change-Id: Icb639762f04fbae7129a1962548dfd0da200e886
2019-06-17 23:45:18 -07:00
Chalard Jean
4f9407b6e9 [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 6eb4a5893b is in history

Change-Id: Ib3b27436b44e678f026ce5026abf23db2f50a4cf
2019-06-17 23:35:11 -07:00