Commit Graph

2032 Commits

Author SHA1 Message Date
Automerger Merge Worker
faf27ff64c Merge "Move DnsSdTxtRecord to net common static library" am: 8d6a6e0d4b
Change-Id: I1101a06ab084e1ff61a785f78b1ae5ac50bfbcd8
2020-03-04 05:56:55 +00:00
Aaron Huang
e045a555af Move DnsSdTxtRecord to net common static library
DnsSdTxtRecord is moved to frameworks/libs/net for mainline
support. Also change the import path using this class.

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
      ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh

Change-Id: I6118b313ce668707d598aa2eab9baee2f7622dbc
Merged-In: I6118b313ce668707d598aa2eab9baee2f7622dbc
2020-03-02 08:21:26 +00:00
Automerger Merge Worker
393687c8f8 Merge "Fix crash and duplicated ethernet tethering request" am: 41c82c99df am: b903184cdd
Change-Id: Ia6b75cce7a748177e99a4b53bb8036e3df3ac835
2020-02-28 03:03:59 +00:00
Automerger Merge Worker
b903184cdd Merge "Fix crash and duplicated ethernet tethering request" am: 41c82c99df
Change-Id: Idd4eca225909f88ef6d57fd8952ae497ec82115b
2020-02-28 02:49:58 +00:00
markchien
c8e7d759be Fix crash and duplicated ethernet tethering request
This change fix two things:
1. Handle ethernet callback in internal thread to avoid crash. IpServer
should be created from tethering thread, otherwise mIpNeighborMonitor of
IpServer would throw
   IllegalStateException("start() called from off-thread")
2. Ethernet tethering request may be duplicated if multiple
startTethering is called but no stopTethering

Bug: 130840861
Bug: 148824036
Test: ON/OFF ethernet tehtering manually
      atest TetheringTests

Change-Id: I7c5127e96d80d077735010d2e62c7227805ccb10
2020-02-27 14:50:16 +08:00
junyulai
f2b6d74356 [SP20] Check signature permission when accessing network stats provider
Currently, registerNetworkStatsProvider requires the
UPDATE_DEVICE_STATS permission. This is a privileged permission
so it can be granted to preinstalled apps. Thus, apps like
GmsCore, or preinstalled apps will be able to update network stats.

This change checks for a new permission that would only allow
signature apps to declare that. Also check
MAINLINE_NETWORK_STACK permission to allow NetworkStack process
to use it.

Test: adb shell dumpsys netstats
Test: atest FrameworksNetTests
Bug: 149652079
Change-Id: Idfebd0a1988c3dcfd812d87e30f6a2034d6fbf6b
2020-02-24 20:22:48 +08:00
junyulai
df2aef7c1d Add permission check functions to NetworkStatsService
This is shameless copied from ConnectivityService and plan to be
used in follow-up change. For long term perspective we should
have a permission util that contains those util in one place.

Test: m -j
Change-Id: I837545b54f36c8f21c878cbb1fd028ff23be6cb8
2020-02-24 20:22:38 +08: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
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
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
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
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
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
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
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
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
David Su
7ae4c7b600 Networking: Rename removeDoubleQuotes to sanitizeSsid
Bug: 145745815
Test: compiles
Change-Id: Iaa6f0d65cab556c24b0a9010427de8e6a02836c1
Merged-In: Iaa6f0d65cab556c24b0a9010427de8e6a02836c1
(clean cherry-pick from internal branch)
2020-01-27 13:51:56 -08:00
Automerger Merge Worker
e058f2fd66 Merge "NetworkStatsFactory.cpp: IWYU" am: 79e97166a8 am: 1e13dec72f
Change-Id: I16f481d9c954848feb12db5be9563ec1ff49bcb6
2020-01-17 21:35:47 +00:00
Steven Moreland
1e13dec72f Merge "NetworkStatsFactory.cpp: IWYU"
am: 79e97166a8

Change-Id: Ic76deb1a3f7b63237f93d1abea2a56ea14dc3465
2020-01-17 11:53:48 -08:00
junyulai
e4437529ca [SP11] add dumpsys support to dump stats inside providers
Sample output is like below:
  Stats Providers:
    OffloadController Xt:
      NetworkStats: ...
    OffloadController Uid:
      NetworkStats: ...
    ImsPhoneCallTracker Xt:
      NetworkStats: ...

Test: adb shell dumpsys netstats (--uid)
Bug: 130855321

Change-Id: I968006de83e13e66bb3359135f0237daf7252bd2
2020-01-17 17:32:36 +08:00
Steven Moreland
79e97166a8 Merge "NetworkStatsFactory.cpp: IWYU" 2020-01-16 21:22:46 +00:00
Automerger Merge Worker
2ccb93a98c DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master am: 3b49ef3445
Change-Id: I180670ed08710f325b9f83edfe152f10455d856c
2020-01-16 18:34:50 +00:00
Xin Li
3b49ef3445 DO NOT MERGE - Merge qt-qpr1-dev-plus-aosp-without-vendor (6129114) into stage-aosp-master
Bug: 146167222
Change-Id: Ifeb003ec9b3bf824f04d31a117aea65d517241fb
2020-01-15 16:15:41 -08:00