diff options
Diffstat (limited to 'framework-t/src/android/net/EthernetManager.java')
| -rw-r--r-- | framework-t/src/android/net/EthernetManager.java | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/framework-t/src/android/net/EthernetManager.java b/framework-t/src/android/net/EthernetManager.java index 9a4ad5f57d..e02ea897db 100644 --- a/framework-t/src/android/net/EthernetManager.java +++ b/framework-t/src/android/net/EthernetManager.java @@ -39,6 +39,7 @@ import com.android.modules.utils.BackgroundThread; import java.lang.annotation.Retention; import java.lang.annotation.RetentionPolicy; import java.util.ArrayList; +import java.util.List; import java.util.Objects; import java.util.concurrent.Executor; import java.util.function.IntConsumer; @@ -709,4 +710,20 @@ public class EthernetManager { 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(); + } + } } |
