Commit Graph

1891 Commits

Author SHA1 Message Date
Chalard Jean
5f617f9a07 New NetworkAgentConfig API to replace NetworkInfo WiFi stuff.
Bug: 139268426
Test: FrameworkWifiTests
Change-Id: Id13fcf41e05fd1eb26c86717e2684c724b94e401
2020-01-21 18:30:31 +09:00
Chalard Jean
01b6ba4053 Move NetworkAgent#register to a new method.
Calling IPC in a constructor is unusual and confusing, and can be
considered bad form. There are multiple reasons for this :
• Users can't obtain an instance of the class without calling the
  constructor, but they can't always afford an IPC where they need
  this, forcing them to know about the implementation detail and
  sometimes design around it.
• On a related but generalized note, constructors should usually
  be fast for the same range of reasons.
• Having a separate method to register the agent simply gives more
  flexibility to the app.
• It's also a lot easier to test.
But also we can't fix it without an update to the API, so here it is.

Another reason for doing this is consistency with the NetworkProvider
API.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I1ee5c7b1353d581e487c8a8a159009bebd781643
2020-01-20 12:54:52 +09:00
Chalard Jean
101719ce8e Add methods to send connected/disconnected state.
Also add methods to set the legacy subtype and the APN name.
These have to be added together because they have to be used
together.

Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: Ie90b8d290eab490061d5cb066744b67d597b9469
2020-01-20 12:54:52 +09:00
🌶️Sam Sacco°͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌͌ne
72106b0b48 Fix invalid use of @note for doc builds.
Originally introduced in https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/10087632

Change-Id: I35fc4a814238635fa95981649c27230dda319afa
2020-01-18 21:10:40 +00:00
Chalard Jean
fd1758d45e Add a systemapi constructor for NetworkAgent
Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
      make doc-comment-check-docs
Change-Id: I288ea32fac07a9a486e2ea451a2c9b098446a74c
2020-01-17 14:58:01 +09:00
Automerger Merge Worker
db2f8836de Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" am: b2ff467a3a am: b5d058e25d am: 0fee898931
Change-Id: I9aee20185e189e51d537b6b0895fdc31c31d0ea2
2020-01-15 18:39:33 +00:00
Rambo Wang
b2ff467a3a Merge "Replace StringNetworkSpecifier & subId with TelephonyNetworkSpecifer" 2020-01-15 17:45:58 +00:00
TreeHugger Robot
cdca11bf4a Merge "NetworkAgent: Fix doc build fail by invalid tag" 2020-01-15 14:59:04 +00:00
markchien
6079c4d8eb NetworkAgent: Fix doc build fail by invalid tag
Bug: 138306002
Bug: 139268426
Test: make doc-comment-check-docs

Change-Id: I8b8df5096b90ad10545087ab09f68ecae637aa35
2020-01-15 12:58:25 +00:00
Automerger Merge Worker
87172aeccf Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi" am: 7916449753 am: 494d63249a am: c80e25552e
Change-Id: Iece2ad4133751a8c258f64d7796158ffe90881ce
2020-01-15 12:33:59 +00:00
Treehugger Robot
7916449753 Merge "Expose ConnectivityManager#TYPE_WIFI_P2P as SystemApi" 2020-01-15 11:42:11 +00:00
Lorenzo Colitti
9f5958083f Merge "Make most of NetworkAgent @SystemApi." 2020-01-15 09:56:31 +00:00
paulhu
e102b0bb49 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
Lorenzo Colitti
980ed12f7f Make most of NetworkAgent @SystemApi.
Bug: 138306002
Bug: 139268426
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Test: atest android.net.cts.ConnectivityManagerTest
Change-Id: I856f01f02c35c2f6a886d8b98039e5dfbc48148b
2020-01-15 16:05:26 +09:00
Mark Chien
a64019915e Merge "Unhide NetworkRequest API which use legacy type" 2020-01-15 06:49:33 +00:00
Treehugger Robot
4ed1963c4a Merge "Expose SocketKeepalive#SUCCESS as SystemApi" 2020-01-15 05:01:04 +00:00
Mark Chien
997956750f Merge "Unhide NetworkRequest API which use legacy type" 2020-01-15 04:29:15 +00:00
Remi NGUYEN VAN
44637dd69d Merge "Add NetworkRequest#satisfiedBy to SystemApi" 2020-01-15 04:14:32 +00:00
TreeHugger Robot
2904732e77 Merge "Remove framework code that has moved to frameworks/libs/net" 2020-01-15 02:47:52 +00:00
paulhu
2f7c345d56 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
Paul Hu
4d68e42338 Merge "Expose SocketKeepalive#SUCCESS as SystemApi" 2020-01-15 02:44:32 +00:00
Rambo Wang
582ba554de 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
Automerger Merge Worker
80911190ca Merge "Make NattKeepalivePacketData @SystemApi" am: 9fef5a5cf0 am: 6426059fa3 am: 2be2e8d19f
Change-Id: Idd26f3118e879ab05a8cdd23a9e4999b3bafbf47
2020-01-14 15:32:07 +00:00
Aaron Huang
9fef5a5cf0 Merge "Make NattKeepalivePacketData @SystemApi" 2020-01-14 14:36:09 +00:00
paulhu
ce12f80581 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
2020-01-14 21:42:56 +08:00
Remi NGUYEN VAN
04b18a9e7b 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
Change-Id: I1d4a928256951397cabde5c352a872fd48d85859
2020-01-14 21:45:38 +09:00
Aaron Huang
2429c7091c Remove framework code that has moved to frameworks/libs/net
Add srcs to framework and change import path.
Remove the codes which are moved to frameworks/libs/net.

