From ddc2622ec7b0a29b66c8c18bf763d675b5ee0c5c Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 4 Apr 2022 14:59:31 +0200 Subject: [PATCH 1/3] Fix linter errors Test: TH Change-Id: I27ad329811a4794050b25976e79909ce8c57d7a3 --- .../com/android/server/ethernet/EthernetNetworkFactory.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java index d910629983..eb22f7875b 100644 --- a/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java +++ b/service-t/src/com/android/server/ethernet/EthernetNetworkFactory.java @@ -23,14 +23,13 @@ import android.content.res.Resources; import android.net.ConnectivityManager; import android.net.ConnectivityResources; import android.net.EthernetManager; -import android.net.EthernetNetworkSpecifier; import android.net.EthernetNetworkManagementException; +import android.net.EthernetNetworkSpecifier; import android.net.INetworkInterfaceOutcomeReceiver; import android.net.IpConfiguration; import android.net.IpConfiguration.IpAssignment; import android.net.IpConfiguration.ProxySettings; import android.net.LinkProperties; -import android.net.Network; import android.net.NetworkAgentConfig; import android.net.NetworkCapabilities; import android.net.NetworkFactory; From 0f2cbe92f1d02b3d4f363c3f58bc33497360899c Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 28 Mar 2022 11:47:20 +0200 Subject: [PATCH 2/3] Update javadoc to match expectation for UnsupportedOperationException Test: builds Change-Id: I44eac15972ed099fc12599a78a71557a7b16d593 --- framework-t/src/android/net/EthernetManager.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/framework-t/src/android/net/EthernetManager.java b/framework-t/src/android/net/EthernetManager.java index e02ea897db..767b392468 100644 --- a/framework-t/src/android/net/EthernetManager.java +++ b/framework-t/src/android/net/EthernetManager.java @@ -554,7 +554,8 @@ public class EthernetManager { * information about the error. * @throws SecurityException if the process doesn't hold * {@link android.Manifest.permission.MANAGE_ETHERNET_NETWORKS}. - * @throws UnsupportedOperationException if called on a non-automotive device or on an + * @throws UnsupportedOperationException if the {@link NetworkCapabilities} are updated on a + * non-automotive device or this function is called on an * unsupported interface. * @hide */ From 50c470e3088c684997950d03baa4180d0ca4af71 Mon Sep 17 00:00:00 2001 From: Patrick Rohr Date: Mon, 28 Mar 2022 13:03:08 +0200 Subject: [PATCH 3/3] Address EthernetManager javadoc review comments Test: TH Change-Id: Iafa8979d8e96ea4d078b017e56ee61334d33b5f5 --- framework-t/src/android/net/EthernetManager.java | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/framework-t/src/android/net/EthernetManager.java b/framework-t/src/android/net/EthernetManager.java index 767b392468..2b76dd935f 100644 --- a/framework-t/src/android/net/EthernetManager.java +++ b/framework-t/src/android/net/EthernetManager.java @@ -541,8 +541,7 @@ public class EthernetManager { * Similarly, use {@link NetworkCapabilities.Builder} to build a {@code NetworkCapabilities} * object for this network to put inside the {@code request}. * - * This function accepts an {@link OutcomeReceiver} that is called once the operation has - * finished execution. + * The provided {@link OutcomeReceiver} is called once the operation has finished execution. * * @param iface the name of the interface to act upon. * @param request the {@link EthernetNetworkUpdateRequest} used to set an ethernet network's @@ -583,9 +582,9 @@ public class EthernetManager { /** * Enable a network interface. * - * Enables a previously disabled network interface. - * This function accepts an {@link OutcomeReceiver} that is called once the operation has - * finished execution. + * Enables a previously disabled network interface. An attempt to enable an already-enabled + * interface is ignored. + * The provided {@link OutcomeReceiver} is called once the operation has finished execution. * * @param iface the name of the interface to enable. * @param executor an {@link Executor} to execute the callback on. Optional if callback is null. @@ -620,10 +619,9 @@ public class EthernetManager { /** * Disable a network interface. * - * Disables the use of a network interface to fulfill network requests. If the interface - * currently serves a request, the network will be torn down. - * This function accepts an {@link OutcomeReceiver} that is called once the operation has - * finished execution. + * Disables the specified interface. If this interface is in use in a connected + * {@link android.net.Network}, then that {@code Network} will be torn down. + * The provided {@link OutcomeReceiver} is called once the operation has finished execution. * * @param iface the name of the interface to disable. * @param executor an {@link Executor} to execute the callback on. Optional if callback is null.