Commit Graph

4596 Commits

Author SHA1 Message Date
David Su
427cb398e2 Merge changes from topic "networkscoremanager-cachefilter"
* changes:
  SettingsLib: Rename CACHE_FILTER_* to SCORE_FILTER_*
  NetworkScoreManager: Expose SCORE_FILTER_* consts
2020-01-15 17:55:35 +00:00
Rambo Wang
7fd95f64df Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" 2020-01-15 17:45:58 +00:00
Treehugger Robot
dda5e92547 Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi" 2020-01-15 11:42:11 +00:00
paulhu
5ae1d2c043 Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests

Change-Id: I77cb45e6b2aaf4ab2c457cb59ccf77b1b8c01fa9
2020-01-15 15:38:23 +08:00
Mark Chien
bd7fa99584 Merge "Allow opening tethering when data saver ON" 2020-01-15 06:58:29 +00:00
Mark Chien
cd2ffc26dc Merge "Unhide NetworkRequest API which use legacy type" 2020-01-15 06:49:33 +00:00
Treehugger Robot
4c85840bd0 Merge "Expose SocketKeepalive#SUCCESS as SystemApi" 2020-01-15 05:01:04 +00:00
paulhu
521cd8c85d Expose SocketKeepalive#SUCCESS as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: I94171b2dc4f26442df918547bf8bc40953f63f2e
Merged-In: I94171b2dc4f26442df918547bf8bc40953f63f2e
2020-01-15 02:45:43 +00:00
David Su
16fc91a1c1 NetworkScoreManager: Expose SCORE_FILTER_* consts
Rename CACHE_FILTER_* constants to SCORE_FILTER_*
and expose them as @SystemApi so they can be used
by the Wifi module.

Bug: 135998869
Test: compiles
Change-Id: I9eab2e84d0b00fada7629a104566c1099f8b1288
Merged-In: I9eab2e84d0b00fada7629a104566c1099f8b1288
2020-01-14 14:01:33 -08:00
Rambo Wang
818cf71da8 Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer
StringNetworkSpecifier is widely used to specify subscription id for
the NetworkRequest. The raw string field introduce ambiguity and leave
large space for bugs. With TelephonyNetworkSpecifer, we are able to
settle down the type and value of the fields (although currently only
one) and introduce validation to detect the bug in the beginning.

Bug: 145993724
Test: atest FrameworksNetTests FrameworksTelephonyTests &
      make offline-sdk-docs
Change-Id: Iefbad9b1deb3de2c0b262d9ce5ae0704a50d08a6
2020-01-14 10:51:11 -08:00
Aaron Huang
3516f5853a Merge "Make NattKeepalivePacketData @SystemApi" 2020-01-14 14:36:09 +00:00
markchien
3fe660bc4a Allow opening tethering when data saver ON
When data saver enabled, tethering would be OFF.
Currently settings would not allow user to turning tethering back.
After aosp/1181583 is merged, user can turn tethering back without
turning data saver OFF.

Bug: 145711175
Bug: 142374233
Test: atest TetheringTests
      OFF/ON tethering when data saver ON

Change-Id: I59e662ba771a563f5f1766ba29e05246b8280220
2020-01-14 20:15:31 +08:00
Lorenzo Colitti
03c1364b16 Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi" 2020-01-14 05:30:14 +00:00
markchien
6fa7a30e51 Unhide NetworkRequest API which use legacy type
Bug: 144753389
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
Merged-In: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
2020-01-14 04:56:54 +00:00
paulhu
4dc238b5e5 Expose ConnectivityManager#TYPE_NONE as SystemApi
Support wifi mainline module usage.

Bug: 135998869
Test: Build and make system-api-stubs-docs-update-current-api
      atest FrameworksNetTests
Change-Id: Ia496aaeaf74fa44764640fd2b97c417509e040aa
2020-01-14 10:02:30 +08:00
Chiachang Wang
ba43c13e77 Merge "Support reevaluation request from captive portal app" 2020-01-14 01:42:22 +00:00
Aaron Huang
8e5e8c9815 Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287
2020-01-14 01:45:28 +08:00
Junyu Lai
432f29f770 Merge changes from topic "sp04"
* changes:
  [SP05] add unit test for onStatsProviderLimitReached in NPMS
  [SP04] add unit test for NetworkStatsProvider
  [SP03] support registerNetworkStatsProvider API
  [SP03.1] Replace com.android.internal.util.Preconditions.checkNotNull
