Update interface impact API per council comments

- List -> Set
- Consistent API and result class naming

Bug: 222434684
Test: atest WifiManagerTest#testIsItPossibleToCreateInterface
Test: atest android.net.wifi.cts.WifiManagerTest#testIsItPossibleToCreateInterface
Change-Id: I98c91dbb0067ca99a4eedcb1d1185109df7f395c
diff --git a/framework/api/current.txt b/framework/api/current.txt
index 61df8c3..7e219c6 100644
--- a/framework/api/current.txt
+++ b/framework/api/current.txt
@@ -468,7 +468,7 @@
     method @Deprecated public void removePasspointConfiguration(String);
     method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void removeSuggestionConnectionStatusListener(@NonNull android.net.wifi.WifiManager.SuggestionConnectionStatusListener);
     method @RequiresPermission(android.Manifest.permission.ACCESS_WIFI_STATE) public void removeSuggestionUserApprovalStatusListener(@NonNull android.net.wifi.WifiManager.SuggestionUserApprovalStatusListener);
-    method @RequiresPermission(allOf={android.Manifest.permission.MANAGE_WIFI_INTERFACES, android.Manifest.permission.ACCESS_WIFI_STATE}) public void reportCreateInterfaceImpact(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.BiConsumer<java.lang.Boolean,java.util.List<android.net.wifi.WifiManager.InterfaceCreationConsequence>>);
+    method @RequiresPermission(allOf={android.Manifest.permission.MANAGE_WIFI_INTERFACES, android.Manifest.permission.ACCESS_WIFI_STATE}) public void reportCreateInterfaceImpact(int, boolean, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.BiConsumer<java.lang.Boolean,java.util.List<android.net.wifi.WifiManager.InterfaceCreationImpact>>);
     method @Deprecated public boolean saveConfiguration();
     method public void setTdlsEnabled(java.net.InetAddress, boolean);
     method public void setTdlsEnabledWithMacAddress(String, boolean);
@@ -567,10 +567,10 @@
     field public final int statusCode;
   }
 
