Commit Graph

7608 Commits

Author SHA1 Message Date
Chiachang Wang
54a2e5c268 Merge "Make NetworkAgent stop subclassing Handler." 2020-01-22 04:33:31 +00:00
Chiachang Wang
cad1526c91 Merge "Make NetworkCapabilities authoritative for roaming state" 2020-01-22 03:30:09 +00:00
Chiachang Wang
4a6ab4c857 Merge "Make NetworkCapabilities authoritative for suspended state" 2020-01-22 03:29:42 +00:00
Remi NGUYEN VAN
579d60d362 Merge "Add NetworkRequest#satisfiedBy to SystemApi" 2020-01-21 14:12:27 +00:00
Lorenzo Colitti
c64a5e0ec3 Make NetworkAgent stop subclassing Handler.
Subclassing Handler is not appropriate for a system API because
it is an implementation detail and allows users of this class to
post messages to the handler in ways that allow inappropriate
access to internals that aren't part of the API contract.

Also fix some lint errors.

Test: builds
Bug: 138306002
Change-Id: I79478ceff6bbcae879d1025098d177de0d15dbee
Merged-In: I79478ceff6bbcae879d1025098d177de0d15dbee
2020-01-21 12:55:29 +00:00
Chalard Jean
a00029d752 [NS A25] Send all listen callbacks after all rematches
Reupload of I2db9535b1d72edd46b968b1bae66b148aa815235 with a
bugfix.

Bug: 113554781
Test: ConnectivityServiceTests NetworkStackTests
Change-Id: I904d87c01d9422ba6233d22a189e8017dd298d37
2020-01-21 19:06:04 +09:00
Chalard Jean
63cb44db53 [NS A24] Add an object to represent changes in assignment
Reupload of I703db6d3f039bd67a90fad0eadffc6cfed9a50ee

Test: ConnectivityServiceTest
Change-Id: I9ef468a17ebcfa684e5614b25dc06fc67eb71c79
2020-01-21 19:05:48 +09:00
Remi NGUYEN VAN
f5b9568ef4 Merge "Remove handling of EVENT_UNFULFILLABLE_REQUEST" 2020-01-21 05:52:05 +00:00
Remi NGUYEN VAN
3282a74c5c Add NetworkRequest#satisfiedBy to SystemApi
The API is useful for NetworkFactories to select requests based on
capabilities.
This mirrors NetworkCapabilities#satisfiedByNetworkCapabilities

Test: m
Bug: 138306002
Merged-In: I1d4a928256951397cabde5c352a872fd48d85859
Change-Id: I1d4a928256951397cabde5c352a872fd48d85859
(clean cherry-pick from internal branch)
2020-01-21 12:11:52 +09:00
Remi NGUYEN VAN
8156bbe489 Remove handling of EVENT_UNFULFILLABLE_REQUEST
This message is not being sent by any component anymore.

Test: built, flashed, WiFi and telephony working
Test: atest FrameworksNetTests
Bug: 138306002
Merged-In: I5b1ec3136ae8a0a6928e0fb2cda3d5f5e2ca657f
Change-Id: I5b1ec3136ae8a0a6928e0fb2cda3d5f5e2ca657f
(clean cherry-pick from internal branch)
2020-01-21 12:10:34 +09:00
Chalard Jean
c212ed18ec Make NetworkCapabilities authoritative for roaming state
...instead of NetworkInfo

Bug: 138306002
Test: FrameworksNetTests FrameworksTelephonyTests
Change-Id: Ifdea19fa32089b5c7925f5010169b1dea3d2b304
Merged-In: Ifdea19fa32089b5c7925f5010169b1dea3d2b304
2020-01-20 10:45:48 +00:00
Chalard Jean
fa33a752d9 Make NetworkCapabilities authoritative for suspended state
...instead of NetworkInfo

