Merge "Add getInterfaceList module-lib API in EthernetManager."
This commit is contained in:
@@ -39,6 +39,7 @@ import com.android.modules.utils.BackgroundThread;
|
|||||||
import java.lang.annotation.Retention;
|
import java.lang.annotation.Retention;
|
||||||
import java.lang.annotation.RetentionPolicy;
|
import java.lang.annotation.RetentionPolicy;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.concurrent.Executor;
|
import java.util.concurrent.Executor;
|
||||||
import java.util.function.IntConsumer;
|
import java.util.function.IntConsumer;
|
||||||
@@ -709,4 +710,20 @@ public class EthernetManager {
|
|||||||
maybeRemoveServiceListener();
|
maybeRemoveServiceListener();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns an array of existing Ethernet interface names regardless whether the interface
|
||||||
|
* is available or not currently.
|
||||||
|
* @hide
|
||||||
|
*/
|
||||||
|
@RequiresPermission(android.Manifest.permission.ACCESS_NETWORK_STATE)
|
||||||
|
@SystemApi(client = MODULE_LIBRARIES)
|
||||||
|
@NonNull
|
||||||
|
public List<String> getInterfaceList() {
|
||||||
|
try {
|
||||||
|
return mService.getInterfaceList();
|
||||||
|
} catch (RemoteException e) {
|
||||||
|
throw e.rethrowAsRuntimeException();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ import android.net.EthernetNetworkUpdateRequest;
|
|||||||
import android.net.INetworkInterfaceOutcomeReceiver;
|
import android.net.INetworkInterfaceOutcomeReceiver;
|
||||||
import android.net.ITetheredInterfaceCallback;
|
import android.net.ITetheredInterfaceCallback;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface that answers queries about, and allows changing
|
* Interface that answers queries about, and allows changing
|
||||||
* ethernet configuration.
|
* ethernet configuration.
|
||||||
@@ -44,4 +46,5 @@ interface IEthernetManager
|
|||||||
void connectNetwork(String iface, in INetworkInterfaceOutcomeReceiver listener);
|
void connectNetwork(String iface, in INetworkInterfaceOutcomeReceiver listener);
|
||||||
void disconnectNetwork(String iface, in INetworkInterfaceOutcomeReceiver listener);
|
void disconnectNetwork(String iface, in INetworkInterfaceOutcomeReceiver listener);
|
||||||
void setEthernetEnabled(boolean enabled);
|
void setEthernetEnabled(boolean enabled);
|
||||||
|
List<String> getInterfaceList();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user