2020-01-13 14:09:52 +00:00
Artur Satayev
bc3d8b9071 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
80831d2ff3 [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
Chiachang Wang
207b6cff26 Support reevaluation request from captive portal app
CaptivePortalLogin use similar way to validate the network as
NetworkMonitor. Provide API to reuse NetworkMonitor facilities
for consistent captive portal detection.

Bug: 134892996
Test: atest FrameworksNetTests NetworkStackTests NetworkStackNextTests
Test: manually test with captive portal Wi-Fi
Test: make system-api-stubs-docs-update-current-api \
      test-api-stubs-docs-update-current-api
Change-Id: I6f039eae7ceb18eb6c3cf15587cdc27a7fe35b00
2020-01-13 14:28:02 +08:00
Lorenzo Colitti
0153955e9a Address comments on ag/10050681.
Test: builds
Bug: 138306002
Change-Id: I7ea39b80eede50288261d05ef6f2e860f30b22d6
2020-01-12 18:08:56 +09:00
Lorenzo Colitti
6654b08619 Stop using NetworkFactory in connectivity code.
Bug: 138306002
Test: builds, boots
Test: atest FrameworksNetTests
Change-Id: I6b9979f343108c0c077abd86ae1c21e5ece0cccc
2020-01-12 17:40:02 +09:00
Lorenzo Colitti
b6b9fa6eff Delete the NetworkFactory running-on-correct-thread assertion.
The change to make NetworkFactory use NetworkProvider included an
assertion that the onNetworkRequested and onRequestWithdrawn
methods were called on the factory's Looper.

This is not really necessary since it cannot happen in the
current code unless there is a bug in Looper. It also makes it
impossible to test this code using TestLooper, which dispatches
messages on the test thread instead of on the looper thread.

So, delete the check.

Bug: 138306002
Test: atest FrameworksWifiTests now passes
Change-Id: I37449efb50287c683312f0b19909bd4c61b38585
Merged-In: I37449efb50287c683312f0b19909bd4c61b38585
2020-01-11 20:06:20 +09:00
Lorenzo Colitti
f486b23982 Stop using factory serial numbers in NetworkFactory.
Don't delete NetworkFactory.SerialNumber or getSerialNumber() yet
because those are still in use in various places.

Test: builds
Bug: 138306002
Change-Id: I102af09cb52b447e472398869d82556b5708cb82
Merged-In: I102af09cb52b447e472398869d82556b5708cb82
2020-01-11 20:02:05 +09:00
Lorenzo Colitti
2df761bdcb Use NetworkProvider in NetworkFactory.
Bug: 138306002
Test: builds, boots, wifi and telephony work
Test: Existing NetworkFactory tests in FrameworksNetTests pass
Change-Id: Ib8cac2fab5092c99b0a496fdeedfcfab6d578936
Merged-In: Ib8cac2fab5092c99b0a496fdeedfcfab6d578936
2020-01-11 20:01:24 +09:00
Sarah Chin
0262cb7765 Merge "5G meteredness for telephony framework" 2020-01-10 16:36:48 +00:00
Treehugger Robot
ded6a9e58e Merge "Add NetworkCapabilities#deduceRestrictedCapability" 2020-01-10 09:27:31 +00:00
Aaron Huang
44780ff920 Merge "Expose DhcpInfo parcelable interface implementation methods" 2020-01-10 08:05:24 +00:00
Aaron Huang
b7d665988d Merge "Add keepalive related methods and fields to system APIs" 2020-01-10 06:16:04 +00:00
Yan Yan
17d04f08d6 Merge "Allow mainline IPsec(IKE) to statically include @PolicyDirection" 2020-01-09 23:42:59 +00:00
Sarah Chin
80b73b9e1c 5G meteredness for telephony framework
Added networkTypes to SubscriptionPlan
Send SubscriptionPlans as dispatch via listener
Updated API for R

Bug: 139070884
Test: atest FrameworksTelephonyTests
Test: atest cts/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java
Change-Id: Idb67fb7676adf9e1158113e7b8b08e655f470920
Merged-In: Idb67fb7676adf9e1158113e7b8b08e655f470920
(cherry-pick from ag/9459941)
2020-01-09 19:45:14 +00:00
Lorenzo Colitti
f6bbab0f6b Merge "Add a NetworkProvider class to the SDK." 2020-01-09 15:09:58 +00:00
Aaron Huang
40a873a6cd Expose DhcpInfo parcelable interface implementation methods
Parcelable class requires a CREATOR field be exposed.

Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests
      atest android.net.cts

Change-Id: I41c68406d09014dda99f337add8c0db0298b0582
2020-01-09 21:33:22 +08:00
Lorenzo Colitti
ae5cb71b08 Add a NetworkProvider class to the SDK.
Bug: 138306002
Test: builds, boots, wifi and telephony work
Test: tested by upcoming change that uses this in NetworkFactory
Change-Id: I2f61bf323215b7c6feff8acc92e7434346751773
2020-01-09 19:50:26 +09:00
paulhu
1835432b46 Add NetworkCapabilities#deduceRestrictedCapability
Support telephony mainline module usage.

Bug: 138306002
Test: atest FrameworksNetTests
      atest CtsNetTestCases --instant

Change-Id: Idbd9c547eff7227085c753461b901c7cdbe396fb
2020-01-09 17:59:46 +08:00
junyulai
4d905c9e73 [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
Junyu Lai
a113464439 Merge "[SP01] Add NetworkStats to system API" 2020-01-09 08:33:24 +00:00
Mark Chien
0728d22b39 Merge "Replace ConnectivityManager constants to TetheringManager" 2020-01-09 06:32:04 +00:00
Sarah Chin
df94694c42 Merge "Handle 5G meteredness in telephony framework" 2020-01-09 05:03:24 +00:00
junyulai
d27a1725e8 [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
Chiachang Wang
4bcef011b2 Expose clearCapabilities for mainline module
Support telephony mainline module usage.

Bug: 138306002
Test: Build and make api-stubs-docs-update-current-api
Change-Id: I6260695b01ec06244d2822f9438a7fae83539ff2
Merged-In: I0a462da4e87cae2c7d4a9b9a92de061a086c5752
2020-01-09 10:25:03 +08:00
Chiachang Wang
914a0fff2e Expose NetworkSpecifier methods as SystemApi
Support for Wi-Fi mainline module.

Bug: 135998869
Test: build and make system-api-stubs-docs-update-current-api
Test: atest FrameworksNetTests
Change-Id: I88f00ca4f4cd51c71f7668b34f101fe7d1332c5c
Merged-In: Id705ee0f2b5c464f6d8ccc91f20dcb39dcf6f2b8
2020-01-09 10:22:47 +08:00
Sarah Chin
1431ab2ee5 Handle 5G meteredness in telephony framework
Carriers can set override values via SubscriptionManager.
Added constants and configs for 5G meteredness updates.

Bug: 139070884
Bug: 139218397
Test: atest FrameworksTelephonyTests
Test: atest
cts/tests/tests/telephony/current/src/android/telephony/cts/SubscriptionManagerTest.java

Change-Id: Ic8c5938c4a414ce63303a1fa25af60a0082b1ba9
Merged-In: Ic8c5938c4a414ce63303a1fa25af60a0082b1ba9
(cherry-picked from ag/9302701)
2020-01-09 02:13:47 +00:00
evitayan
e22e47f48e 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
Cody Kesting
afa0f1756e Merge "Add API surface for ConnectivityDiagnostics API." 2020-01-08 21:53:14 +00:00
markchien
9e44cdec1d Replace ConnectivityManager constants to TetheringManager
Replace some ConnectivityManager constants as TetheringManager inside
tethering module. No API change, will have follow up CL to delete
@hide tethering constants in ConnectivityManager and replace caller
to using TetheringManager.

Bug: 144753389
Test: build
Change-Id: Ia1b963669722c32d147375763205ed2f3af52fed
2020-01-08 15:06:09 +00:00
Artur Satayev
33f9217695 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
Treehugger Robot
106d798af8 Merge "android.net.http: Update OWNERS." 2020-01-07 13:45:20 +00:00
Treehugger Robot
3e16a10a3e Merge "Change tetheroffloadjni to tetheringutilsjni" 2020-01-07 09:05:43 +00:00