Commit Graph

2041 Commits

Author SHA1 Message Date
Automerger Merge Worker
c0565de11f Merge NetworkStatsService handler changes.
=====
Remove the need of accessing handler in NSS unit test

Currently, to wait for handler becomes idle, specific message
is used and the test would wait for condition variable to be
open when the message is processed.

However, this is already done in the HandlerUtils. Thus,
there is no need to post such message manually in the handler.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: Iab32b2dbab01634ca159dcb90fc9f929d1fed1a2
=====
Remove setHandler in NetworkStatsService

Currently, internal handler is set by setHandler after
constructing NSS object. This was introduced in ag/866187 to
access the handler in the unit test.

However, the design put NSS in a bad situation where all classes
that need handler or executor could not be final and need to be
dynamically allocated in order to get a valid handler.

Thus, since the usage of handler is removed in previous patch,
this change eliminate setHandler by initializing the handler in
the constructor.

Test: atest FrameworksNetTests
Bug: 150664039

Change-Id: I794a24d00b0ca9fdc78091e7b9ab7307e0f034b7
=====

Bug: 150664039
Change-Id: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
Merged-In: If256ed4437ddcbcc72a6f766cff2f4cc512ee3f7
(cherry picked from commit 2a6439d7e2a3926e10a0b9a4dc730b1a022d8138)
2020-03-09 07:59:27 +00:00
Automerger Merge Worker
662cc3d540 Merge "[SP12] Remove the usage of getVtDataUsage" am: afeed9dee4 am: 7fe2313922 am: ac4706dc7a
Change-Id: I28c84ee96a3a209868769aad16a2d2e596a0c342
2020-02-19 23:02:38 +00:00
Automerger Merge Worker
ac4706dc7a Merge "[SP12] Remove the usage of getVtDataUsage" am: afeed9dee4 am: 7fe2313922
Change-Id: Ia10e2365d5f02a1e3444d80e6d7f9d5da00264e0
2020-02-19 00:54:03 +00:00
Automerger Merge Worker
7fe2313922 Merge "[SP12] Remove the usage of getVtDataUsage" am: afeed9dee4
Change-Id: I4e617685c887098e5a93905b77455fb42116a99c
2020-02-19 00:33:48 +00:00
Junyu Lai
afeed9dee4 Merge "[SP12] Remove the usage of getVtDataUsage" 2020-02-19 00:13:02 +00:00
Junyu Lai
50e1c228d0 Merge "[SP16] Address comments on aosp/1172143" am: f4eaaa2415 am: d58bf88378 am: 59a0c28cf3
Change-Id: I4cff4d096f375210585ceae5eb27002b97a35226
2020-02-17 14:18:32 +00:00
Junyu Lai
ad9585467c Merge "[SP17] Wait for stats providers to report stats update" am: 1e47a3e71d am: 48433d6735 am: 91c2f32f05
Change-Id: I719a1b2c75123f6fa6c765eeced055720c052c9b
2020-02-17 14:18:06 +00:00
Junyu Lai
59a0c28cf3 Merge "[SP16] Address comments on aosp/1172143" am: f4eaaa2415 am: d58bf88378
Change-Id: Id6d4be756ec4bd6d3e9c7b8fa1d85b3bdc802a10
2020-02-15 02:51:23 +00:00
Junyu Lai
d58bf88378 Merge "[SP16] Address comments on aosp/1172143" am: f4eaaa2415
Change-Id: I9c826c08320e112466dea0d2628f3447ebcb7d02
2020-02-15 02:35:42 +00:00
Junyu Lai
f4eaaa2415 Merge "[SP16] Address comments on aosp/1172143" 2020-02-15 02:21:30 +00:00
Junyu Lai
91c2f32f05 Merge "[SP17] Wait for stats providers to report stats update" am: 1e47a3e71d am: 48433d6735
Change-Id: I4b5c9e1cca7641b786e118ff979b33b25394fa3e
2020-02-15 02:03:52 +00:00
Junyu Lai
48433d6735 Merge "[SP17] Wait for stats providers to report stats update" am: 1e47a3e71d
Change-Id: I5e6a69fb50c9820f8b0a7e834608a32f651a860a
2020-02-15 01:38:09 +00:00
Benedict Wong
4531c37767 [automerger skipped] Merge "Implement Ikev2VpnRunner" am: e334a83e46 am: c722981400 am: ae8b9c5683 -s ours
am skip reason: skipped by user benedictwong

