Commit Graph

527 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
c5c664b88d 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

Change-Id: I34842acd94b972e440c3622f7617df10c18acf65
2020-01-27 19:31:08 +09:00
Lorenzo Colitti
1d48d5e90d 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
Change-Id: Id96d581acb3fa4e52ca62dd94ec257f56bd3a1ce
2020-01-27 19:12:54 +09:00
Automerger Merge Worker
a6f36f4246 [SP03] support registerNetworkStatsProvider API am: 258eb3b9e5 am: 573e809597 am: 910f2d53bd
Change-Id: Iaedbf1f8bbe8128ca2631efff24048b97ce9d909
2020-01-13 14:48:01 +00:00
Automerger Merge Worker
910f2d53bd [SP03] support registerNetworkStatsProvider API am: 258eb3b9e5 am: 573e809597
Change-Id: I16130e06129e985fab33b5caf904477bf241e1b2
2020-01-13 14:28:05 +00:00
Automerger Merge Worker
5607e53d46 [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull am: 644ec019dd am: 9ea8dae9fc
Change-Id: I872285f988905d6707109ab3c7e6a419df47d39b
2020-01-13 14:28:02 +00:00
junyulai
573e809597 [SP03] support registerNetworkStatsProvider API
am: 258eb3b9e5

Change-Id: Id3a21676b6063048124c54035207a1c070df7a8c
2020-01-13 06:12:41 -08:00
junyulai
9ea8dae9fc [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
am: 644ec019dd

Change-Id: I17550a2191ccd33a53a195df3cd178d93fbfe952
2020-01-13 06:12:31 -08:00
Automerger Merge Worker
e07959a156 Merge "Use new UnsupportedAppUsage annotation." am: 89ac95017f am: b2b309516a
Change-Id: Ia3b772ad3ae7c26d92f3367a3689579cd00860ab
2020-01-13 13:50:52 +00:00
Artur Satayev
fcda85b772 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I534e3fd1305e2f4af076986770033478448a665c
Merged-In: I534e3fd1305e2f4af076986770033478448a665c
2020-01-13 12:39:59 +00:00
junyulai
258eb3b9e5 [SP03] support registerNetworkStatsProvider API
This change provides an API that allow external modules to
register a custom provider of NetworkStats to merge the
network statistics that cannot be seen by the kernel to system.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: atest NetworkPolicyManagerServiceTest
Test: m doc-comment-check-docs
Bug: 130855321

Change-Id: I265bc637c40666cde505fde5056d2d9bfc5fb204
2020-01-13 14:43:03 +08:00
junyulai
644ec019dd [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
Extracted from ag/9990011 to make NetworkStatsManager sync with internal
line, given that it is missing in aosp/1198084.

Bug: 126528330

Test: Treehugger
Change-Id: I77f50326869799f51d4636cb7c6d7c97daf531e6
Merged-In: I42117ebfb640e3b0b133183e5e146860bed8471a
2020-01-13 14:42:37 +08:00
Automerger Merge Worker
ca2c6f19ea Merge "Allow mainline IPsec(IKE) to statically include @PolicyDirection" am: 1207761344 am: b5189ed2d9 am: 9bd7141d12
Change-Id: I3c2b6dbe514a9f41d27c71b4f76484d801cb92e8
2020-01-10 00:27:55 +00:00
Automerger Merge Worker
9bd7141d12 Merge "Allow mainline IPsec(IKE) to statically include @PolicyDirection" am: 1207761344 am: b5189ed2d9
Change-Id: I40382746ab54ed21fe9d8fc68b2c81bdf2b4e464
2020-01-10 00:16:11 +00:00
Yan Yan
1207761344 Merge "Allow mainline IPsec(IKE) to statically include @PolicyDirection" 2020-01-09 23:42:59 +00:00
Automerger Merge Worker
a0e0b34013 Merge "Use new UnsupportedAppUsage annotation." am: 57f5cccd29 am: fe3063fb71
Change-Id: Iea82f97f0ba766ce3f435630175aea48ca47f12f
2020-01-09 16:15:31 +00:00
Treehugger Robot
57f5cccd29 Merge "Use new UnsupportedAppUsage annotation." 2020-01-09 15:46:03 +00:00
Automerger Merge Worker
03ec23c40a Merge "[SP02] Add provider interfaces to system API" am: 2220f75cdf am: c6487568ad am: 44358d9d8f
Change-Id: I490c69f902e4b288502adbe5f97c94688147c741
2020-01-09 15:33:22 +00:00
Automerger Merge Worker
44358d9d8f Merge "[SP02] Add provider interfaces to system API" am: 2220f75cdf am: c6487568ad
Change-Id: I569fbcc38f44221ff1be355e48ced65359f2e70f
2020-01-09 15:14:16 +00:00
Artur Satayev
7dc15b923f Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
Merged-In: I8789f8499d4dca08580672e9e45ed9a7026dd686
2020-01-09 13:56:05 +00:00
Automerger Merge Worker
6c530816c0 Merge "[SP01] Add NetworkStats to system API" am: a113464439 am: b340068a3e am: cc0ae82905
Change-Id: I1bb272727cbaec0102669b3f3b8141994f8e1f9a
2020-01-09 09:37:50 +00:00
Automerger Merge Worker
cc0ae82905 Merge "[SP01] Add NetworkStats to system API" am: a113464439 am: b340068a3e
Change-Id: I771bf8836f9b754fc05fd743de8cc5a15aecddf1
2020-01-09 09:18:36 +00:00
junyulai
b9471063dd [SP02] Add provider interfaces to system API
This change contains a base class that allows external modules
to implement a custom network statistics provider. And a callback
interface that allows the implementation to signal the system.

These interfaces will be used in the follow-up changes that
implement the functionality.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Ib23377c8b9cef02bc32253462b068fd10734d21a
2020-01-09 08:57:37 +00:00
junyulai
55041a4ad2 [SP01] Add NetworkStats to system API
In order to let external module report their network stats,
expose necessary APIs to construct NetworkStats object.

Test: atest FrameworksNetTests CtsUsageStatsTestCases
Test: m doc-comment-check-docs
Bug: 130855321
Change-Id: Id3ec8aaff3df67948c25eac2319a74cf33a27979
2020-01-09 03:11:22 +00:00
evitayan
30878b0c76 Allow mainline IPsec(IKE) to statically include @PolicyDirection
@PolicyDirection was hidden API defined in IpSecManager and
mainline module IPsec(IKE) needs to depend on it.

To remove this hidden API dependency, this commit:
- Moves definition of @PolicyDirection to a separate class
- Creates sharing filegroup framework-ike-shared-srcs for mainline
  IKE and include PolicyDirection.java

Bug: 146360859
Test: build, flash, boot
Test: atest FrameworksIkeTests
Change-Id: Ic6d7c06d4b92e16a9a65430365c9acc73932147b
2020-01-08 13:53:14 -08:00
Automerger Merge Worker
d9c69c6105 Merge "Use new UnsupportedAppUsage annotation." am: 9395887931 am: 8081ee1b35
Change-Id: I330594303664e66571a460fdb1a5ab6cb8e5e273
2020-01-08 17:14:42 +00:00
Artur Satayev
164c7569c1 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
Merged-In: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
2020-01-08 14:04:40 +00:00
Artur Satayev
86716b7860 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I0c336de56bc4a041dc97ff9b7927f62f0b44b457
2020-01-06 16:47:35 +00:00
Daulet Zhanguzin
634844fe4a Replace com.android.internal.util.Preconditions.checkNotNull with
java.util.Objects.requireNonNull

Bug: 126528330

Test: Treehugger
Change-Id: I42117ebfb640e3b0b133183e5e146860bed8471a
2019-12-30 15:41:28 +00:00
Artur Satayev
d55b2c8674 Merge "Use new UnsupportedAppUsage annotation." 2019-12-19 16:55:30 +00:00
Artur Satayev
fb1d015c12 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I534e3fd1305e2f4af076986770033478448a665c
2019-12-18 20:44:45 +00:00
Artur Satayev
c6dee71164 Use new UnsupportedAppUsage annotation.
Existing annotations in libcore/ and frameworks/ will deleted after the migration. This also means that any java library that compiles @UnsupportedAppUsage requires a direct dependency on "unsupportedappusage" java_library.

Bug: 145132366
Test: m && diff unsupportedappusage_index.csv
Change-Id: I8789f8499d4dca08580672e9e45ed9a7026dd686
2019-12-18 16:37:37 +00:00
Jeffrey Huang
47427d1d45 Merge "Rename writeToProto to be dumpDebug" 2019-12-06 18:53:15 +00:00
Aaron Huang
e58fff9f29 Merge "Add TrafficStats methods to public APIs" am: 8aed6e69f0
am: 1abb8de060

Change-Id: Ib98dde2ae3b6cfee05e8d5536565ce72f6722e0b
2019-12-06 03:12:46 -08:00
Aaron Huang
443651d3e2 Add TrafficStats methods to public APIs
Add methods to public APIs for mainline support.

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

Change-Id: I21a9c0dbdc79b1f1041fc9e23c6a4e1e97ecde92
2019-12-06 16:19:40 +08:00
Jeffrey Huang
f9f6d87ced Rename writeToProto to be dumpDebug
We want to eventually migrate some of these APIs to be @SystemApi for mainline modules.
The #dumpDebug name is more appropriate than #writeToProto.

Bug: 142279786
Test: Manual
Change-Id: I60793e91cedf6b720d4ecef6a8484f4fed4ff30f
2019-12-05 11:28:11 -08:00
Jayachandran Chinnakkannu
0f6bb0af4e Merge "Remove usage of hidden API TelephonyManager.getNetworkTypeName(int)" am: 9dcbd6de87
am: 19a25b3ee5

Change-Id: I916e810b6350be9c1a6b24f2a652e05a1fa444fa
2019-11-26 09:31:33 -08:00
Jayachandran C
27d08940e0 Remove usage of hidden API TelephonyManager.getNetworkTypeName(int)
This CL deletes the reference to this API as its used in a dead code
which is used for debugging only.

Bug: 140908357
Test: Build
Change-Id: I9fa1996ab5fdb5ab884128d06c2e92bab164dea7
2019-11-25 15:19:47 -08:00
Artur Satayev
5103212960 Merge "Add @UnsupportedAppUsage to test apis that are known to be used by apps." am: a98026f7aa
am: 5f7358da57

Change-Id: Ic691d764839ecf34daa8b53aa92497e013c9a2a7
2019-11-13 10:40:54 -08:00
Artur Satayev
122a87695f Add @UnsupportedAppUsage to test apis that are known to be used by apps.
go/testapi-enforcement

Bug: 133832325
Test: m
Change-Id: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
Merged-In: Ifc8db120640a1554dcbf1722e61e09c7ddc65dd6
2019-11-13 15:05:56 +00:00
Joshua Baxter
a3ef3d991c docs: fix a couple of minor typos am: 6eae9bbc0f am: 46cc54fd21
am: ffcb948028

Change-Id: Id084d29a91ae1a68176439c403e7475b2d497f9d
2019-11-06 14:05:28 -08:00
Joshua Baxter
46cc54fd21 docs: fix a couple of minor typos
am: 6eae9bbc0f

Change-Id: Id2139f5f685d2c4677d5e06ff7fda4b74e61a30c
2019-11-06 13:33:53 -08:00
Joshua Baxter
6eae9bbc0f docs: fix a couple of minor typos
test: make ds-docs
Change-Id: Ia68f66980e447209efb8102a156f78314c199f56
bug: 36979979
Exempt-From-Owner-Approval: docs-only change
2019-11-06 21:13:25 +00:00
Xin Li
e569a024aa Merge qt-r1-dev-plus-aosp-without-vendor (5817612) into stage-aosp-master
Bug: 135460123
Change-Id: I65906d82b14125c0893d5cde0cfebb73bf9e38ab
Merged-In: I1f2564837c33cd4c6c3db6aac3cbaf8c09707da9
2019-09-10 11:16:29 -07:00
Aurimas Liutikas
aa02c3d5b8 Merge "Add missing nullability annotations." into stage-aosp-master am: 85c0a5a2be
am: 88be2b2667

Change-Id: I202951d51820be47b9195734601830553215bdd7
2019-08-30 08:43:01 -07:00
Aurimas Liutikas
3a78d9db46 Add missing nullability annotations.
To prepare for enabling MissingNullability Metalava check this CL
works on adding missing nullability issues that metalava flags if
we tell it to flag new things since API 29.

This is not a complete CL, mostly addresses public api and
toString/equals for @SystemApi

Exempt-From-Owner-Approval: Large scale nullability clean up
Bug: 124515653
Test: make -j checkapi
Merged-In: I109260842cfc25f06e40694997fcbb4afa02c867
Change-Id: I109260842cfc25f06e40694997fcbb4afa02c867
2019-08-30 00:14:44 +00:00
Xiangyu/Malcolm Chen
e0f8c07335 Merge changes from topic "135105735" into qt-r1-dev
am: 896cdfa547

Change-Id: Ie661fdc8a29645fa1b319cf1db8a896a8d21deae
2019-07-12 10:43:52 -07:00
Malcolm Chen
5069dbeaab Use new API to get mergedSubscriberIds based on grouping.
In addition, make mMergedSubscriberIds a list to fit usage of multi-SIM
devices.

Bug: 135105735
Bug: 137137221
Test: manual
Change-Id: I364262559789112f35b88f4c298463bf4af2e82a
2019-07-11 13:19:54 -07:00
Lorenzo Colitti
05f0587ca2 Merge "Remove all static members from NetworkStatsFactory." am: 63f94f411b
am: 5409264cee

Change-Id: Iada14a1fea74197014e75a1112c7a5b35d6b1a1d
2019-06-27 19:40:01 -07:00
Lorenzo Colitti
bcaf1f959b Remove all static members from NetworkStatsFactory.
NetworkStatsFactory is owned by NetworkStatsService, and any
accesses to NSF data should go through NSS.

Test: atest FrameworksNetTests
Change-Id: Idbd0dbbaeb11313f63474e7ec0e01f974349fc89
2019-06-27 17:39:05 +09:00
Benedict Wong
dedb6bb0e5 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