Bug: 139268426
Bug: 135998869
Bug: 138306002
Bug: 143925787
Test: atest FrameworksNetTests
      atest FrameworksTelephonyTests
      atest ./frameworks/opt/net/wifi/tests/wifitests/runtests.sh
Change-Id: Ieb8927f9af7f87a5ae038bd6c7daeb3d70117fef
2020-01-14 18:10:39 +09:00
Chalard Jean
1426060355 Merge "Have registerNetworkAgent return a Network." 2020-01-14 07:06:37 +00:00
Automerger Merge Worker
abf06a174d Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi" am: baf25cde90 am: 385ec77624 am: de99f55513
Change-Id: I5706151c291cbdbc3a1f73ebb3669f56a61509ba
2020-01-14 06:27:10 +00:00
Lorenzo Colitti
baf25cde90 Merge "Expose ConnectivityManager#TYPE_NONE as SystemApi" 2020-01-14 05:30:14 +00:00
Lorenzo Colitti
640fa9a6ac Merge "Add a Builder to NetworkAgentConfig, and make it SystemApi." 2020-01-14 05:01:06 +00:00
Chalard Jean
b0a42f7284 Have registerNetworkAgent return a Network.
This is more useful.

Bug: 135998869
Test: FrameworkNetTests FrameworksWifiTests
Change-Id: I74710b396fa3cec6fbae08d3dcab5bc90dc2e669
2020-01-14 13:59:55 +09:00
markchien
d6eeffd079 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
markchien
fd051db78b Unhide NetworkRequest API which use legacy type
Bug: 144753389
Test: -build, flash, boot
      -atest TetheringTests

Change-Id: I349da06769e9ffcee6bb42f51ab454e0ef774fb3
2020-01-14 12:54:40 +08:00
Lorenzo Colitti
5b2e000f6d Add a Builder to NetworkAgentConfig, and make it SystemApi.
Currently, only support the three elements in the config that are
known to be used.

Bug: 138306002
Test: builds, boots
Test: atest FrameworksTelephonyTests
Change-Id: I1d231ec2ddcff97c039bcbc815a39c1d3e26c410
2020-01-14 11:43:53 +09:00
Automerger Merge Worker
5e6e597748 Merge "Support reevaluation request from captive portal app" am: 254c3d830e am: 006e9bc1e7 am: 5980ff839e
Change-Id: Id0c020ade4c7de71f7540a82d84045e131ea25e2
2020-01-14 02:33:53 +00:00
paulhu
74357e70a8 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
254c3d830e Merge "Support reevaluation request from captive portal app" 2020-01-14 01:42:22 +00:00
Aaron Huang
aead9c64fa Make NattKeepalivePacketData @SystemApi
Bug: 139268426
Bug: 135998869
Test: atest FrameworksNetTests

Change-Id: I687f1a8a4b82cb7e4a0dfeb24f0b23a4de6d5287
2020-01-14 01:45:28 +08:00
Chiachang Wang
938bfba0c3 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
8dd13a8109 Rename NetworkMisc to NetworkAgentConfig.
NetworkMisc is not really an appropriate name for a system API.

Bug: 138306002
Test: builds, boots, wifi works, telephony works
Test: atest FrameworksNetTests FrameworksWifiTests FrameworksTelephonyTests
Change-Id: I621cfbe165996c67b201ca2dd2f95a5ab9af10ee
2020-01-13 15:01:52 +09:00
Lorenzo Colitti
c58ecd5f33 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
2020-01-13 14:49:15 +09:00
Automerger Merge Worker
8ae3471952 Merge changes I7ea39b80,I6b9979f3 am: 310d1dac0d am: 3efc93af3d am: 243e5f21ea
Change-Id: I97bd2471b04d9a6291b03a989ccd618c2dc70c6e
2020-01-13 04:51:33 +00:00
Lorenzo Colitti
a86fae785a 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
Automerger Merge Worker
934e051607 Merge "Add NetworkCapabilities#deduceRestrictedCapability" am: 0e82d1c50d am: 2d976e6c9e am: 02ee974ee1
Change-Id: I9d593d245287362aad82d70ac5fed4d6339f82d7
2020-01-10 09:55:33 +00:00
Treehugger Robot
0e82d1c50d Merge "Add NetworkCapabilities#deduceRestrictedCapability" 2020-01-10 09:27:31 +00:00
Automerger Merge Worker
f82ab34c40 Merge "Expose DhcpInfo parcelable interface implementation methods" am: 617e9bd709 am: 6817693ef3 am: badb0c36b6
Change-Id: I202ba0c2fe026186c59bb0d7b58d8bb8b5be98c2
2020-01-10 08:42:17 +00:00
Aaron Huang
617e9bd709 Merge "Expose DhcpInfo parcelable interface implementation methods" 2020-01-10 08:05:24 +00:00
Aaron Huang
434bc5adf4 Merge "Add keepalive related methods and fields to system APIs" 2020-01-10 06:16:04 +00:00
Automerger Merge Worker
5c058b526c Merge "Add a NetworkProvider class to the SDK." am: 3bd0d010bb am: 4de6a72e85 am: b24adb4bb0
Change-Id: I7161415a495f9d31762545b5efeb81b387a475cd
2020-01-09 15:33:58 +00:00