Change-Id: Ie1f6f8dbd10161342a7f14935def73820a68b057
2020-02-14 20:11:15 +00:00
junyulai
304de51561 [SP17] Wait for stats providers to report stats update
From current design, the traffic accounted by stats providers
will be updated asynchronously when force polling. When upper
layer make two subsequently queries. They will get stale
stats upon the first query, and may get newest/stale stats
base on the result of race.

Thus, wait for a bit of time to allow asynchronous stats update
complete to reduce the chance of race. In pratice, it would
be finished in ~2ms when testing.

Test: systrace.py network
Test: atest FrameworksNetTests
Bug: 147460444
Change-Id: I22a00fc4049cddf77fd578e25769ae1979f2cc6d
2020-02-14 17:03:35 +08:00
junyulai
4fe16c5214 [SP16] Address comments on aosp/1172143
Test: atest FrameworksNetTests
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Iccaab09f5b9668ec4a7249737c64a69cecb08d15
2020-02-14 16:53:40 +08:00
junyulai
12ddc700c8 [SP12] Remove the usage of getVtDataUsage
Currently NetworkStatsService holding a lock when invoking
getVtDataUsage, which causes a lot of deadlock problems since
Phone will also have binder calls to system_server.

Thus, this change uses a new set of API to break such situation,
that allows VT to report stats asynchronously.

Test: atest FrameworksNetTests FrameworksTelephonyTests
Bug: 130855321
Fix: 143923500

Change-Id: Ifdb8599c3bade09208b4730710fc99da1afad71d
2020-02-14 15:37:16 +08:00
Benedict Wong
ae8b9c5683 Merge "Implement Ikev2VpnRunner" am: e334a83e46 am: c722981400
Change-Id: I0048c33ac9b5b60d2f64a90d7c5d9e5e829cf24d
2020-02-13 21:46:13 +00:00
Benedict Wong
c722981400 Merge "Implement Ikev2VpnRunner" am: e334a83e46
Change-Id: I9b966b52f78fa54dca9d8c3032ec26ed853ad572
2020-02-13 21:31:28 +00:00
Benedict Wong
e334a83e46 Merge "Implement Ikev2VpnRunner" 2020-02-13 21:15:24 +00:00
Benedict Wong
c85b7b0114 Implement Ikev2VpnRunner
This change adds the implementation for IKEv2/IPsec VPNs.

Bug: 144246767
Test: Manually tested
Change-Id: I5ccec756cec49ccf57ccc4d5ad800eeb5d595a76
Merged-In: I5ccec756cec49ccf57ccc4d5ad800eeb5d595a76
2020-02-13 18:37:06 +00:00
Benedict Wong
c2eefbb98a Merge "Implement Ikev2VpnRunner" 2020-02-13 18:36:49 +00:00
Benedict Wong
9ee6603153 Implement Ikev2VpnRunner
This change adds the implementation for IKEv2/IPsec VPNs.

