summaryrefslogtreecommitdiff
path: root/framework-t/src/android/net/EthernetManager.java
Commit message (Collapse)AuthorAgeFilesLines
* Unicast state of existing ethernet interfaces when registering new Ethernet ↵Xiao Ma2022-04-301-57/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Listener. When adding a listener via the addInterfaceStateListener API, the expectation is that ethernet service calls that listener immediately with a list of all interfaces and their respective state. However, this doesn't work as expectation due to the EthernetManager stores all registered listeners within one global service listener class, the new registered listener will be invoked until the state of any interface has changed. Instead of storing all registered listeners within one global service listener class, associate each new registered listener to an instance of IEthernetServiceListener, and pass it to the EthernetService, that will be invoked when iterating the state of all existing interfaces. In order to avoid the scanning of all registered listeners, that would be slow if there are lots of registered callbacks, moving the service listener to the ListenerInfo class, where the service listener can access the executor and listener passed from the caller naturely, unnecessary to iterate the whole list. Bug: 229125889 Test: atest android.net.cts.EthernetManagerTest --iterations Change-Id: I111eba78d1066794c414ab5fb4a31258ea311413 (cherry picked from commit bb9a49cf72ff83cf969a86d3c51087fa77f08d69) Merged-In: I111eba78d1066794c414ab5fb4a31258ea311413
* Address EthernetManager javadoc review commentsPatrick Rohr2022-04-041-9/+7
| | | | | Test: TH Change-Id: Iafa8979d8e96ea4d078b017e56ee61334d33b5f5
* Update javadoc to match expectation for UnsupportedOperationExceptionPatrick Rohr2022-04-041-1/+2
| | | | | Test: builds Change-Id: I44eac15972ed099fc12599a78a71557a7b16d593
* Merge "Add getInterfaceList module-lib API in EthernetManager."Patrick Rohr2022-03-241-0/+17
|\
| * Add getInterfaceList module-lib API in EthernetManager.Xiao Ma2022-03-221-0/+17
| | | | | | | | | | | | | | Bug: 171872016 Test: m Merged-In: Ib0e6c8f67c6ded7d17bb9e0ff49e7ff495c8819d Change-Id: I94fd147d0f8cf09cb7445fd2b5bc8e4528e8390e
* | Merge "Fix ethernet enable / disable API"Patrick Rohr2022-03-241-16/+13
|\ \ | |/ |/|
| * Fix ethernet enable / disable APIPatrick Rohr2022-03-221-16/+13
| | | | | | | | | | | | | | | | | | | | | | | | The ethernet APIs connectNetwork() / disconnectNetwork() are inaccurately named. Physical link state cannot be changed by calling an API. This change renames these functions to enableInterface and disableInterface, respectively, to better reflect their intention and behavior. Test: atest EthernetManagerPermissionTest Merged-In: I3361ad0e01e761ffd77faf6c55924fa4612ede90 Change-Id: I3361ad0e01e761ffd77faf6c55924fa4612ede90
* | Add setEthernetEnabled and its listener APImarkchien2022-03-221-25/+126
|/ | | | | | | | Bug: 171872016 Test: atest EthernetServiceTests Merged-In: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a Change-Id: Iefd24d955572589c5bd3ca9a8139ea6e44979e8a
* Revert^2 "Change Ethernet API to use OutcomeReceiver"Patrick Rohr2022-03-181-45/+57
| | | | | | | 369c79bca47c17303d1e92bb155e556fa01619d1 Merged-In: I7c46545a47034be409071c2ec007d9e1480c6ed0 Change-Id: If9b055e0862755f1d33b5ba6e026fd827bc1d0ea
* Revert "Change Ethernet API to use OutcomeReceiver"Quentin Perret2022-03-171-57/+45
| | | | | | | | | | | | | | Revert "Change network management listener to outcome receiver" Revert submission 2028203-ethernet-outcomereceiver Reason for revert: BuildMonitor investigating b/225169800 Reverted Changes: I4c204a848:Change Ethernet API to use OutcomeReceiver I7c46545a4:Change Ethernet API to use OutcomeReceiver Id8fadfed9:Change network management listener to outcome rece... Change-Id: I45af594f7233ed89113f4cf7f977092271980672
* Change Ethernet API to use OutcomeReceiverPatrick Rohr2022-03-171-45/+57
| | | | | | | | | | | | This change addresses API review feedback. In addition, it changes the returned result from Network to the interface name. The current API returning a Network object is racy and cannot be implemented correctly. Users should instead use the ConnectivityManager#requestNetwork() API to get hold of the Network for a given interface. Bug: 220017952 Test: TH Change-Id: I7c46545a47034be409071c2ec007d9e1480c6ed0
* Split out the ethernet API surface and use framework-connectivity-tXiao Ma2022-03-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Ethernet framework and service source code is going to be moved to Connectivity mainline module, this CL contains below corresponding changes to adapt the migration in f/b side: 1. Split out ethernet module-lib APIs to Connectivity module. Add the ethernet resource filegroup to tiramisu-updatable-sources filegroup as well, build them together. Also update the module-lib and system api txt to reflect the APIs change. Remove the hidden APIs which are moved to Connectivity module. This removal fixes the api inconsistent issue with Tethering/apex/hidden/. 2. Remove EthernetService from SystemServer which will be registered from ConnectivityServiceInitializer. 3. Replace the BackgroundThread class(imported from f/b/core/java) with the one in the modules-utils-backgroundthread lib, which is visible to Connectivity module. Bug: 210586283 Test: m Test: atest FrameworksNetTests EthernetServiceTests Change-Id: I3e13cb9c0e348333af295c2537d459aa6700ff17 Merged-In: I1956848d3248cc56e9841d221e5e4c160bed65a4
* Remove restriction that limits updateConfiguration API to AutoPatrick Rohr2022-03-081-1/+0
| | | | | Test: TH Change-Id: Ibd1b6493778b98fc765e6eebdfe8f9c1fef29a73
* Fix grammar nit in comment.Lorenzo Colitti2022-02-111-1/+1
| | | | | Test: None Change-Id: I60cb2478615efce13f1904092abe5c21bdf0dc9a
* Expose EthernetManager state and control APIs.Xiao Ma2022-02-111-17/+139
| | | | | | | | | | | | | | | | | | | | | | | | | | This CL exposes EthernetManager APIs that settings and other system components can use to modify and monitor Ethernet state. The new APIs are similar to the existing @hide methods but pass on more information and meet API guidelines: 1. Add an InterfaceStateListener interface, and addInterfaceStateListener and removeInterfaceStateListener methods that meet API guidelines (e.g., take Executor, take SAM parameter last, etc.) This new listener passes interface state (absent, up, down), role (client or server) and IP configuration. 2. Implement the legacy Listener type as a subinterface of the new interface. Hopefully existing callers should be able to use it unchanged. 3. Expose setIncludeTestInterfaces as module-lib api instead of TestApi, since modules cannot expose TestApi methods. Bug: 210586283 Test: m Test: atest EthernetServiceTests Test: atest EthernetTetheringTest Change-Id: I88240a546ab51d128ed83775499f2bcabab74db0 Merged-In: I88240a546ab51d128ed83775499f2bcabab74db0
* Marking eth network management APIs @SystemApiJames Mattis2022-02-041-6/+84
| | | | | | | | | | | | Annotating ethernet network management APIs in EthernetManager with @SystemApi. Bug: 210485380 Test: atest EthernetServiceTests atest CtsNetTestCasesLatestSdk Change-Id: I10429441fd4d7b9bcaa7437b844420a43a415d72 Merged-In: I10429441fd4d7b9bcaa7437b844420a43a415d72
* Adding permission for Ethernet Network ManagementJames Mattis2022-02-021-0/+3
| | | | | | | | | | Adding MANAGE_ETHERNET_NETWORKS as a signature level permission to allow an application to dynamically change ethernet network values. Bug: 210485380 Test: atest EthernetServiceTests Change-Id: Icf9c2accc86735cc981adc0d5a24802e0616ffaf Merged-In: Icf9c2accc86735cc981adc0d5a24802e0616ffaf
* Renaming Ethernet Network Management ClassesJames Mattis2022-02-011-9/+9
| | | | | | | | | | Renaming InternalNetwork* files and classes related to ethernet network management to EthernetNetwork* as ethernet is the only trasnport these particular files are used with. Bug: 210485380 Test: atest EthernetServiceTests Change-Id: Ieb3915c032ef5fcd6b36eb09878119de7668bb4b
* eth manager updates for network management APIsJames Mattis2021-12-221-0/+82
| | | | | | | | | Private methods added to EthernetManager for network management to be made public when ready. Bug: 210485380 Test: make, flash and boot Change-Id: I7f484d373e05225c98bf0e6111afdc12be31764f
* Move Ethernet related files to f/b/packages/ConnectivityT.Xiao Ma2021-12-161-0/+318
ethernet-service is going to be moved into Connectivity mainline module. Move all ethernet related files in f/b/ to f/b/packages/ConnectivityT so that it's easier to migrate these files to Connectivity module finally after clearing the hidden API usages. Below files to be moved: Ethernet framework related files: - EthernetManager.java - EthernetNetworkSpecifier.java - IEthernetManager.aidl - IEthernetServiceListener.aidl - ITetheredInterfaceCallback.aidl Ethernet service related files: - IpConfigStore.java(EthernetConfigStore has dependency on the class) For the ethernet-service related files, keep it as-is temproraliy and fix the hiden API dependencies in f/opt/net/ethernet/. After this work is done, then migrating the whole of ethernet folder to Connectivity module completely. This CL also fixes some minor errors of code style format to pass the code style check. Bug: 210586283 Test: build pass atest FrameworksNetTests atest EthernetServiceTests Change-Id: Ib359d29d5221105f648bc4194c6d6dbe4cc6e3e5