Commit Graph

7410 Commits

Author SHA1 Message Date
Lorenzo Colitti
5481069c06 [automerger skipped] Merge "Don't auto-connect to networks that have no/limited connectivity." am: df2b6ea27c am: ebdd783a9b -s ours am: 693f58c378 -s ours
am: d48d9b4e5c -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 336e846779 is in history

Change-Id: I2979e7f1cac35d2040f326cf378432f8a4620709
2019-06-24 09:50:57 -07:00
Lorenzo Colitti
d48d9b4e5c [automerger skipped] Merge "Don't auto-connect to networks that have no/limited connectivity." am: df2b6ea27c am: ebdd783a9b -s ours
am: 693f58c378 -s ours
am skip reason: change_id I5413393529c4bad3a707df229307542486bcff33 with SHA1 336e846779 is in history

Change-Id: I44723afb20ec488e620fe792d7268ba0bcd6de9c
2019-06-24 09:11:15 -07:00
Lorenzo Colitti
7d724a405d [automerger skipped] Merge changes If7d41052,I66f263d7,Id45ae956,Iba752fed,I575a7e4f, ... into qt-r1-dev am: 3547965d2a -s ours
am: faac97e8f7 -s ours
am skip reason: change_id If2ef8d8f038f32c8cf974aa02cfc1dc7e44dbad3 with SHA1 8c9d8c5e05 is in history

Change-Id: I2081b6633b1d0f61bff7531a082e0b6856c23b5b
2019-06-24 09:09:35 -07: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
faac97e8f7 [automerger skipped] Merge changes If7d41052,I66f263d7,Id45ae956,Iba752fed,I575a7e4f, ... into qt-r1-dev
am: 3547965d2a -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
df2b6ea27c Merge "Don't auto-connect to networks that have no/limited connectivity." 2019-06-24 10:45:51 +00:00
Lorenzo Colitti
3547965d2a 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
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
Benedict Wong
1082dddfd3 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 833603caabb1a850a63a970fc285b4c8ed7401f8)
2019-06-21 01:12:34 +00:00
Benedict Wong
dd9577dc0d 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 9fbbdebc61513982a6775460e1d400956f803bde)
2019-06-21 01:12:27 +00:00
Benedict Wong
c2e4d521ed 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 b59cff52510de15ea1dca7f6981d45090b9c8659)
2019-06-21 01:12:17 +00:00
Benedict Wong
9aae3e2336 Revert "Revert "Take all VPN underlying networks into account when migrating traffic for""
This reverts commit d8220c20507f0c346f517d715c7b9826b04d64e2.

Reason for revert: Fix available for deadlocks.

Bug: 113122541
Bug: 134244752
Merged-In: Ib65214598837289bd39dbf040b56ab7835f893ba
Change-Id: Ia90bf2c72ef686e80800d113d03548e0efcadb66
(cherry picked from commit a84d9fa57247cf78a9297b0c6dbd3d81b69e235f)
2019-06-21 01:09:49 +00:00
Chalard Jean
3886d0c592 Merge "Factorize custom asserts." am: 6c176efa3d am: 99fbb40990 am: 500468fb90
am: 41f2977e94

Change-Id: I1eecc5dd9f8c77287b8cca76f5d647a23a9a2f7a
2019-06-20 14:29:43 -07:00
Chalard Jean
41f2977e94 Merge "Factorize custom asserts." am: 6c176efa3d am: 99fbb40990
am: 500468fb90

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

Change-Id: I65ea7497abb8b77ebd10ba622075ef3b6c49b2a8
2019-06-20 14:01:31 -07:00
Junyu Lai
da5af923d3 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev am: e660a0a7e2 -s ours am: 893d1305c8 -s ours
am: ceabb4f7c5 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

Change-Id: If6ce89326f5fbe369ceea6721e4682804378de2a
2019-06-20 09:27:08 -07:00
Junyu Lai
22f5b3c4b1 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev am: e660a0a7e2 am: 8ffb2b0106 -s ours
am: ab7adea1ef -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

Change-Id: Id063dd59ce6fcb7f6b87c264146408c108aa400a
2019-06-20 09:22:06 -07:00
Junyu Lai
3fbd2ccff2 [automerger skipped] Move the test of minimum supported keepalive slots to CTS am: ca8b6ed19f -s ours am: 9205ceb27c -s ours
am: fea7663137 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

