Remove hidden ArrayUtils usage in TetheringTest
Use CollectionUtils instead, which avoids using a hidden API. Avoiding hidden API usage in tests is good in general, but this also helps avoid jarjar problems where the com.android.internal.util package is jarjared to some other package as some of its classes are included in the module, and ArrayUtils cannot be found in the renamed package. Bug: 192535368 Test: atest TetheringTest Change-Id: I54dc8f6429d132a953ab1a674fe349fba4335936
This commit is contained in:
@@ -178,10 +178,10 @@ import androidx.annotation.NonNull;
|
||||
import androidx.test.filters.SmallTest;
|
||||
import androidx.test.runner.AndroidJUnit4;
|
||||
|
||||
import com.android.internal.util.ArrayUtils;
|
||||
import com.android.internal.util.StateMachine;
|
||||
import com.android.internal.util.test.BroadcastInterceptingContext;
|
||||
import com.android.internal.util.test.FakeSettingsProvider;
|
||||
import com.android.net.module.util.CollectionUtils;
|
||||
import com.android.networkstack.tethering.TestConnectivityManager.TestNetworkAgent;
|
||||
import com.android.testutils.MiscAsserts;
|
||||
|
||||
@@ -365,7 +365,8 @@ public class TetheringTest {
|
||||
final String[] ifaces = new String[] {
|
||||
TEST_RNDIS_IFNAME, TEST_WLAN_IFNAME, TEST_WIFI_IFNAME, TEST_MOBILE_IFNAME,
|
||||
TEST_DUN_IFNAME, TEST_P2P_IFNAME, TEST_NCM_IFNAME, TEST_ETH_IFNAME};
|
||||
return new InterfaceParams(ifName, ArrayUtils.indexOf(ifaces, ifName) + IFINDEX_OFFSET,
|
||||
return new InterfaceParams(ifName,
|
||||
CollectionUtils.indexOf(ifaces, ifName) + IFINDEX_OFFSET,
|
||||
MacAddress.ALL_ZEROS_ADDRESS);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user