settings: allow enabling ethernet tethering independent of link state

A user should be able to enable tethering even if the interface does not
have link yet. Therefore, the toggle should be active if any interface
is available, independent of its link state.

Test: TH
Bug: 234036868
Change-Id: I2ae25207a766d71217dd6d17f3f9b74ceb261238
This commit is contained in:
Patrick Rohr
2023-03-08 00:54:52 +00:00
parent 5bb798f518
commit 6f9062297f

View File

@@ -50,7 +50,7 @@ public final class EthernetTetherPreferenceController extends TetherBasePreferen
@OnLifecycleEvent(Lifecycle.Event.ON_START)
public void onStart() {
mEthernetListener = (iface, state, role, configuration) -> {
if (state == EthernetManager.STATE_LINK_UP) {
if (state != EthernetManager.STATE_ABSENT) {
mAvailableInterfaces.add(iface);
} else {
mAvailableInterfaces.remove(iface);