Change-Id: I11ac7743e9b080fa184bcfd335aec96a9539e209
2019-06-20 09:13:18 -07:00
Junyu Lai
f37efa1650 [automerger skipped] Correct value of supported keepalive count for cellular am: 03e193c8a7 -s ours am: 80b7c69d6f -s ours
am: 864526737b -s ours
am skip reason: change_id Ia3761f2e78d54866bb2e156d58004396bbc8adc3 with SHA1 ede0d5075b is in history

Change-Id: I8a1a859bfde1c76a66337e4739b3fd9f7341be01
2019-06-20 09:12:48 -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
ceabb4f7c5 [automerger skipped] Merge "Move the test of minimum supported keepalive slots to CTS" into qt-dev am: e660a0a7e2 -s ours
am: 893d1305c8 -s ours
am skip reason: change_id I408750fa0bceb0c1c26afb5fead4e44fb824fbc1 with SHA1 5b3b486b8f is in history

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

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

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

Change-Id: I9caaa1a09ecc37735ef741e5ce43f42fa9a779e5
2019-06-19 23:19:46 -07: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
a34b3a0c7e Merge "Move the test of minimum supported keepalive slots to CTS" am: c961e03526 am: 6ff00fee75 am: 59cc58b295
am: d49c60d1db

Change-Id: I13f47ed986756933172886d7e0c9b5d653fc34e7
2019-06-19 07:44:59 -07:00
Junyu Lai
21f74325c0 Merge "Correct value of supported keepalive count for cellular" am: 7423873ac8 am: 056eeae27c am: bafc7c9b8f
am: f2b2fec787

Change-Id: I621066b8c4cd9b244b4d70f84d428b5b784e0387
2019-06-19 07:44:39 -07:00
Junyu Lai
d49c60d1db Merge "Move the test of minimum supported keepalive slots to CTS" am: c961e03526 am: 6ff00fee75
am: 59cc58b295

Change-Id: If063ff023bf386884c6e42d2acb281763975ac8f
2019-06-19 07:36:52 -07:00
Junyu Lai
f2b2fec787 Merge "Correct value of supported keepalive count for cellular" am: 7423873ac8 am: 056eeae27c
am: bafc7c9b8f

Change-Id: Ia0c1e0511bffd630af4aae87cafd99e68a042149
2019-06-19 07:36:43 -07: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
6bb555b289 Merge "Add SocketUtils CTS tests" am: 37377069ba am: f97246a87c am: 232ad69eaa
am: aabfe43d3b

Change-Id: I36252fdf516cf4a9d4506b615cdb38f5413739e5
2019-06-18 04:26:29 -07:00
Paul Hu
aabfe43d3b Merge "Add SocketUtils CTS tests" am: 37377069ba am: f97246a87c
am: 232ad69eaa

Change-Id: I36fb368217ff50319ae6f853f0d22cfc79541b40
2019-06-18 04:19:31 -07: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
3e7392551f Merge "[automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 -s ours am: dd6df6a38f -s ours
am: 507ef41b5f -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 a070aaa88f is in history

Change-Id: I5a32e2f718871d43e02b07f7c5ae8eca0c1cb44a
2019-06-17 23:55:17 -07:00
Chalard Jean
8e973ce7a7 [automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 am: 5fa9d376ea -s ours
am: f796d8b495 -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 a070aaa88f is in history

Change-Id: Ida933ad5a9fec92e61696f0433ffe71d46a1fd4e
2019-06-17 23:53:12 -07:00
Android Build Merger (Role)
507ef41b5f Merge "[automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 -s ours am: dd6df6a38f -s ours am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 a070aaa88f is in history" into qt-r1-dev-plus-aosp 2019-06-18 06:47:03 +00:00
Chalard Jean
b649cdf0a4 [automerger skipped] Merge "Remove the <= P restriction for WIFI_P2P" into qt-dev am: 2ae76cdbe8 -s ours
am: dd6df6a38f -s ours
am skip reason: change_id I56c86b0c1912064d5a642991df32d2cefb6a8d5b with SHA1 a070aaa88f is in history

Change-Id: I45912237edf2f485e6e747c7b4878eb440096f18
2019-06-17 23:46:20 -07:00
Chalard Jean
f796d8b495 [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 a070aaa88f is in history

Change-Id: Icb639762f04fbae7129a1962548dfd0da200e886
2019-06-17 23:45:18 -07: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