Bug: 144246767
Test: Manually tested
Change-Id: I5ccec756cec49ccf57ccc4d5ad800eeb5d595a76
2020-02-13 00:33:44 -08:00
Automerger Merge Worker
afff4915ec Merge "Fix incorrect interpolation of active bucket for partial requests." am: cb011605cf am: 244299e38b am: 16d7a45bfe
Change-Id: I3a7df5061e0a2a90231072a5cd3e8c799302b346
2020-02-13 08:26:15 +00:00
Automerger Merge Worker
16d7a45bfe Merge "Fix incorrect interpolation of active bucket for partial requests." am: cb011605cf am: 244299e38b
Change-Id: I1d6aa0c23fd227eca478e4a6ab5fd7dd26e4c297
2020-02-13 08:07:01 +00:00
Automerger Merge Worker
244299e38b Merge "Fix incorrect interpolation of active bucket for partial requests." am: cb011605cf
Change-Id: Ibfaf1e3d13ce758323c30381ba44702b6016d9eb
2020-02-13 07:53:18 +00:00
Maciej Żenczykowski
cb011605cf Merge "Fix incorrect interpolation of active bucket for partial requests." 2020-02-13 07:37:57 +00:00
Automerger Merge Worker
d6bf586774 Merge "[SP10] Add IntDef annotations for system api of NetworkStats" am: 9d8a9cbfcc am: 9ec52c9fe8 am: 027902a86c
Change-Id: I0e7322090364fc1724797641276416c07277d0bc
2020-02-12 05:27:01 +00:00
Automerger Merge Worker
027902a86c Merge "[SP10] Add IntDef annotations for system api of NetworkStats" am: 9d8a9cbfcc am: 9ec52c9fe8
Change-Id: Icc69f682437baf209aa537820201be45db6ccf3a
2020-02-12 05:11:59 +00:00
Automerger Merge Worker
9ec52c9fe8 Merge "[SP10] Add IntDef annotations for system api of NetworkStats" am: 9d8a9cbfcc
Change-Id: I4d352ed54671ce77ebbcaa9f0808a0ef703d3c6f
2020-02-12 04:54:02 +00:00
Treehugger Robot
9d8a9cbfcc Merge "[SP10] Add IntDef annotations for system api of NetworkStats" 2020-02-12 04:37:55 +00:00
Automerger Merge Worker
1934036da7 Merge "[SP11] add dumpsys support to dump stats inside providers" am: 2b4a6517bf am: e49c7caae3 am: 6c2c1baecf
Change-Id: I03ea04d5851ae4f911f9c64dbdb235aedf4cea3c
2020-02-12 03:28:19 +00:00
Automerger Merge Worker
6c2c1baecf Merge "[SP11] add dumpsys support to dump stats inside providers" am: 2b4a6517bf am: e49c7caae3
Change-Id: I7c6bf5cb081fb943777988c4d9f40b36f9a16efb
2020-02-12 03:13:22 +00:00
Automerger Merge Worker
e49c7caae3 Merge "[SP11] add dumpsys support to dump stats inside providers" am: 2b4a6517bf
Change-Id: I44f69d27b89c6d0463a5b12b98e0cc3cf8297a33
2020-02-12 02:59:21 +00:00
Treehugger Robot
2b4a6517bf Merge "[SP11] add dumpsys support to dump stats inside providers" 2020-02-12 02:45:38 +00:00
junyulai
8016a35c78 [SP10] Add IntDef annotations for system api of NetworkStats
Test: m -j
Bug: 130855321
Change-Id: I8855ec95d5d086fc14e2eb71558bc2dcd9a830e5
2020-02-11 09:47:03 +00:00
Automerger Merge Worker
a8785a5152 [automerger skipped] Merge changes Iaa6f0d65,I68a16b64 am: e486951a92 am: 8abb5a0520 am: a96f068996 -s ours
am skip reason: Change-Id Iaa6f0d65cab556c24b0a9010427de8e6a02836c1 with SHA-1 7092cf164f is in history

Change-Id: I306a831e47c08ac37de93285763500b73a4624ec
2020-01-31 16:47:44 +00:00
Automerger Merge Worker
a96f068996 Merge changes Iaa6f0d65,I68a16b64 am: e486951a92 am: 8abb5a0520
Change-Id: I7e66156659fb88110d2a7f027d488e15499caee2
2020-01-31 16:43:27 +00:00
Automerger Merge Worker
8abb5a0520 Merge changes Iaa6f0d65,I68a16b64 am: e486951a92
Change-Id: I687e59f2c25d5c5e2cb5b1574dbcf6f32ec8c817
2020-01-31 16:37:49 +00:00
David Su
e486951a92 Merge changes Iaa6f0d65,I68a16b64
* changes:
  Networking: Rename removeDoubleQuotes to sanitizeSsid
  Wifi: Rename removeDoubleQuotes to sanitizeSsid
2020-01-30 22:42:16 +00:00
David Su
1596be0133 Merge changes from topic "api-review-removedoublequotes"
* changes:
  SettingsLib: Rename removeDoubleQuotes to sanitizeSsid
  Networking: Rename removeDoubleQuotes to sanitizeSsid
  Wifi: Rename removeDoubleQuotes to sanitizeSsid