Bug: 138306002
Test: FrameworksNetTests FrameworksTelephonyTests
Change-Id: I4808fcc0047a926b23ed3d49d979bb7b0371dc69
Merged-In: I4808fcc0047a926b23ed3d49d979bb7b0371dc69
2020-01-20 10:37:29 +00:00
Chalard Jean
a973c7a8c9 Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
Merged-In: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
2020-01-20 16:22:06 +08:00
Rambo Wang
cf09c64473 Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" 2020-01-15 17:45:58 +00:00
Treehugger Robot
5df603fce3 Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi" 2020-01-15 11:42:11 +00:00
paulhu
028732ec2c 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
ac9ebd4d14 Merge "Unhide NetworkRequest API which use legacy type" 2020-01-15 06:49:33 +00:00
Treehugger Robot
7e7cd3b0d4 Merge "Expose SocketKeepalive#SUCCESS as SystemApi" 2020-01-15 05:01:04 +00:00
paulhu
311b769fac 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
Rambo Wang
87900774f9 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
d21ba54347 Merge "Make NattKeepalivePacketData @SystemApi" 2020-01-14 14:36:09 +00:00
Lorenzo Colitti
0699745a3d Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi" 2020-01-14 05:30:14 +00:00
markchien
ddd5937043 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
62af612113 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
2d9623d86f Merge "Support reevaluation request from captive portal app" 2020-01-14 01:42:22 +00:00
Aaron Huang
5dcbfa87e1 Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287
2020-01-14 01:45:28 +08:00
Junyu Lai
91c7daa454 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
junyulai
d6de56f3fb [SP04] add unit test for NetworkStatsProvider
Test: atest NetworkStatsServiceTest
Bug: 130855321
Change-Id: I0c19d8bedcb9398da3f464efe01e775fde9f8a78
2020-01-13 14:43:06 +08:00
Chiachang Wang
ef4a17d140 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
94c9314065 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
Treehugger Robot
39ac72436e Merge "Add NetworkCapabilities#deduceRestrictedCapability" 2020-01-10 09:27:31 +00:00
Aaron Huang
6510da5883 Merge "Expose DhcpInfo parcelable interface implementation methods" 2020-01-10 08:05:24 +00:00
Aaron Huang
a4885a0b8e Merge "Add keepalive related methods and fields to system APIs" 2020-01-10 06:16:04 +00:00
Lorenzo Colitti
e026356956 Merge "Add a NetworkProvider class to the SDK." 2020-01-09 15:09:58 +00:00
Aaron Huang
a397c7e03a 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
92e6c27592 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
a189a352b8 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
Junyu Lai
0104ecc3b8 Merge "[SP01] Add NetworkStats to system API" 2020-01-09 08:33:24 +00:00
Mark Chien
477f778f0b Merge "Replace ConnectivityManager constants to TetheringManager" 2020-01-09 06:32:04 +00:00
junyulai
18c92ac796 [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
a935ddf1f0 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
Lorenzo Colitti
b3fc88fe67 Merge "Refactor NetworkFactoryInfo to hide implementation details." 2020-01-09 00:10:47 +00:00
Cody Kesting
4fa27babe0 Merge "Add API surface for ConnectivityDiagnostics API." 2020-01-08 21:53:14 +00:00
Xin Li
50c2cb0d6a Merge "DO NOT MERGE - Merge January 2020 Security Release into master" 2020-01-08 17:39:17 +00:00
markchien
1f5237045a 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
Lorenzo Colitti
a54a1aa47e Refactor NetworkFactoryInfo to hide implementation details.
This is in preparation for introducing NetworkProvider, which
will initially share ConnectivityService code with NetworkFactory.

Bug: 138306002
Test: atest FrameworksNetTests
Change-Id: Ic6f888621f473342ee3fe8fedf9411552111342b
2020-01-08 23:40:42 +09:00
Artur Satayev
0e45d789c1 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
Remi NGUYEN VAN
81a121d5b5 Merge "Add FrameworksNetIntegrationTests to postsubmit"
am: 062a4df489

Change-Id: I3384970a0a961dfaaf10229ed9e5d39c4f552256
2020-01-07 05:05:45 -08:00
Remi NGUYEN VAN
062a4df489 Merge "Add FrameworksNetIntegrationTests to postsubmit" 2020-01-07 12:16:34 +00:00
markchien
ec2f2397ff Merge "Change tetheroffloadjni to tetheringutilsjni"
am: c21a9bcc0e

Change-Id: I48207d95cf6f512ec038fb5dc9ba4009c01d676d
2020-01-07 01:12:30 -08:00