-  public static class WifiManager.InterfaceCreationConsequence {
-    ctor public WifiManager.InterfaceCreationConsequence(int, @NonNull java.util.List<java.lang.String>);
+  public static class WifiManager.InterfaceCreationImpact {
+    ctor public WifiManager.InterfaceCreationImpact(int, @NonNull java.util.Set<java.lang.String>);
     method public int getInterfaceType();
-    method @NonNull public java.util.List<java.lang.String> getPackages();
+    method @NonNull public java.util.Set<java.lang.String> getPackages();
   }
 
   public static class WifiManager.LocalOnlyHotspotCallback {
diff --git a/framework/java/android/net/wifi/WifiManager.java b/framework/java/android/net/wifi/WifiManager.java
index a492038..2fa2d73 100644
--- a/framework/java/android/net/wifi/WifiManager.java
+++ b/framework/java/android/net/wifi/WifiManager.java
@@ -9601,21 +9601,21 @@
     public @interface WifiInterfaceType {}
 
     /**
-     * Class describing a consequence of interface creation - returned by
+     * Class describing an impact of interface creation - returned by
      * {@link #reportCreateInterfaceImpact(int, boolean, Executor, BiConsumer)}. Due to Wi-Fi
      * concurrency limitations certain interfaces may have to be torn down. Each of these
      * interfaces was requested by a set of applications who could potentially be impacted.
      *
      * This class contain the information for a single interface: the interface type with
-     * {@link InterfaceCreationConsequence#getInterfaceType()} and the list of impacted packages
-     * with {@link InterfaceCreationConsequence#getPackages()}.
+     * {@link InterfaceCreationImpact#getInterfaceType()} and the set of impacted packages
+     * with {@link InterfaceCreationImpact#getPackages()}.
      */
-    public static class InterfaceCreationConsequence {
+    public static class InterfaceCreationImpact {
         private final int mInterfaceType;
-        private final List<String> mPackages;
+        private final Set<String> mPackages;
 
-        public InterfaceCreationConsequence(@WifiInterfaceType int interfaceType,
-                @NonNull List<String> packages) {
+        public InterfaceCreationImpact(@WifiInterfaceType int interfaceType,
+                @NonNull Set<String> packages) {
             mInterfaceType = interfaceType;
             mPackages = packages;
         }
@@ -9632,7 +9632,7 @@
          * @return The list of potentially impacted packages due to tearing down the interface
          * specified in {@link #getInterfaceType()}.
          */
-        public @NonNull List<String> getPackages() {
+        public @NonNull Set<String> getPackages() {
             return mPackages;
         }
     }
@@ -9644,7 +9644,7 @@
      * which returns two arguments:
      * <li>First argument: a {@code boolean} - indicating whether or not the interface can be
      * created.</li>
-     * <li>Second argument: a {@code List<Pair<Integer, String[]>>} - if the interface can be
+     * <li>Second argument: a {@code List<InterfaceCreationImpact>} - if the interface can be
      * created (first argument is {@code true} then this is the list of interface types which
      * will be removed and the packages which requested them. Possibly an empty list. If the
      * first argument is {@code false}, then an empty list will be returned here.</li>
@@ -9669,7 +9669,7 @@
      * @param executor An {@link Executor} on which to return the result.
      * @param resultCallback The asynchronous callback which will return two argument: a
      * {@code boolean} (whether the interface can be created), and a
-     * {@code List<InterfaceCreationConsequence>} (a list of {@link InterfaceCreationConsequence}:
+     * {@code List<InterfaceCreationImpact>} (a list of {@link InterfaceCreationImpact}:
      *                       interfaces which will be destroyed when the interface is created
      *                       and the packages which requested them and thus may be impacted).
      */
@@ -9679,7 +9679,7 @@
     public void reportCreateInterfaceImpact(@WifiInterfaceType int interfaceType,
             boolean requireNewInterface,
             @NonNull @CallbackExecutor Executor executor,
-            @NonNull BiConsumer<Boolean, List<InterfaceCreationConsequence>> resultCallback) {
+            @NonNull BiConsumer<Boolean, List<InterfaceCreationImpact>> resultCallback) {
         Objects.requireNonNull(executor, "Non-null executor required");
         Objects.requireNonNull(resultCallback, "Non-null resultCallback required");
         try {
@@ -9704,14 +9704,14 @@
                                 return;
                             }
 
-                            final List<InterfaceCreationConsequence> finalList =
+                            final List<InterfaceCreationImpact> finalList =
                                     (canCreate && interfacesToDelete.length > 0) ? new ArrayList<>()
                                             : Collections.emptyList();
                             if (canCreate) {
                                 for (int i = 0; i < interfacesToDelete.length; ++i) {
                                     finalList.add(
-                                            new InterfaceCreationConsequence(interfacesToDelete[i],
-                                                    Arrays.asList(
+                                            new InterfaceCreationImpact(interfacesToDelete[i],
+                                                    new ArraySet<>(
                                                             packagesForInterfaces[i].split(","))));
                                 }
                             }
diff --git a/framework/tests/src/android/net/wifi/WifiManagerTest.java b/framework/tests/src/android/net/wifi/WifiManagerTest.java
index cecadac..1d0718d 100644
--- a/framework/tests/src/android/net/wifi/WifiManagerTest.java
+++ b/framework/tests/src/android/net/wifi/WifiManagerTest.java
@@ -133,7 +133,6 @@
 import org.mockito.MockitoAnnotations;
 
 import java.util.ArrayList;
-import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
@@ -3767,17 +3766,17 @@
                 {WifiManager.WIFI_INTERFACE_TYPE_AP, WifiManager.WIFI_INTERFACE_TYPE_AWARE};
         final String[] packagesForInterfaces =
                 {TEST_PACKAGE_NAME, packageName1 + "," + packageName2};
-        final List<WifiManager.InterfaceCreationConsequence> interfacePairs = List.of(
-                new WifiManager.InterfaceCreationConsequence(interfaces[0],
-                        Arrays.asList(new String[]{TEST_PACKAGE_NAME})),
-                new WifiManager.InterfaceCreationConsequence(interfaces[1],
-                        Arrays.asList(new String[]{packageName1, packageName2})));
+        final List<WifiManager.InterfaceCreationImpact> interfacePairs = List.of(
+                new WifiManager.InterfaceCreationImpact(interfaces[0],
+                        new ArraySet<>(new String[]{TEST_PACKAGE_NAME})),
+                new WifiManager.InterfaceCreationImpact(interfaces[1],
+                        new ArraySet<>(new String[]{packageName1, packageName2})));
         when(mContext.getOpPackageName()).thenReturn(TEST_PACKAGE_NAME);
-        BiConsumer<Boolean, List<WifiManager.InterfaceCreationConsequence>> resultCallback = mock(
+        BiConsumer<Boolean, List<WifiManager.InterfaceCreationImpact>> resultCallback = mock(
                 BiConsumer.class);
         ArgumentCaptor<IInterfaceCreationInfoCallback.Stub> cbCaptor = ArgumentCaptor.forClass(
                 IInterfaceCreationInfoCallback.Stub.class);
-        ArgumentCaptor<List<WifiManager.InterfaceCreationConsequence>> resultCaptor =
+        ArgumentCaptor<List<WifiManager.InterfaceCreationImpact>> resultCaptor =
                 ArgumentCaptor.forClass(List.class);
 
         mWifiManager.reportCreateInterfaceImpact(interfaceToCreate, requireNewInterface,