2020-01-30 18:16:53 +00:00
Automerger Merge Worker
82f4cb1794 [automerger skipped] Merge changes I34842acd,Icc6c4d6b am: 5312d0be3e am: 4036bb43a0 am: 145a512dd2 -s ours
am skip reason: Change-Id I34842acd94b972e440c3622f7617df10c18acf65 with SHA-1 c5c664b88d is in history

Change-Id: I7068557f0d30c9066e9bdcb2dd674dab8964a4b9
2020-01-28 11:18:31 +00:00
Automerger Merge Worker
145a512dd2 Merge changes I34842acd,Icc6c4d6b am: 5312d0be3e am: 4036bb43a0
Change-Id: I801ab058c34ed261f6ca4d100927a0cd89fd8e02
2020-01-28 11:03:56 +00:00
Lorenzo Colitti
4036bb43a0 Merge changes I34842acd,Icc6c4d6b
am: 5312d0be3e

Change-Id: I38f5452905216ebf9e0b28311d34ad0667243274
2020-01-28 02:53:38 -08:00
Lorenzo Colitti
5312d0be3e Merge changes I34842acd,Icc6c4d6b
* changes:
  Add support for Ethernet tethering
  Local Tethering with ncm interface
2020-01-28 10:43:33 +00:00
Automerger Merge Worker
9b95fe00b4 [automerger skipped] Merge "Support putting one Ethernet interface in server mode." am: e7e38501e8 am: 88bc15c4bc am: 135240ae67 -s ours
am skip reason: Change-Id Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce with SHA-1 1d48d5e90d is in history

Change-Id: I3314b899730f367f154bd8b513094076084a6cef
2020-01-28 09:17:08 +00:00
Automerger Merge Worker
135240ae67 Merge "Support putting one Ethernet interface in server mode." am: e7e38501e8 am: 88bc15c4bc
Change-Id: Ifc0f80406038051afe179bf38a4583ab95ab630c
2020-01-28 08:52:56 +00:00
Remi NGUYEN VAN
199d685186 Add support for Ethernet tethering
Ethernet tethering can be started via
startTethering(TETHERING_ETHERNET).

Test: flashed, enabled ethernet tethering, verified internet access on
      downstream.
Bug: 130840861

Merged-In: I34842acd94b972e440c3622f7617df10c18acf65
Change-Id: I34842acd94b972e440c3622f7617df10c18acf65
(cherry-pick with conflicts in test-current.txt)
2020-01-28 17:52:06 +09:00
Remi NGUYEN VAN
88bc15c4bc Merge "Support putting one Ethernet interface in server mode."
am: e7e38501e8

Change-Id: Ib1c26821880daa118b1911d4f98ebbd970c3c1b4
2020-01-28 00:37:20 -08:00
Lorenzo Colitti
19b8b88d18 Support putting one Ethernet interface in server mode.
requestTetheredInterface can be used to put an interface in server mode,
which will persist until release() is called on the returned request, or
until the requesting process dies.

Test: Enabled ethernet tethering with change on top
Bug: 130840861
Merged-In: Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce
Change-Id: Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce
(clean cherry-pick from internal branch)
2020-01-28 16:25:43 +09:00
Maciej Żenczykowski
2b92fa5323 Fix incorrect interpolation of active bucket for partial requests.
Just because the bucket is active (ie. overlaps with 'now') doesn't
mean the request necessarily covers the entire bucket.

For example a bucketDuration=5 with a bucket from curStart=1 to
curEnd=6 with now=4 and requests:
- from start=0 to end=3 --> overlap=[1,3] --> bucketSpan=2
- from start=2 to end=3 --> overlap=[2,3] --> bucketSpan=1
- from start=2 to end=5 --> overlap=[2,4] --> bucketSpan=2
- from start=2 to end=7 --> overlap=[2,4] --> bucketSpan=2
and the previously correctly handled cases:
- from start=0 to end=5 --> overlap=[1,4] --> bucketSpan=3
- from start=0 to end=7 --> overlap=[1,4] --> bucketSpan=3

We fix this by bounding the end of buckets to now, this means
that bucketDuration is no longer a constant, but it simplifies
all the rest of the logic.

Test: builds, atest
Bug: 143338233
Signed-off-by: Maciej Żenczykowski <maze@google.com>
Change-Id: I642b57f7b8486071ad7808fd9b901859923b6d25
2020-01-27 18:39:15 -08:00