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 bb9a49cf72)
Merged-In: I111eba78d1066794c414ab5fb4a31258ea311413
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
Currently dumpCheckin passes a null object to create
the contructor of NetworkStatsCollection.Key but the
constructor requires non-null object. Thus, it caused
the NPE in dumpCheckin. To fix this exception, create
an NetworkIdentitySet() object instead of using an
null object.
Bug: 225131008
Bug: 226539404
Test: dumpsys netstats --checkin is fine
FrameworksNetTests
Change-Id: I7f2dadf0647b3f42e0f667d96291d2ae37e23faf
From current design, NetworkPolicyManagerService should only
creates metered carrier/mobile templates. However, if someone
calls the hidden API interface or the template was created
before NetworkTemplate#Builder is published. The caller may
create a non-metered carrier template and persist into the
storage.
This CL elimates this possibility and mark non-metered carrier
template non-persistable, so devices could auto-recover from
this symptom after reboot.
Fix: 222382637
Test: TH
Change-Id: I5265e371b0126ce65c32fb09a6e04223afb3d286
Move iterator and NetworkStats.Entry getters to system-current
according to API council feedback. This reverts parts of
ag/17117903.
Test: TH
Fix: 225168182
(cherry-picked from ag/17397294)
Change-Id: Ia7fdf8d31a96a26b0bf1682f462292b051560477
Merged-In: Ia7fdf8d31a96a26b0bf1682f462292b051560477
Some of the internal classes are not available for priv-apps.
Thus, make them module-lib instead.
This change also adds some nullability annotations for existing
APIs according to go/android-api-guidelines.
Test: m
Test: m frameworks-base-api-system-current-compat
Fix: 217479745
(cherry-picked from ag/17117903)
Change-Id: I18de46b11df7232ab82b9465856fdde621283156
Merged-In: I18de46b11df7232ab82b9465856fdde621283156
Merged-In: Ief3f2304f11b7940a18b98b8533fbca85ffa4dc1
- Use MDns aidl to communicate with mdns service and register
event listener to receive callback.
- Remove all NDC relevant code on NsdService.
- Use MDns aidl on NsdServiceTest.
Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: I65929dee3838fef753396e86c665abd66b6fec81
- Have MDnsManager to manage mdns native service binder call.
- Register it as a system service for NsdService.
- NsdService will use aidl to communicate with mdns, so add the
relevant lib to framework-connectivity
- Add jarjar rule for mdns-aidl-interface classes.
Bug: 209894875
Test: atest FrameworksNetTests CtsNetTestCases
Change-Id: Ibc8b726c01a15015b450caf94d0afed570117b7f
Move iterator and NetworkStats.Entry getters to system-current
according to API council feedback. This reverts parts of
ag/17117903.
Ignore-AOSP-First: Parent CLs does not exist in aosp yet.
Test: TH
Fix: 225168182
Change-Id: Ia7fdf8d31a96a26b0bf1682f462292b051560477
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
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
Ignore-AOSP-First: CP to make automerger happy.
Change-Id: I3361ad0e01e761ffd77faf6c55924fa4612ede90
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
Ignore-AOSP-First: CP to make automerger happy.
Change-Id: I7c46545a47034be409071c2ec007d9e1480c6ed0
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
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
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
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
This is not currently used by anyone, but will allow us to only update
NetworkCapabilities in the future. This could be useful for testing.
Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: I9697399bad2bfe66c6f328064be75f4dfa10af81
This is not currently used by anyone, but will allow us to only update
NetworkCapabilities in the future. This could be useful for testing.
Test: atest EthernetServiceTests
Bug: 220017952
Change-Id: I9697399bad2bfe66c6f328064be75f4dfa10af81